kontext-brain
A TypeScript retrieval framework for AI agents that structures multi-source knowledge as resources, chunks, entities, facts and access-controlled evidence in a knowledge graph, instead of treating a corpus as a flat vector index.
kontext-brain runs retrieval as a bounded, best-first "Lift to Expand to Ground" traversal over a knowledge graph of Resources, source-native Chunks, Entities, Facts and ACL-aware Evidence, seeded from a query, rather than a single vector similarity search. Only the source chunks selected as evidence are hydrated before an answer is generated, and an optional ontology layer can stage routing for backward compatibility, though it is not treated as the definition of production retrieval.
Its default retrieval configuration combines original-query-anchored multi-query retrieval, fusion of graph, vector and BM25 search, coverage-aware reranking, source hydration, and answers constrained by evidence needs. An included RAG evaluation harness benchmarks this configuration against GraphRAG-Bench Medical and Novel datasets plus BEIR SciFact and NFCorpus as public retrieval guardrails.
The production path keeps external systems as the source of truth and maintains a derived, evidence-backed index on top of them, rather than replacing them with a flat vector store. It is written in TypeScript for Node.js.