Enterprise RAG Has a Blindspot Nobody Measures: We Fixed It with a Temporal Claim Graph on FalkorDB
Enterprise RAG Has a Blindspot Nobody Measures: We Fixed It with a Temporal Claim Graph on FalkorDB Enterprise knowledge is not a bag of facts. It is time-bound assertions. Here is a failure mode that almost
Enterprise RAG Has a Blindspot Nobody Measures: We Fixed It with a Temporal Claim Graph on FalkorDB
Enterprise knowledge is not a bag of facts. It is time-bound assertions.
Here is a failure mode that almost every production RAG (Retrieval-Augmented Generation) pipeline encounters:
An employee asks: "What is our tier-1 enterprise discount threshold?"
The retriever searches across 500,000 internal documents.
It finds a Confluence page from 2022 that says: "Discounts apply at $100k."
The BM25 score is sky-high. The embedding cosine similarity is 0.94.
The retriever ranks it #1 or #2 in context.
The LLM reads it and responds with complete confidence: "Our discount threshold is $100k."
The document is highly relevant. It is also completely false.
Six months later, VP Finance signed an update: "Effective Q3 2023, the enterprise discount threshold is increased to $250k, superseding all previous guidelines."
Eight other internal documents still quote the old $100k price. If your agent uses majority voting, outdated documents win 8 to 1. If your retriever uses vector similarity, the old document matches the query phrasing better than the revision memo.
The model didn't hallucinate. It faithfully summarized the evidence it was given.
To fix this, we built Canon: a temporal truth layer for enterprise AI powered by FalkorDB. Canon sits directly between retrieval and generation, transforming documents into a temporal claim graph that decides which evidence is still valid before the language model ever sees it.
The Core Primitive: The Temporal Cut
Instead of treating an enterprise corpus as an unorganized bucket of text chunks, Canon structures claims into a temporal graph.
[2022 Confluence Doc]
β
(asserts: $100k)
β
βΌ
(:Proposition {state: "SUPERSEDED"})
β²
β [:SUPERSEDES]
β
(:CanonEvent {provenance: "Memo Q3 2023", t: 1690848000})
β
βΌ
(:Proposition {state: "VALID", value: "$250k"})
When an enterprise query arrives, Canon executes the Temporal Cut:
- Retrieve candidate documents using standard high-recall retrieval (BM25 or dense embeddings).
- Graph Traversal: Inspect the propositions asserted by the retrieved candidates in FalkorDB.
-
Identify Superseded Evidence: Any proposition that has an incoming
[:SUPERSEDES]relation from a later, validCanonEventis marked invalid. - Cut Out Expired Documents: Remove the invalidated documents from the prompt window.
- Backfill: Pull the next best candidate from the original retrieval ranking so the model still receives a full context window.
BM25 Candidates: [Doc A (Rank 1), Doc B (Rank 2), Doc C (Rank 3), Doc D (Rank 4)]
β
FalkorDB Check: [Doc B asserts Proposition_129, which was SUPERSEDED by Event_42]
β
Temporal Cut: [Doc B REMOVED]
β
Backfill: [Doc A (Rank 1), Doc C (Rank 3), Doc D (Rank 4), Doc E (Rank 5)]
The beauty of this architecture is division of responsibility: Your retriever decides what is relevant. The FalkorDB graph decides what is still true.
Why FalkorDB Is the Engine (Not Just a Store)
Temporal graph traversal at query time cannot add 200ms of latency to an LLM pipeline. The graph resolution must happen in single-digit milliseconds before prompt serialization.
We chose FalkorDB as our core graph engine for three specific reasons:
1. Blazing Fast Traversal (<3ms)
FalkorDB's GraphBLAS sparse-matrix representation and in-memory execution mean multi-hop reachability queries resolve in 2 to 4 milliseconds. In an interactive agentic loop, this overhead is practically invisible.
2. Expressive Cypher for Temporal Lineage
Every claim transition in Canon is reified as a CanonEvent node with exact evidence byte spans, timestamps, and attribution edges.
To check if any retrieved proposition is superseded or contested, Canon runs a single Cypher query:
MATCH (p:Proposition)-[:ASSERTED_IN]->(a:Assertion)-[:SOURCED_FROM]->(art:Artifact)
WHERE art.id IN $retrieved_doc_ids
OPTIONAL MATCH (newer_event:CanonEvent)-[:SUPERSEDES]->(p)
RETURN art.id AS doc_id,
p.id AS prop_id,
p.status AS status,
count(newer_event) > 0 AS is_superseded,
newer_event.evidence_span AS superseding_evidence
If is_superseded is true, the document is cut instantly.
3. Entity & Alias Resolution (Company Brain)
Enterprise documents refer to the same people, teams, and products by dozens of names ("T. Farhan", "Toufiq", "VP Eng", "Head of Engineering").
In FalkorDB, we store 1,488 nodes and 1,661 relationships, including 985 Person nodes and 300 Alias nodes connected via [:RESOLVES_TO] edges. When a user asks what someone decided before an update, FalkorDB resolves all aliases and traverses their historical assertions seamlessly.
The Benchmark: 511,958 Documents, Zero Prompt Cheats
We didn't test on a toy synthetic toy set. We evaluated Canon against Enterprise RAG-Bench, consisting of 511,958 real enterprise documents (a 4.03 GB corpus database) with official human-labeled conflict questions.
Every test ran under strict constraints:
- Exactly the same model
- Exactly the same prompt
- Exactly the same BM25 retriever
- Exactly the same 10-document context budget
| Metric | Standard RAG Baseline | Canon (FalkorDB) | Delta |
|---|---|---|---|
| Benchmark Correctness | 70.0% | 82.5% | +12.5% |
| Superseded Docs in Context | 14 / 20 | 1 / 20 | -93% reduction |
| Current Gold Doc Recovered | 20 / 20 | 20 / 20 | 100% recall |
| Weaker Model Correctness | 75.0% | 80.0% | +5.0% |
| Non-Conflict Context Preservation | 480 / 480 | 471 / 480 | 98.1% byte-identical |
| Harm to Non-Conflicting Contexts | - | 0 harmed | Zero regression |
The Negative Control
To prove the +12.5% correctness wasn't merely an artifact of having fewer words in context, we ran a negative control: randomly cutting the same number of documents.
Result: The random control scored exactly 70.0% (identical to baseline).
The entire performance gain comes from knowing precisely which document to cut.
Live Verification & Database Restart
An enterprise graph must survive real-world operational conditions. We built an automated test harness (scripts/verify/verify_falkordb.py) that executes 7 live checks against FalkorDB:
- Connection & Schema Verification: Validates 20 claim keys, 19 resolved transitions, and 1 contested case.
- Active vs Contested Integrity: Ensures contested claims are flagged honestly rather than forced into an incorrect resolution.
- Temporal Cut Verification: Verifies that superseded documents are cleanly filtered and backfills are verified against the raw corpus.
- Adversarial Supersession: Injects conflicting claims and confirms explicit supersession syntax always wins over repetition count.
-
Database Restart Persistence: The test issues a
docker restartto the FalkorDB container in the middle of execution. Once FalkorDB boots back up, it re-queries the graph: all state, relationships, and claim keys remain 100% intact.
All 7 checks pass, and our unit test suite runs 71/71 passing tests across graph operations, retrieval, and API serialization.
Try It Yourself in 4 Commands
The repository is open-source and completely reproducible:
# 1. Clone the repository
git clone https://github.com/toufiqfarhan0/falkor-hack.git
cd falkor-hack
# 2. Start FalkorDB in Docker
docker compose up -d
# 3. Install dependencies & run test suite
uv sync
uv run pytest
# 4. Run the live FalkorDB verification suite
uv run python scripts/verify/verify_falkordb.py
To run the full stack with the interactive UI:
# Start backend API (Port 8000)
uv run uvicorn canon_api.app:app --port 8000
# Start Next.js frontend (Port 3000)
pnpm --dir apps/web dev
Visit http://localhost:3000 to inspect the live dashboard, explore the /cut visualizer, and test queries in real time.
What We Learned
- RAG without temporal graphs is fundamentally fragile: As enterprise codebases and document repositories grow, the probability that the most similar document is outdated approaches certainty.
- Graph databases belong in the inference path: FalkorDB isn't just an offline database for knowledge dumpsβit is fast enough to act as an inline query gate during active generation.
- Honest systems abstain on ambiguity: When two active documents conflict without an explicit supersession clause, Canon does not guess or hallucinateβit surfaces the conflict as contested, preserving both historical context and present truth.
Built for the FalkorDB Hackathon 2026.
Repository: github.com/farhan0-code/graph-hack
Demo Video: https://youtu.be/eIrE17qlf7Q
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.