The Memory Nexus
Chapters 3 through 5 leave the system with an embarrassment of options. Chapter 3 built hybrid retrieval over raw history with reranking. Chapter 4 added a persistent derived graph with several query modes. Chapter 5 added cue-conditioned associative propagation over that graph. Each chapter earned its mechanism conditionally, and each left the cheaper layers available underneath. The question none of them answers is the one a deployed system meets first:
Once an AI has several legitimate ways to access memory, what decides which memory process should run for the situation it faces now?
This chapter builds a candidate answer, measures it against simpler alternatives, and lets the evidence determine whether a separate memory-control layer is justified.
What Chapter 5 actually showed
Chapter 6 is often imagined as the chapter where spreading activation pays off. The frozen Chapter 5 runs say something narrower, and the design here starts from the narrower version.
Cue-conditioned propagation produced the strongest tested recall at a matched 8-memory budget, and the gain was modest: source recall moved from 0.850 with seeding alone to 0.900, at roughly six extra context tokens per cue. Precision behaved as the historical literature predicted everywhere except under conditioning. Unconstrained propagation was catastrophic in the precise sense the old survey literature warns about: path precision of 0.032 with worse recall than the constrained version. Thresholding and fan division mattered far more than lateral inhibition, which contributed essentially nothing on the fixture. Removing decay hurt recall. Bad seeding could destroy performance, and a fabricated edge propagated its error into admitted memory.
The result that shapes this chapter most is where branch separation happened. Cues about the same actor in different project contexts recovered their own regions completely, but the separation emerged at seeding, not during propagation. Conditioning kept activation nearer cue-specific seeds rather than steering the walk between branches.
Book hypothesis. The next architectural problem is choosing the right entry point and memory strategy, not propagating more aggressively.
That hypothesis is stated as such because Chapter 5’s evidence is retrieval-level on a synthetic 73-node graph. It motivates the control layer; it does not prove the control layer works.
What happened to βSimilarity Is Not Memoryβ
The previous Chapter 6 argued that semantic similarity is a useful retrieval primitive but answers a different question from memory. That principle survives, but the chapter-level step is now obsolete: the book’s architecture has advanced past the question, and its durable ideas belong where they are now measured.
The migration is recorded here so nothing is silently dropped:
- Resemblance versus state, proposal versus decision, accepted versus rejected, direction, negation. These now belong to Chapter 3’s retrieval limits and Chapter 4’s structured interpretation, where role and authority information is extracted and tested.
- Historical versus current, superseded versus current. These belong to Chapter 8’s validity-interval and current-belief machinery.
- Representation-relative boundaries. Preserved as an epistemic standard and reused in this chapter: every routing claim states the representation and mechanism scope it was tested under.
- Materiality thresholds. Preserved and applied here directly: a measurable routing gap does not automatically justify a control subsystem.
- Similarity as a primitive, and the demand that machinery justify its cost. Retained as standing constraints on every policy below.
Nothing from the old chapter is preserved as prose. The resemblance/state distinction reappears only where this chapter’s own experiments need it.
The Memory Nexus
The working definition is deliberately narrow:
The Memory Nexus is a policy over memory resources.
It is not the memory store, the knowledge graph, the associative graph, the final reasoning model, or the user’s agent. Its job is to decide, given the current situation and the available memory mechanisms, what memory operation to perform next:
current task/query
β
observable state
β
Memory Nexus
β
memory action
β
observation/result
β
stop or choose another memory action
A memory action names a capability plus the budgets it runs under, because using the graph with three hops and provenance required is a different decision from using the graph unbounded. Capabilities registered in this chapter are the mechanisms Chapters 1, 3, 4, and 5 actually built: NONE, RAG, GRAPH_BASIC, GRAPH_LOCAL, GRAPH_GLOBAL, GRAPH_DRIFT, ASSOCIATIVE, and RAW_EVIDENCE. Later chapters may register temporal resolution, belief resolution, or consolidated memory without rewriting the router. Those mechanisms are not implemented here.
Staging matters. This chapter routes memory mechanisms with the reader held fixed. Effort and budget routing come second, and model routing only after memory routing is interpretable, so that a stronger reader can never make the memory router look better than it is.
The homunculus constraint
A controller that already knows the answer has not routed; it has answered. The Nexus therefore sees only a closed observable state, computed from the query string and system availability, never from the evaluator’s ledger:
query text and embedding-length features
interrogative form and lexical signals
linked entities from the graph snapshot
available and degraded capabilities
context and latency budgets
prior actions and their diagnostics
confidence, contradiction, and disagreement signals
Ledger fields such as task family, expected sources, and expected state are refused by construction. A leakage audit runs in the test suite and in the experiment driver: any state object carrying an evaluator-only field is rejected. The one exception is a labelled control policy that routes on the ledger’s task family explicitly, so the chapter can measure exactly what a leaked label is worth. Its score is an upper bound on query-classification routing, never a result the Nexus may claim.
How routing appears elsewhere
The literature review behind this chapter is kept in the project’s research notes rather than reproduced here. Five lines of prior work shaped the build, each verified against its landing page before entering the bibliography.
Model routing establishes that routing can be worth building. RouteLLM learns quality/cost routing between strong and weak models from preference data, with thresholds tuned to explicit quality targets and generalisation to unseen model pairs. Router-R1 treats multi-model routing as a sequential decision process trained by reinforcement, with think and route actions, descriptor-conditioned choice, and an explicit cost reward. RouteLMT frames routing as budget allocation and identifies the operative signal as expected marginal gain β the large model’s improvement over the small one β showing that difficulty and absolute-quality proxies misallocate budget. The transferable claim is modest: routing between capabilities under cost pressure is an established engineering problem with known solution shapes, and the book tests whether those shapes fit memory.
Mixture-of-Experts contributes mechanism warnings. Sparsely-gated layers demonstrate that learned gating works and that it collapses without explicit anti-collapse machinery. Switch Transformers demonstrate that the simplest viable router is often sufficient. The Nexus adopts the simplicity bias β fixed and rule policies are the bar every learned router must clear β and reports route counts so that collapse toward one capability would be visible rather than hidden.
Cognitive gating is treated as hypothesis generator, not precedent. PBWM-style models demonstrate that input and output gating policies for working memory can be learned from reinforcement signals, and supply the vocabulary of selective updating that this chapter borrows. No software module here corresponds to any brain structure, and the chapter states that plainly: the useful observation is computational, namely that selective access under learned control is a coherent design, not that the architecture recreates anything neural.
Bounded decision models supply the chapter’s sharpest architectural question: whether the Nexus needs an autoregressive language model at all. Vendor offerings in this space make strong claims about calibrated structured choice from non-autoregressive models, but those claims arrive as product announcements with undisclosed internals, and the book treats them as vendor-reported rather than established. The question is tested with the book’s own small classifier instead of a vendor API, and no book component borrows vendor terminology.
Resource-rational control supplies the theoretical frame. Metareasoning treats computations as actions with expected value derived from their effect on the next physical decision, which grounds both the marginal-gain escalation rule and the stopping rule: continue only while another memory operation is worth its cost. The same literature is honest that exact metareasoning is infeasible, so the chapter tests greedy and hand-authored approximations instead of claiming optimality.
Build it
The implementation sits beside Chapters 3β5 rather than above them:
query
β
Nexus (capability registry + policy + controller)
ββ Chapter 3 RAG and raw-evidence fallback
ββ Chapter 4 graph modes (basic, local, global, drift)
ββ Chapter 5 associative retrieval over the real graph snapshot
β
shared fixed reader
β
Chapter 2 Measurement Instrument (unmodified scorers)
Each capability contributes only its own evidence under the chosen budget, so alternatives are separable: a capability that always contains RAG could never lose to RAG, and the comparison would be vacuous. Availability is checked, never assumed. A capability whose backing system is missing is never registered; one whose health check fails is registered and marked degraded so routing can see it and decline it. Control state (policies, versions, thresholds) is kept separate from memory state (graph contents, sources, claims), so retraining a router never looks like the project changing its mind.
Policies implemented are FixedPolicy, RandomPolicy, RulePolicy, LLMPolicy (JSON-bounded structured choice from a frozen model and prompt), ClassifierPolicy (multinomial logistic regression over dense state features, trained from scratch with no new dependencies), SequentialPolicy (cheap first, escalate on diagnostics), OraclePolicy, and CheapestAdequateOracle. The sequential controller enforces three independent loop guards β maximum action count, cost ceiling, no repeated capabilities β each tested as the binding constraint. Every decision emits a trace recording the observable state, candidates, scores, confidence, and policy version. A trace explains why a mechanism was chosen; it never explains why a resulting claim is true. Factual provenance still bottoms out in source evidence.
Using it follows existing CLI conventions:
cd solution && python -m memory_nexus.cli capabilities
cd solution && python -m memory_nexus.cli route "Where did we decide on PostgreSQL?"
cd solution && python -m memory_nexus.cli run "..." --policy sequential
cd solution && python -m memory_nexus.cli evaluate --run-id ch6-<date>
An offline deterministic demo runs with no model server, graph index, or network.
Utility before routing
A router judged on answer quality alone would invoke every mechanism on every query and be useless; judged on cost alone it would retrieve nothing. The chapter reports raw dimensions first β task quality, evidence quality, harm, latency, tokens, model calls, graph expansions β and applies a scalar only where an ordering is required (oracle selection, regret). The weights are a stated choice recorded in every run manifest, not a discovered truth:
utility = quality + 0.5 * evidence - 0.01 * cost - 0.5 * harm
adequacy threshold 0.75 (nexus-utility-v0.1)
Quality is the mean of the instrument’s own task metrics for the cell. Harm is the unsupported-source rate. No scorer was added to the instrument for this chapter; routing-specific quantities (choice, regret, under/over-routing, action counts) are computed from the matrix, not from new judges.
Establish specialisation first
Book result. The task-by-capability matrix is frozen in
experiments/benchmark/runs/ch6-20260919-nexus/: 8 of the 20 routing tasks measured, 46 cells across 7 capabilities, one shared reader, matched context budgets. DRIFT is unmeasured and 12 tasks are pending live runs; nothing below is stated beyond those 8 tasks.
Mean fixed-policy scores (note uneven coverage: 6β7 tasks per capability):
| capability | quality | evidence | harm | cost | latency | utility |
|---|---|---|---|---|---|---|
| RAW_EVIDENCE | 1.000 | 0.566 | 0.000 | 2.50 | 9.3s | 1.258 |
| ASSOCIATIVE | 0.929 | 0.574 | 0.000 | 1.20 | 14.4s | 1.203 |
| RAG | 0.929 | 0.500 | 0.143 | 1.00 | 16.4s | 1.097 |
| GRAPH_LOCAL | 0.917 | 0.347 | 0.425 | 3.00 | 64.7s | 0.848 |
| GRAPH_BASIC | 0.929 | 0.298 | 0.786 | 1.50 | 55.5s | 0.670 |
| GRAPH_GLOBAL | 0.778 | 0.347 | 0.767 | 12.00 | 69.4s | 0.448 |
| NONE | 0.143 | 0.143 | 0.000 | 0.00 | 3.5s | 0.214 |
No single capability dominates. Unique wins spread across five capabilities: associative retrieval on four tasks, graph-local, no-memory, RAG, and raw evidence on one each. Every measured task separates at least two capabilities. The falsification condition β one mechanism winning everything β did not occur on these 8 tasks.
Two findings inside the table deserve emphasis because they cut against the obvious story. First, the graph modes carry substantial unsupported-source harm (0.43β0.79) while raw evidence, associative retrieval, and no-memory carry none. Derived memory is not merely expensive here; it is the harm centre, which is exactly why the raw-evidence fallback exists. Second, the provenance question (q3-why-postgres) is the only task where quality separates sharply: raw evidence reaches 1.0 while every other measured capability scores 0.5. One discriminating task in eight is a thin basis for architecture, and the chapter does not pretend otherwise.
The oracle Nexus
Book result. Perfect per-task routing over the 8 measured tasks reaches quality 1.000 at mean cost 1.41 and utility 1.325. Against the best fixed policy, quality headroom is 0.000 and utility headroom is 0.067.
The oracle’s value is entirely cost-shaped: the cheapest adequate route per task holds quality at 1.000 while cutting mean cost to 1.09, routing five tasks to RAG and one each to associative retrieval, no-memory, and raw evidence. This is the finding the task brief asked the chapter to check first, and it answers plainly. On current evidence there is no quality prize for routing; there is a cost prize for declining expensive machinery where cheap machinery suffices. That maps to pre-registered outcome Type C: the Nexus as efficiency layer, not capability unlock.
Rules before learning
Book result. The hand-authored rule policy scores mean quality 0.929 with quality regret 0.071 across 7 scored tasks: six routes to RAG, one to no-memory, one under-route, zero over-routes.
The single under-route is the discriminating provenance task, where the rules choose RAG (quality 0.5) and the matrix says raw evidence (quality 1.0). No lexical signal in the query predicts that wide unranked evidence beats everything else, which is itself informative: the value of fallback is visible only after retrieval, not before it. The leaked-label control, which routes on the evaluator’s own task family, scores no better than the rules (quality 0.929). Knowing what kind of question this is, in the evaluator’s private vocabulary, buys nothing on these tasks β a result that should temper any enthusiasm for query-classification routing.
The generative LLM router is implemented, frozen, and schema-guarded, but unmeasured: no scored cells exist for it in the frozen suite. It is reported as prototype, not as evidence.
A faster decision engine
Book result. The bounded logistic classifier, trained offline on 7 held-in matrix samples with whole-family holdout, recovers oracle quality (1.000) at mean cost 1.21 with zero under-routes and one over-route.
This is the most encouraging number in the chapter and the least trustworthy. Seven training samples cannot support generalisation claims; the transfer condition covers a single held-out task. What the result does establish is narrower but real: routing here is a bounded decision problem that a deterministic microsecond model can express, and nothing in the measured gap requires generative interpretation of the question. No vendor decision model was integrated or measured; the terminology of such products appears nowhere in the implementation. The classifier’s confidence threshold, abstain behaviour, and schema-failure handling are unit-tested; its routing ability is preliminary.
Observe, then choose again
The sequential controller is built, unit-tested (57 passing tests cover registry, policies, guards, traces, and leakage audits), and demonstrable through the CLI. Live sequential episodes against the real systems are not yet in the frozen suite, so the chapter claims no sequential result. The design records its position anyway, because Chapter 5’s evidence points at it: fallback value that is invisible before retrieval is precisely what a route-observe-route loop exists to capture. The stop-policy analysis (premature stops versus needless continuations) is implemented against the matrix and runs once sequential episodes exist. Stopping too early is under-routing; stopping too late is over-routing; the suite measures both rather than asserting a threshold.
Under-routing, over-routing, and regret
Routing regret β oracle utility minus chosen-route utility, split into quality regret and cost regret β is the chapter’s honest scoring unit. It separates the two control failures that accuracy alone conflates: choosing too little machinery (the provenance task routed to RAG) from invoking expensive machinery unnecessarily (graph-global synthesis where RAG already answers). Pareto reporting accompanies every comparison: a router is valuable when it holds near-best quality while avoiding needless expensive operations, and neither cheap-at-collapsed-quality nor accurate-at-everything-always counts as victory.
Marginal gain, adopted from the routing literature, is the escalation hypothesis: ask not whether the query is hard but what improvement is expected from invoking the next capability over the current one. A linguistically complex question can be easy for RAG; a simple one can need the graph. The chapter implements the framing in its utility and its cheapest-adequate oracle and leaves gain prediction itself, in the RouteLMT sense of probing internal representations, as reserved work: the Nexus stays at the capability level and assumes no access to reader internals.
When the Nexus itself fails
Router failures name control faults, kept separate from Chapter 2’s memory-and-reasoning failure classes so that bad routing with a lucky answer stays distinguishable from good routing with a bad reader. The taxonomy β wrong capability, under-routing, over-routing, bad seed, premature stop, failed or excessive escalation, loops, cost overrun, confidence misread, feature leakage β is implemented in the controller and exercised by tests. Two failure classes already have measured instances: under-routing on the provenance task and cost-bearing over-routing by the graph modes. Selection bias in future learned routing is flagged without being solved: a router that mostly chooses RAG collects evidence mostly about RAG, and naive retraining on that log would entrench the majority route. Counterfactual and off-policy evaluation are reserved, with the standard reference recorded.
Did a control layer earn its place?
Against the pre-registered outcome types, the 8-task evidence maps to Type C with the Type B shadow close behind. No fixed mechanism dominates, so a routing problem exists in the weak sense; but the oracle’s headroom is cost-only, the rule policy captures most of the available utility at zero learning cost, and the classifier result is too small to trust. The Nexus, as measured, is primarily an efficiency and safety layer: it declines expensive derived memory where cheap memory suffices and retains fallback where derived memory harms.
The materiality test inherited from the old Chapter 6 then applies. A utility gain of 0.067 over the best fixed policy, on 8 tasks, with 12 tasks and the most expensive graph mode unmeasured, does not yet justify control infrastructure in production. What it justifies is continuing the experiment: the matrix pattern (spread wins, harm concentrated in derived modes, one discriminating task) is exactly what a routing problem looks like before the sample is large enough to settle it. The architecture stays conditional. If the full 20-task matrix with DRIFT shows one fixed mechanism dominating, the Nexus shrinks to a cost guard or disappears. If sequential control captures fallback value that one-shot routing cannot see, the Nexus becomes a feedback loop rather than a classifier. The chapter commits to reporting either outcome.
What remains unsolved
The residuals are specific. The full task set with DRIFT measured is the first obligation; twelve tasks and the most expensive mode are pending, and every conclusion above is bounded by their absence. The LLM router needs scored runs with route-variance measurement before any claim about generative routing. Live sequential episodes need running before the stop-policy analysis means anything. Seeding control β whether the Nexus should own where activation enters the graph, given that Chapter 5 found branch separation at seeding β is designed as a separate decision point but untested. Model routing, human escalation, health-aware degradation beyond the current registry flags, and any reinforcement-learned router all wait behind the simpler policies, to be attempted only if those leave meaningful regret. Temporal validity, forgetting, and consolidation stay in their own chapters; the registry is built to admit them when they arrive.
What remains unsolved. A system with several ways to remember now has a policy for choosing between them, and the policy’s value so far is measured in cost and harm avoided rather than answers improved. Whether that is all a control layer will ever be worth is the next measurement’s decision, not this chapter’s.
References
- RouteLLM: Learning to Route LLMs with Preference Data β Ong et al., ICLR 2025.
- Router-R1: Teaching LLMs Multi-Round Routing and Aggregation via Reinforcement Learning β Zhang, Feng, You, 2025, preprint (NeurIPS 2025 acceptance stated by the authors).
- RouteLMT: Learned Sample Routing for Hybrid LLM Translation Deployment β Luo et al., ACL 2026, Industry Track.
- Making Working Memory Work: A Computational Model of Learning in the Prefrontal Cortex and Basal Ganglia β O’Reilly and Frank, Neural Computation 18(2), 2006.
- Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer β Shazeer et al., ICLR 2017.
- Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity β Fedus, Zoph, Shazeer, JMLR 2022.
- On Optimal Game-Tree Search Using Rational Metareasoning β Russell and Wefald, IJCAI 1989.
- Introducing System One Models and Jev β TypeSafe AI, 2026 (vendor-reported; claims unverified).
- laya-typed-decisions β community model card (vendor-reported; comparisons indicative only).