Retrieve Service
Bases: Service
Service responsible for handling semantic prompt retrieval. It communicates with vector and document databases via plugins and tracks operational metrics for observability.
Attributes:
Name | Type | Description |
---|---|---|
plugin_manager |
PluginManager
|
Plugin manager to access database and vector services. |
vector_db_plugin |
dict
|
Plugin for interacting with the vector database. |
db_plugin |
dict
|
Plugin for document database operations. |
metrics_tracker |
MetricsTracker
|
Tracks various retrieval-related metrics. |
meta_repository |
MetaRepository
|
Handles persistence and loading of Meta objects. |
Methods:
Name | Description |
---|---|
init_async |
Initializes the database connection. |
start |
Subscribes to service topics for prompt submission, indexing, and metadata completion. |
stop |
Stops the service and cleans up subscriptions. |
submit |
Initiates the retrieval process for a given prompt and logs metrics. |
on_submit_prompt |
Handles incoming prompt strings from messaging, wraps them in a Prompt object, and triggers retrieval. |
on_index_complete |
Callback that handles completed indices and submits them to the vector DB. |
on_meta_complete |
Callback for completed metadata, converts and submits to vector DB. |
insert_meta_vector |
Asynchronously inserts metadata summaries into the vector DB. |
insert_engram_vector |
Asynchronously inserts semantic indices into the vector DB. |
on_acknowledge |
Handles status reporting and resets the current metric tracker. |
Source code in src/engramic/application/retrieve/retrieve_service.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|