Knowledge Workspace treats the language model as untrusted for the one thing that matters in a RAG system: it must not be able to fabricate an answer. The design makes an uncited claim structurally impossible.
The LLM plans the query. Deterministic code traverses the graph, retrieves evidence, and grounds every claim in a cited source.
The planner returns only a query plan (seed kinds, relationships, depth) — validated by Zod
in src/engine/llm.ts and bounded by the orchestrator. It never reads the graph and never
writes prose. The answer is composed only from retrieved evidence in src/engine/answer.ts.
-
No ungrounded claims.
composebuilds the answer from evidence entities; each claim is tied to one evidence item with a source, optional section, and confidence. There is no code path that emits a sentence not backed by an evidence record. -
Honest abstention. If semantic search finds no entity close to the question (after a lexical-overlap gate that removes embedding collisions), or the seeds have no citable supporting evidence, the engine returns
insufficient_evidencewith the missing information — never a guess. -
Bounded traversal. The plan's
maxHopsis capped by the engine's agent limit regardless of what the model requests, and the token estimate is checked against a budget before any work runs. -
Validated boundaries. The planner's output and all ingested graph data are parsed with Zod before the deterministic core touches them.
-
Append-only audit trail. Every step — plan, seeds, traversal, each evidence item, the composed answer — is an immutable event, so you can see exactly why an answer was (or was not) produced.
The evaluation includes an off-topic question ("What is our policy on pineapple pizza?"). The engine returns zero claims and zero citations and reports the missing information. This is asserted in the tests and the eval, and it is the security-relevant property: the system would rather say "I don't know" than invent a grounded-looking answer.
- This is a portfolio/reference implementation. There is no auth or multi-tenant isolation; the demo graph is public sample data.
- The default embedder is a deterministic hashing embedder chosen for reproducibility, not
retrieval quality; a real model sits behind the
Embedderinterface. - Ingestion of untrusted documents into the graph is a roadmap item; today the graph is loaded from validated seed data or the Postgres store.
This is a personal portfolio project. If you find a security issue, please open an issue describing it.