ADR-0010: Wiki-First Compilationπ
Statusπ
Accepted
Contextπ
Raw memory (BrainCells) contains noise, contradictions, and fragmented facts. Exposing agents directly to raw memory for every query increases token costs, latency, and hallucination risks. We need a way to present consolidated, high-signal knowledge.
Decisionπ
Wiki-First Compilation. Knowledge is compiled into structured products (BrainEngrams); atomic facts (BrainCells) supply source evidence.
Wiki-First and Graph-First address different layers. When Router's graph_first_retrieval.enabled C0 gate is on, retrieval first enforces token, tenant, scope_path, relation, hop, result, and context-budget bounds. It obtains a bounded seed set, traverses CellEdges, and uses a typed batched reverse lookup from the admitted BrainCell/CellEdge evidence refs to every active BrainEngram that contains them. The caller ranks and deduplicates that multi-Engram set before assembling context; it does not stop after the first matching Engram.
Wiki-First governs the representation selected from that graph-expanded set: valid BrainEngram Markdown is canonical, while its derived EngramIndex supplies compact summaries and hash-verified focus/expand references. Raw structured/keyword evidence fills gaps, and bounded vector search is last. A derived Engram View never outranks its parent BrainEngram or source evidence.
Alternatives consideredπ
- Pure RAG over raw cells for every query. (Rejected: inefficient, noisy, lacks synthesized consensus).
Consequencesπ
- Engrams are compiled knowledge products; Cells are raw material.
- The enabled graph-first path gives agents a budgeted set of graph-related valid BrainEngrams.
- EngramIndex is an addressable view over typed source refs, not an AAAK or other lossy compressed knowledge authority; source-hash, fidelity, redaction, or tenant failure forces fallback to canonical Markdown/source evidence.
- The Consolidation Cycle (ContextBrain) is responsible for periodically consolidating Cells into Engrams.
Non-goalsπ
- Deleting raw Cells once an Engram is formed (Cells are retained for provenance and auditability).