Architecture
GraphRAG separates what it knows about tenants from what a tenant knows.
Two planes
| Plane | Store | Holds |
|---|---|---|
| Control | PostgreSQL | projects, API keys, ingestion jobs, the document registry |
| Knowledge | Graph database | one isolated database per tenant (kb_<project_id>): chunks, entities, relationships, embeddings |
Isolation is enforced twice: the application only ever addresses a tenant’s own database, and each tenant has its own database credentials so a scoping bug cannot cross the boundary at the storage layer either.
Ingestion pipeline
When you upload a document, a background worker runs it through:
- Parse — the file is converted to text locally (no third-party upload). PDF, Office, HTML, Markdown and more are supported.
- Chunk — the text is split into overlapping passages.
- Embed — each chunk gets a vector embedding.
- Extract — a language model reads each chunk and emits entities and relationships, constrained by the tenant’s ontology. Every relationship keeps the chunk that stated it, so graph facts remain citable.
- Canonicalise & link — entities are de-duplicated and linked;
MENTIONSedges connect chunks to entities andRELATES_TOedges connect entities to each other.
Ingestion is idempotent (re-uploading identical content does not duplicate it) and crash-recoverable (a job that fails part-way is retried or cleanly marked terminal).
Retrieval pipeline
A query flows through:
- Hybrid retrieval — semantic vector search and keyword full-text search run in parallel and are fused (reciprocal-rank fusion).
- Re-rank — a cross-encoder re-orders the candidates by relevance and trims to your
k. - Graph expansion (optional, off by default) — from the entities in the retrieved chunks, the graph can recover related evidence and merge it back into the same budget.
- Synthesis — the passages are handed to a language model, which answers with citations. Citations are validated against the passages actually supplied.
/v1/search returns the retrieved passages (and the subgraph); /v1/answer adds the synthesized,
cited answer. See the Search & Answer reference.