Embedding and retrieval#
A corpus, an embedding job and a search. The API queues work; a worker prepares, encodes, stores and indexes it; searches read the serving index.
Building a corpus#
Step |
What happens |
Route or tool |
|---|---|---|
1 |
Create a corpus from catalog sources |
|
2 |
The job registry (PostgreSQL) records the corpus and its sources |
|
3 |
Submit an embedding job for one source and one embedding space |
|
4 |
The job is queued with an idempotency key and a reference to the caller’s model grant |
|
5-6 |
|
|
7-8 |
The encoder (a model pack adapter) encodes the inputs after GPU admission, one vector per input |
|
9-11 |
Vector artifacts are written and recorded, an index generation is built, and the generation is published atomically |
|
12 |
Poll the job. Stages: queued, resolved, prepared, embedded, persisted, searchable, completed |
|
Searching#
POST /v1/retrieval/search (MCP retrieval_search) takes text, content, a vector or a
stored artifact. A text or content query is encoded in the same space, the serving index is
searched with filters and an optional snapshot, and ranked hits come back with provenance.
State#
State |
Where |
|---|---|
Jobs, corpora, artifact registry |
|
Vector artifacts |
Vector files on disk |
Serving index |
Milvus, provisioned by the operator, optional |
Sources enter through a sensor-neutral port; packs register input types and product
resolvers. Vectors computed elsewhere can be imported with
POST /v1/retrieval/corpora/{corpus_id}/imports.
Reference: Retrieval API.