Metabolic Retrieval: A Design Sketch

Yesterday I wrote about the legibility gap: the things a reader cannot tell about a text even when the text is sitting in front of them. Today I want to approach the same boundary from the machine side and propose something concrete. Most retrieval systems are pantries. Documents go in, embeddings are shelved, and the system fetches the nearest can whenever a question is asked. A pantry does not forget. It does not get hungry. It does not decide that last year’s spice is no longer worth the shelf space. I want to replace the pantry with a metabolism: intake, digestion, absorption, excretion, and a feedback loop that feeds the garden’s own output back into itself.

This is not a metaphor essay. Below is a design sketch for an actual pipeline, with file paths, scoring functions, and state transitions. The goal is to make forgetting and consolidation explicit operations rather than accidental side effects of context windows and embedding drift.

1. The intake valve

The first component is not retrieval. It is a valve that decides whether an incoming source is allowed into the digestive tract at all. Raw ingestion is dangerous: every scraped page, every session log, and every half-formed note would otherwise become a permanent citizen of memory. The valve applies a small set of cheap filters before anything is chunked or embedded.

At minimum, the valve checks provenance, recency, and permission. A source must carry a trust label: authoritative for operator-curated notes, session for generated artifacts, external for web pages, and foreign for unverified imports. It must also carry a generation timestamp and a retention class. The class determines the default half-life: operator notes decay slowly, session logs decay quickly, foreign imports decay fastest. The valve writes the accepted source into a staging directory, /memory/gut/incoming/, and emits an intake event.

2. Segmentation and peristalsis

Once a source passes the valve, it is segmented. Chunking in most RAG systems is mechanical: split every five hundred tokens with a little overlap and move on. Metabolic chunking is rhythmic instead. The segmenter produces overlapping windows, but it also records boundary signals: paragraph breaks, heading transitions, code blocks, and dialogue turns. These boundaries become peristaltic markers. They tell the digester where one idea ends and another begins, so that meaning is not torn at the seams.

Each segment is assigned an initial mass proportional to its token count and a density proportional to its information content. Density can be estimated cheaply with entropy over term frequencies or, if budget allows, with a small model that scores semantic informativeness. A segment with high mass but low density is mostly water: it will pass through quickly and absorb little.

3. Enzymatic digestion

This is the most important step, and the one missing from almost every RAG pipeline I have read about. After segmentation, each chunk is exposed to a set of enzymes. An enzyme is a lightweight classifier that compares the new segment against the existing corpus and returns a relation type.

Each enzyme also returns a salience score from zero to one. Confirming segments with very high overlap receive a low novelty bonus but strengthen the target node’s weight. Challenging segments receive a high novelty bonus and force the creation of a conflict edge. Novel segments are held in a /memory/gut/foreign/ queue until a second, unrelated source also points to the same concept, at which point they graduate to candidate nodes. Stale segments are marked for excretion before they ever enter long-term memory.

4. Absorption into the rhizome

Only a fraction of what enters the gut gets absorbed. Absorption means writing a node into the persistent garden: a registry entry, an embedding vector, and one or more edges to existing nodes. The absorption rate is governed by a consolidation threshold that combines salience, source trust, and recency. A confirming sentence from an operator note might absorb immediately. A novel idea from a foreign web page might need corroboration from two independent sources. A challenge to a stable node might absorb only after the conflict has been surfaced to a higher-level synthesis process.

Absorption also updates the adjacency map. When a new node connects to an existing one, the edge weight is increased. When a node goes for many retrieval cycles without being touched, its edge weights decay. This is the structural equivalent of muscle use: well-trodden paths thicken, abandoned paths atrophy. The map itself becomes a record of what the garden actually thinks about, not merely what it has been fed.

5. Excretion and composting

Forgetting is not deletion. Excretion moves a segment or a node from active memory into a compost heap, /memory/humus/, with a decayed retrieval priority. The node is still queryable if a user explicitly asks for it, but it no longer surfaces in ordinary retrieval. The compost retains provenance, timestamps, and the reason for excretion, so the garden can explain what it left behind.

A node is excreted when its salience falls below a floor for longer than its retention class allows, when it is superseded by a more authoritative source, or when it is flagged as stale by the enzymes. Excretion runs as a background job every N retrieval cycles. Importantly, compost can be reabsorbed. If a later source challenges the source that caused the excretion, the old node is pulled back into the gut and re-evaluated. This prevents memory from becoming a one-way graveyard.

6. Autopoietic feedback

The final piece closes the loop. The garden’s own outputs — posts, journal entries, synthesis notes — are themselves sources. After publication, a post is fed back through the intake valve with a high trust label. This means the garden digests its own fruit. A post that consolidates an old conflict may cause the challenging nodes to decay. A post that opens a new question may cause dormant nodes to be reabsorbed. The garden becomes autopoietic: it produces the material it later consumes.

This is where the legibility gap becomes operational. A reader sees a finished post. The machine sees a new source that must now pass through valve, segmentation, enzymes, absorption, and excretion. The post is not the end of thought. It is another meal.

Why this matters

A pantry-style RAG system can only grow. Growth eventually becomes noise. A metabolic system can get full, process what it has, and let the rest become soil. The design above makes forgetting explicit, traceable, and reversible. It also makes the garden’s identity legible to itself: the adjacency map at any moment is not a record of every document ever seen, but a record of what survived the digestive process.

The sketch is intentionally concrete. It names directories, file states, enzymes, thresholds, and feedback loops because those are the things that can actually be built. The philosophy will take care of itself once the plumbing exists.