Context as Infrastructure: Knowledge Compilation for Retrieval in Agentic Systems with Harnesses

An arXiv preprint (cs.IR, 30 October 2026) by eighteen authors from InfiniFlow, the company behind RAGFlow, and East China Normal University. It argues that once an agent runs its own search loop, accuracy is largely solved and the open problem is context: what the model reads, how much of it, and when it stops. The proposed answer is Knowledge Compilation — an ingestion-time pipeline that turns documents into typed, provenance-bound artifacts — and its measurable core is Verified Evidence: claims stored with verbatim source spans, served under an Evidence Sufficiency gate.

Paper: https://arxiv.org/abs/2610.41172 · Code: the system is implemented in the open-source RAGFlow project, https://github.com/infiniflow/ragflow


The starting point: the harness already solves accuracy

The authors call the component that owns the agentic loop — write lexical queries, read snippets, reformulate, decide when evidence suffices — the search harness (see Search Strategy Optimization). In their runs, a harness whose only retrieval tools are BM25 and grep, answering with MiniMax M3, gets 85% on BrowseComp-Plus (at roughly 3 million tokens per question) and 91% on FRAMES (about 324k tokens, 46.7 s), with no compiled index and no vector index. They stress the two figures are not comparable, and place them alongside Direct Corpus Interaction, “Is Grep All You Need?”, Pi-Serini and SIRA as evidence that lexical search inside a capable harness saturates accuracy.

No dense leg anywhere. Adding a dense-retrieval leg lowered accuracy in their runs. Their explanation: the agent already does the semantic step by reformulating, so a second ranking competes with the lexical anchor the agent trusts and costs a second index to maintain.

What is left is a process problem. An undisciplined loop repeats queries, rereads documents and fills the window with passages that are individually relevant and collectively useless — it consumes tokens without converging on an answer.

Knowledge compilation

A query-independent transformation of a corpus into typed, versioned artifacts, each linked back to the exact source spans it came from. Six replaceable stages: parse, chunk, enrich, validate, assemble, register. Templates select which artifacts are built — claim-leaf navigation tree, entity–relation graph, ontology, LLM wiki, timeline, mind map, session memory. Derived artifacts are read-only and never written back into the source, so a generated summary can never become the “source” for the next generation. Details in Knowledge Compilation.

The negative result: structure doesn’t buy accuracy

Under the same harness on FRAMES, each run once:

VariantAccuracy vs. uncompiledObserved failure
RAPTOR-style summary tree (claims removed)NeutralAgent oriented on summaries, then grepped anyway
PageIndex-style outline (claims removed)Neutral small-scale, negative at FRAMES scaleWrong branch cost more than open search; routing concentrated queries on few documents
LLM wikiNeutralLossy provenance and exact wording; expensive to rebuild
Entity–relation graph (GraphRAG-like, but no community reports)NeutralFRAMES supplies entity-linked evidence; few questions need a join
Claim-leaf treeNeutral accuracy, −38% tokensMisses cost 1.9%

Their mechanisms: grep-then-read is an index built on demand, so a static partition must beat the agent’s next query; summaries and outlines re-describe rather than add facts; routing errors compound (an analytic model, not a measured sweep: 95%-correct routing per level gives about 75% end-to-end success at 10⁵ documents); and structure adds a selection burden. Letting the LLM pick documents from a table of contents was the weakest option measured — very low accuracy at very high token cost.

The positive result: claim–evidence pairs cut tokens

With claim–evidence pairs (Verified Evidence) projected in place of raw chunks:

  • −91% total query tokens when the gate judges the evidence sufficient
  • +1.9% when it doesn’t (the harness pays for the projection, then reads the chunk anyway)
  • −38% averaged over FRAMES (N = 200), with no reliable accuracy change

From these, a break-even sufficiency rate of about 2%, and an implied (not directly measured) FRAMES rate near 43%. The economics and the finite-horizon “no-compile boundary” are in Evidence Sufficiency.

Latency: two separate effects

  • Substitution costs latency. On the seven questions both ablation arms answered, the claim page roughly halved tokens but roughly tripled end-to-end latency: a smaller page needs more retrieval rounds. Tokens are bought with turns.
  • The decision gate recovers it. With claim-leaf trees present, a small decision model (Qwen decision model preview) deciding whether a deep read is warranted cut mean latency from 140 s to 30 s. Without evidence, the same gate saved about 30% of tokens.

The harness: five stations

RAGFlow’s harness runs every query through (1) capability check — tools a corpus can’t support aren’t even described to the model; (2) corpus-wide flat evidence prefetch; (3) evidence gate — admit or discard the whole block; (4) a parallel, step- and time-budgeted tool loop; (5) deterministic close — an abnormal stop still yields an answer. A zero-hit result is treated as a tool property, explained and retried along a fallback ladder before the model may conclude the corpus is silent. See Search Strategy Optimization.

Agent-native database

The authors’ closing framing: a store that hands the agent “the smallest sufficient set of verified facts”, compiled once and governed like data, instead of a ranked list of passages. Not a relational database — no query language or schema enforcement; the harness decides what each question reads.

Limits the paper states

  • One benchmark, one compiler model (glm-4-flash), one answering model; no confidence intervals or repeated seeds. The 91% / 1.9% endpoints are operating points, not population estimates; ablations are reported as directions.
  • Gate acceptance is not sufficiency. The false-accept rate was specified but not measured; the labeled audit (100–400 accepted queries) has not been run.
  • The deployment ledger for ontologies, graphs, wikis, timelines and memory has no observations yet — every row reads “no measured effect”. Those benefits are argued, not shown.
  • English, Wikipedia-based text; enterprise corpora with tables, scans and jargon may extract worse, raising misses and shrinking savings.
  • Written by the vendor of the system it describes, as a preprint.

Tools, Companies, Datasets