AI Knowledge
AI Knowledge (ai-knowledge) is the platform’s retrieval layer. It indexes your documents
and entities and answers queries over them — by keyword, by meaning, or by both at once.
Search is where most applications actually need AI, and it is also the layer that makes generative answers trustworthy. A model asked a question cold will produce something plausible; a model handed the right three passages will produce something correct. AI Knowledge is the block that finds those passages.
One service, several retrieval modes
Section titled “One service, several retrieval modes”Different questions want different retrieval. Rather than run a search engine and a vector database and reconcile them in application code, you declare what you are indexing and query it through one API.
| Mode | Matches on | Good for |
|---|---|---|
| Lexical | Exact terms and keywords | Document search, product codes, names, error strings |
| Semantic | Meaning, via embeddings | Natural-language questions, paraphrases, Q&A |
| Hybrid | Both, fused into one ranking | The general case — the default worth starting with |
| Entity | Structured records from your datastores | Lookups over things you already model |
Lexical search finds “ERR_CONN_4021” when someone types it exactly. Semantic search finds the troubleshooting page for “my connection keeps dropping”. Hybrid does both and ranks them together — which is why it is usually the right default, and why running the two systems separately tends to disappoint on both axes.
Backends
Section titled “Backends”The block is a uniform surface over the storage engines that suit each mode:
| Backend | Used for |
|---|---|
| Meilisearch | Lexical and faceted search |
| pgvector | Semantic search, co-located with your relational data |
| Milvus | Semantic search at larger vector volumes |
Which backend serves a collection is configuration. Your queries do not change when you move a collection from pgvector to Milvus because it outgrew the former.
Indexing a document
Section titled “Indexing a document”POST /index/pgvector/companyX-Kis-Tenant: acme
{ "docid": "01JB7CY1Q6R0GK09RZAVDQGF11", "doctype": "company", "contenttype": "text", "document": { "name": "kis.ai", "legalname": "kis.ai LLC" }}Embeddings are generated on the way in for any field declared as semantically searchable — you index documents, not vectors.
Searching
Section titled “Searching”POST /search/pgvector/companyX-Kis-Tenant: acme
{ "query": "Appleby", "limit": 5, "mode": "hybrid"}{ "results": [ { "docid": "01JB7CY1Q6R0GK09RZAVDQGF11", "score": 0.94, "data": { "name": "Appleby Industries" }, "meta": { "match": "name matched" } } ]}Results carry a score and match metadata, so a caller can tell why something ranked where it did — which matters when you are debugging a bad answer three layers up in a bot.
Where it fits
Section titled “Where it fits”AI Knowledge is the retrieval half of RAG. AI Bot’s rag resolution path
queries a collection here and passes what it finds to a grounded generation through the
AI Gateway. Flows retrieve from it the same way.
It is not a memory service — for conversation history and long-term recall see AI Memory. Knowledge is about your corpus; memory is about the conversation.
- Core Concepts — collections, fields, embeddings and ranking
- Configuration — declaring collections and backends
- Operations — indexing throughput, reindexing and what to watch