Retrieval-augmented generation is becoming agentic. A search harness writes queries, reads results, reformulates, and decides when to stop. This largely solves accuracy: a harness with only BM25/grep and MiniMax M3 answers 85% of BrowseComp-Plus and 91% on multi-hop FRAMES in our runs, without compiled or vector indexes. It exposes a context problem: an undisciplined loop repeats queries, rereads documents, and fills the window with unused passages. The missing layer is knowledge compilation: a configurable ingestion pipeline where LLMs enrich documents with context no chunk contains alone--navigation hierarchies with claim-evidence leaves, entity graphs, timelines, mind maps, ontologies, wikis, and memory. Compilation is not a better retriever: under a competent harness, structural artifacts gave no detectable accuracy gain on FRAMES, and a PageIndex-style outline degraded at scale. It is a supply layer. A navigation tree whose leaves are claim-evidence pairs--the mechanism we measure--cuts query tokens by 91% when evidence suffices and adds 1.9% when it does not, a 38% average reduction; this implies a 2% break-even sufficiency rate and a measured rate near 43%. A decision gate cuts latency from 140 s to 30 s, though substitution's token saving is bought with retrieval rounds and carries its own latency cost. Other artifacts--ontology, graph, wiki, timeline, mind map, memory--pay off in deployment (governance, integration, onboarding, temporal orientation, continuity) where accuracy benchmarks cannot see them. We describe RAGFlow's pipeline and harness (open source at https://github.com/infiniflow/ragflow), which turns the loop into five disciplined stations and keeps the context entering the model the smallest sufficient set; together they form an agent-native database: a store that hands the agent compiled, governed context instead of a ranked list of passages.
Figures & tables
Figure 1. Context as infrastructure. Knowledge compilation is the supply side: an ingestion pipeline that enriches raw documents into typed context artifacts. The harness is the control side: it decides which artifact, if any, enters the window and when the loop stops. Tools are the contract between them. Arrows show the flow of context, not control. The navigation tree (highlighted), whose leaves are claim–evidence pairs, is the mechanism measured in this paper; the ontology artifact (highlighted) is the one whose value is primarily commercial rather than benchmark-visible. A four-band architecture: retrieval harness at top, tools below, knowledge compilation below that, and raw corpus at the bottom, with upward arrows for ingestion, read-only artifacts, and tool calls; the claim-leaf navigation tree and ontology templates are highlighted.
Artifact
Added at ingestion
Query-time use
FRAMES result
Deployment value
Navigation tree (claim–evidence leaves)
Atomic claims with verbatim spans as leaves; cluster labels above them
Human navigation; document QA; organization only, no evidence value
Entity–relation graph
Entities, aliases, relations; no communities
PageRank chunks; fetch claim–evidence
acc. neutral
Related-source discovery; compliance
Ontology
Classes, properties, constraints, mappings
Typed retrieval; query expansion; validation
not measured
Vocabulary control; integration; governance
LLM wiki
Synthesized, linked articles
Background reading; synthesis
acc. neutral
Onboarding; documentation
Table 1. Compilation artifacts, the context they add at ingestion, and the ledger on which each is evaluated. FRAMES results are from the controlled harness in Section 8 ; deployment value is assessed with the metrics and instrumentation in Table 2 , not with benchmark accuracy. The two carrier-only rows remove the claim–evidence leaves, so their deployment value is organizational only—they arrange content, they do not add evidence.
Figure 2. Measured token and latency effects. Top: conditional change in total query tokens on FRAMES when projected evidence is sufficient (hit), insufficient (miss), and averaged over the benchmark. Bottom: end-to-end latency with and without the decision gate, with claim-leaf trees present. Negative bars are savings. Two bar charts: token change of minus 91 percent on hits, plus 1.9 percent on misses, and minus 38 percent on average; latency falls from 140 to 30 seconds with a decision gate.
Artifact
Primary outcome
Metric (numerator / denominator)
Instrumentation
Decision rule
Navigation tree
Cheaper correct answer
tokens per correct answer; accepted answers per 1k queries
Harness token ledger tagged by station; judge verdict
Ship if tokens fall with non-inferior accuracy
Entity–relation graph
Related-source discovery
relational questions answered with ≥2 joined sources / relational questions; tokens per relational answer
Ship if join success rises and tokens fall without audit loss
Ontology
Vocabulary control
entities mapped to a canonical class / extracted entities; unresolved-type rate
Compiler audit log; ontology validator
Ship if mapping target is met and invalid relations fall
LLM wiki
Onboarding and synthesis
time for a new user to answer 10 domain questions; citation follow-through rate
Task study; click-through to source spans
Ship only if time falls and citations stay traceable
Timeline
Temporal orientation
time to reconstruct event order; stale-version errors / temporal questions
Timeline validator; query logs
Ship if ordering accuracy rises and stale-version errors fall
Session memory
Continuity
repeat-question rate; corrected-fact rate; time to recover a prior decision
Session logs; user correction events
Ship if repeats and corrections fall
Table 2. The deployment ledger. Every row is defined for production collections, not FRAMES; the unit is the collection (or the reviewer team), and the comparison is against the same collection before the artifact or against a shadow control. Targets are pre-registered per deployment; a direction is reported only after the target is met, and audit coverage is an invariant rather than an average. The navigation-tree row refers to the claim-leaf variant; a carrier without claim leaves carries no evidence and is judged only on the organizational terms of Table 1 . The mind map is a navigation-tree layout and is judged on the navigation terms of the navigation-tree row, the timeline on the temporal terms of its own row.
Extracted hierarchy incomplete or misaligned; a wrong branch cost more than open search; confident routing concentrated queries on few documents
Value of a static PageIndex outline without claim leaves, same carrier
LLM wiki
Neutral
Fluent synthesis, but lossy provenance and exact wording; expensive to rebuild
Value of prose compilation without spans
Entity–relation graph
Neutral
FRAMES supplies entity-linked evidence; few questions required a join
Value of cross-source relations on a single-source benchmark
Claim-leaf tree (claims loaded)
Neutral accuracy; −38% tokens
Evidence projection preserved spans and reduced reading; misses cost 1.9%
Value of loading claim–evidence into the same carrier
Table 3. Accuracy audit of the structural variants on the full FRAMES benchmark. The two navigation-tree rows share the same carrier; the only change is whether claim–evidence leaves are present. “Neutral” means no improvement large enough to be distinguished from run-to-run variation in a single run, and it does not rule out a small effect below the resolution of this design; “negative” means a loss of that kind. We report the direction and the failure mode the audit supports, not point estimates: each variant was run once. The claim-leaf row is the measured mechanism, not a structural baseline.
Condition
Δ tokens
Avg. tokens
Latency
Accuracy vs. baseline
Uncompiled (BM25/grep)
0%
324,479
46.7 s
91.0% (baseline)
Evidence sufficient (hit)
−91%
–
–
no reliable change
Evidence insufficient (miss)
+1.9%
–
–
no reliable change
FRAMES average
−38%
–
–
no reliable gain
Decision gate, with evidence (arm mean)
−52%
155,305
140→30 s
no reliable change
Decision gate, no evidence (arm mean)
−30%
–
–
no reliable change
Table 4. Main measurements on FRAMES with the Tree template and glm-4-flash extraction. Token changes are relative to the uncompiled BM25/grep harness; negative is a saving, and dashes indicate quantities not measured separately. The first three rows are conditional splits of the same benchmark—hit and miss are defined by the gate’s verdict—and the FRAMES average is over all evaluated questions. The last two rows are arm means, not conditional splits: each is the mean change of that arm against the uncompiled baseline over the queries in that arm (evidence present, evidence absent), so −52% is not comparable with the −91% hit figure or with the −38% average. The arm-mean query counts are smaller still and are not reported separately.