AI Knowledge Operations
Loading and reloading definitions
Section titled “Loading and reloading definitions”The search service reads a tenant’s definitions from its product’s search/ folder when the
tenant is configured, and again whenever a file in the folder or the tenant’s configuration
changes. A set that validates replaces the tenant’s previous one: the tenant’s open engine
connections close, and the next request uses the new set. A set that does not validate is
logged and refused, and the tenant keeps serving the set it had.
Until a tenant’s definitions have loaded, its requests answer 503 definitions-not-found. List
the tenants to load at start under loadtenants in the service’s boot configuration to have
them ready before the first request.
After a deploy, GET /list/documents with a caller that may search everything confirms which
documents the tenant serves.
Where documents are stored
Section titled “Where documents are stored”Each tenant has its own store for each document:
| Engine | Store | Name |
|---|---|---|
| Meilisearch | An index | <tenant namespace>_<12 hex characters>__<document> |
| Milvus | A collection | s_ followed by the same name |
| pgvector | A table | In the tenant’s search datastore, one per document |
The tenant namespace is the tenant key in lowercase, with - folded to _ and _ between its
segments; the hex characters are a hash of the exact tenant key, so two tenant keys never share
a store. The
service creates a Meilisearch index or a Milvus collection the first time a tenant uses it, and
brings the pgvector tables in line with the definitions when they load.
Changing a definition
Section titled “Changing a definition”| Change | Takes effect |
|---|---|
| A new document or backend | When the set loads |
| A new field, on Meilisearch or pgvector | For documents indexed from then on; re-index the others to fill it |
| Any field change, on Milvus | Milvus keeps a collection’s fields as created: declare the document under a new name, index into it, and move searches over when it is full |
A field’s index flag (Meilisearch) | At the next index or search request for the document after the set loads |
| An access rule | When the set loads, for every request after it |
A vector field’s dimension or distance_metric | Declare a new document, or a new vector field, index into it, and move searches over when it is full |
Re-indexing is indexing again with the same ids: each request replaces the documents it names.
Bulk loads
Section titled “Bulk loads”An index request carries up to 500 documents. For a large load, send batches of that size from one or a few workers, and re-send a batch that fails: the ids make it safe to repeat. A batch is checked whole before it is written, so a refusal names the document at fault and writes nothing.
The Data sync
Section titled “The Data sync”A document fed by a sync mapping follows its Data entity without any calls from you. Each
delivery is answered applied, duplicate or skipped, and Data’s outbox retries a delivery
the search service answered with an error, such as an unreachable engine. A delivery answered
skipped is logged by the search service with the entity, the id and the reason; a steady
stream of them means the mapping and the entity disagree, for example a document field whose
entity field was renamed.
Keeping the source of truth
Section titled “Keeping the source of truth”The search indexes hold copies. Keep the records themselves in Data or in your own system, so any document, or a whole tenant’s index, can be rebuilt by indexing again.
What to watch
Section titled “What to watch”| Signal | Reading it |
|---|---|
503 definitions-not-found | A tenant’s definitions are not loaded: look for the load error in the service log |
503 backend-unavailable | The tenant’s engine is unreachable, or backend.<engine>.url is missing from its configuration |
503 datastore-not-configured | A pgvector backend with no search datastore on the tenant |
502 backend-failed | The engine answered with an error; the cause is in the service log |
skipped sync deliveries | A sync mapping that no longer fits its entity |
| Search latency by backend | Vector search cost grows with the number of documents and their dimension |
| Zero-result searches | Queries whose terms your documents do not use, or filters and row rules that admit nothing |
The service’s health and readiness probes are the platform’s, see API conventions.