Skip to content

How the RAG flywheel works

The problem: grounding articles in live web research is expensive and non-cumulative. Done naively, article #1000 costs exactly as much research as article #1 — and nothing stops yesterday’s generated text from becoming tomorrow’s “source”, a feedback loop that laundered hallucinations into facts.

Each contract owns an accumulating knowledge base of research facts: source-attributed claims extracted from real pages, each carrying its claim value (the number, price, date), provenance, and a status. Generation retrieves from this corpus first; the corpus persists and compounds across runs.

extractretrieve + groundgaps onlynew factsSource pagesResearch factsper contractGenerateExternal researchPublished articles

Layer 2 — corpus-first, external for gaps only

Section titled “Layer 2 — corpus-first, external for gaps only”

The flywheel invariant: external research is spent only on what the corpus lacks or what went stale (gap ∪ stale), through a single write seam. The measurable consequence: external calls per article decrease monotonically as the corpus matures, while grounding quality does not. That is the flywheel — every article makes the next one cheaper.

Layer 3 — hygiene: what keeps the corpus trustworthy

Section titled “Layer 3 — hygiene: what keeps the corpus trustworthy”

A knowledge base that feeds an LLM is a poisoning target, including self-poisoning. The guards:

  • Ingest gate — the body of a generated article is never accepted as ground truth. Only external, source-attributed material enters.
  • Conflict arbitration — when two sources disagree on a claim, an arbiter resolves which value the corpus carries, rather than keeping both silently.
  • Freshness classes — facts age at different speeds (a protocol definition vs a price); TTLs are per fact class, and stale facts fall out of retrieval until refreshed.
  • Quarantine — suspicious material is excluded from retrieval, not deleted, so hygiene decisions are reversible and auditable.

Layer 4 — retrieval that earns its citations

Section titled “Layer 4 — retrieval that earns its citations”

Retrieval is hybrid — dense vectors and full-text search fused by rank — with a relevance floor: a fact must clear a similarity threshold to the article’s topic before generation may cite it. Below the floor, the fact simply isn’t offered. This is what keeps “grounded” from degrading into “decorated with citations”.

Corpus-first means a young contract writes its first articles from a thin corpus with more external research — the flywheel needs several cycles to spin up, and the platform accepts that early cost. Hygiene gates also reject real facts occasionally (a conservative ingest gate is the safe side of the trade); the remedy is the arbiter and re-ingestion, not loosening the gate.

Ask the platform’s MCP list_domains for the research domain — the corpus surface is a first-class API — or read Content lifecycle for where retrieval sits in the article’s path.

Specs: SPEC-079/080 (vector primitive), SPEC-081 (corpora), SPEC-082 (research KB + ingest gates), SPEC-093 (domain enrichment), SPEC-101 (flywheel invariants), SPEC-115 (relevance floor).