A memory architecture that gives any language model functional reach over 10⁸–10⁹ tokens — verified span-by-span against a lossless tape, with its own ignorance measured and reported on every answer.
An imperfect analogy: Windows ReadyBoost let a USB stick extend system memory — not as fast as RAM, far better than paging to disk. CORTEX is that bridge for context. The corpus never sits in the window the way native tokens do; the gap is bridged, never abolished — and unlike ReadyBoost, the bridge is load-rated (every answer carries a precision bound) and inspected (every asserted claim closes against the tape through a fence no model authors, and ships a certificate a standalone verifier can re-check).
CORTEX is a specification, not yet an implementation. This repository is the canonical spec (CORTEX.md), the parameter lock (cortex.lock), and the scaffolding for building against it. MIT-licensed. One system — spec revisions number the document, never the system.
CORTEX gives any text-in/text-out model an effective working memory two to three orders of magnitude beyond its context window, over a 10⁸–10⁹-token corpus, by:
- holding a complete coarse index of the whole corpus — and of its pair-space (every community-to-community relationship) — resident at all times;
- compiling every recall into a typed, checkable plan over four primitives;
- spending a caller-chosen budget along an anytime dial that converges, in the limit, on an exhaustive read;
- closing every asserted claim — and every asserted connection between claims — against a lossless tape through fences no model authors;
- and reporting, on every answer, exactly how much it touched, at what fidelity, from how many independent sources, what it could not see, a lower bound on what it does not know it missed, and the marginal price of the next significant figure.
Stated so it can be refused: CORTEX does not attend to 5×10⁸ tokens at full resolution (~10¹⁷ pairwise interactions — physics, not engineering). It navigates a complete, faithful, drillable projection of the corpus and its relations, states its operating point, and can always spend more compute for more significant figures. That is a slide rule — always a ballpark, never an ERROR, exact digits on demand. A pocket calculator is exact until it overflows, and then it is nothing.
Every 2025–26 long-context memory system has a tower, a graph, or both. The unclaimed contribution CORTEX leads with is the provenance discipline:
- a lossless append-only tape as the sole source of truth (nothing derived is ever trusted ungrounded);
- non-model fences over both claims and the connections between them — closure is deterministic span-matching or a locally-pinned oracle, never the reasoning model grading itself;
- typed refusals — a system that says "I could not close that" instead of confabulating;
- per-answer coverage and a residuum lower bound — the honest fraction of the corpus actually used, and a bound on what was silently missed;
- proof-carrying answers — every cited answer ships a certificate a standalone verifier re-checks cold.
The intelligence lives in the indices and the fences, not in the reasoner — which is therefore cheap and swappable. Works against any model API (no weight access, no logit access). It requires a tailor-made harness (the "Stem") — a raw chat loop cannot drive it, any more than a filesystem can be used without a driver.
The shipping default is a pure append-only lossless tape — full information, no redaction, no erasure, nothing leaves the box. Deletion, at-rest encryption, per-scope access walls, and the off-box witness are opt-in, default-off capabilities (specified, retained, but never load-bearing for any functional organ and never on the critical path). If you want a memory that simply never forgets, that is the out-of-the-box build. See Revision 3 §R3.0 in the spec.
Tape holds · Locator addresses · Connectome associates · Atlas relates · Field spends · Chronicle remembers in order · Choir cross-examines · Cartridges attend · Fences check · Witness attests · Stem drives.
| Organ | What it is |
|---|---|
| The Tape / Tower | append-only hash-chained text (T⁰) + a tower of lossy, pointer-carrying views (T¹ cards → T² community gists → T³ super-community atlas → T⁴). A gist that cannot cite its spans is rejected at write time. |
| The Locator | deterministic coarse-to-fine addressing from a versioned community partition — the learned "Catalog" was cut because a brute similarity scan over every record is ~5 ms; a learned index that saves nothing against a millisecond scan is a seek in a scan-don't-seek system. |
| The Connectome | a VRAM-resident sparse multiplex hypergraph — associative firing (SpMSpV, sub-millisecond) that returns a read plan, never an answer; edges learned from verified use. |
| The Atlas | relations as first-class records with their own tape, tower, and coverage number — the only organ with 100% pair-space coverage; where "surprising connections" (near-in-meaning, far-in-structure) actually get produced. |
| The Field | an importance map that proposes reads and never weights estimates — estimation runs on exact-π design-based samples only, with honest confidence intervals and a hard refusal to render statistical absence as proof. |
| The Chronicle | the ordered fold — sequential integration with bounded carried state (how a 95-year-old has a "gist of a life"); typed deltas, chrono-complete, with an era-resolution "Arc" fold above it. |
| The Choir | multi-seat recall with a mandatory adversarial seat, reduced over fence-checked notes only (correlation-corrected, so agreement never overstates confidence). |
| The Fences | non-model closure for claims and connections; a calibration fence for register/voice; proof-carrying certificates. |
| The Stem | the tailor-made harness — the only place the model touches the system; where half the laws are enforced or silently broken, so it is contracted. |
- Index, not coverage, past the fidelity frontier. T³ at 12,500× compression is a complete index of the corpus, not a complete view. "Hold all of it" is true only at coarse resolution; the bound says which.
- The named bet: as sized, CORTEX bets the serving model's synthesis-arm effective window is ≳250k tokens. The literature (RULER, NoLiMa, Chroma) says effective windows are far smaller than advertised — so the first experiment measures it, and the seat reprices from the measurement.
- The residuum never reaches zero. The un-tripped, un-anticipated cross-record interaction is irreducible — but it is measured (a lower bound on every answer), floored, probed, and hunted, not hand-waved.
- The continuity is not "real." A model cannot distinguish a lived memory from an injected one; both are tokens. What CORTEX buys is that the injection is complete-at-coarse-resolution, ordered, relation-aware, honest about its own gaps, and checkable against a record no model authored.
CORTEX.md The canonical spec. Rev 3 front-matter is normative; read it first.
cortex.lock Single source of every tunable number. Every TODO names the law it disables until set.
contracts/ Per-organ contracts, drafted at the build stage that needs them (see spec Appendix A).
LICENSE MIT.
Not yet implemented. The spec pre-registers its own falsifiers — it is designed to be able to lose. The build order (spec Part XIV) begins with instruments, not organs:
- B0 — freeze the goldens; pre-register every threshold; run the five-arm calibration probe (what is the model's real effective window per query shape?), the fidelity curve (the master experiment that can kill the thesis: does fidelity decay gracefully with coverage, or fall off a cliff?), and the cache/control-arm audits. Several of these cost no API calls.
- B1–B7 — Ground → Tower → Atlas & Field → Connectome → Chronicle → Loop → Metabolism. Each stage lands organs plus their falsifiers; nothing ships until the whole organism is green under F-WHOLE against a SimpleMem-class control baseline.
Design point: a single machine, one consumer GPU. The architecture is invariant to window size and corpus size — growth on either axis moves which level is seated, never the organs or the code.
CORTEX v0.4 (the constitution) → v2 (the physics: scan-don't-seek, the slide rule) → v3 (the lattice, the four primitives, the falsifier discipline) → v5 (this: the estimator layer, the relation lattice, proof-carrying answers, the harness — hardened through a five-lens adversarial review panel and folded across three independent syntheses). Predecessors are kept in history, never implemented against. One CORTEX.
Build the instruments before the organs. Freeze the goldens before the thresholds. Hold a complete coarse index of the corpus and its pair-space; read in order once, so time is real; let structure propose and only text dispose — for claims and for the connections between them; compile every question, certify every answer, report both coverages and a lower bound on what you missed. One tape below, fences above, one CORTEX. The map is blurry on purpose and says so; the territory never is.
MIT © 2026 Bo Chen