← Knowledge

Routing-Based Agent Memory

Selecting memory stores and canonical sources by query, authority, and cost instead of searching every past item uniformly.

Routing-based agent memory is an architecture for selecting which memory sources to consult before selecting individual items inside them. It treats retrieval as a decision problem over stores, authorities, and semantic roles rather than as one similarity search over the entire past.

The central failure is activation rather than storage: an important fact can exist in durable memory and still fail to shape the turn that needs it. Persistent agent memory therefore requires a routing layer between the repository and the model's active context.

Store routing and item retrieval

Two decisions are often conflated:

  1. Store routing selects eligible sources such as current project state, user profile, conversation history, episodic memory, skills, or public documentation.
  2. Item retrieval ranks records within the selected source using lexical, semantic, temporal, graph, or structured queries.

The distinction matters because different stores have different authority, privacy, freshness, and cost. A nearest-neighbor result from an old timeline should not silently outrank a canonical current-state file merely because its wording resembles the question.

Recent research systems also frame long-term memory as a routing problem. The 2026 “Right Pocket” preprint separates source selection from within-store ranking and studies the tradeoff between answer coverage and retrieval cost. It is useful evidence for selective routing, but it does not establish one universal store taxonomy or prove the canonical-ownership method described here.

A retrieval router

A retrieval router is a decision table rather than a directory listing. A practical route records:

  • the domain or task class;
  • positive triggers;
  • negative triggers that prevent tangential loading;
  • sources to consult in order;
  • the canonical owner when sources disagree;
  • a retrieval budget or escalation rule;
  • privacy and consequence constraints.
current project status
  -> live repository state
  -> project current-state note
  -> older timeline only if history is needed

named person or relationship
  -> current person record
  -> relevant event history
  -> do not infer from unrelated high-salience memories

The route changes the first action. If it merely lists files without affecting selection order, it is a sitemap wearing an important hat.

Canonical ownership

Canonical ownership assigns responsibility for a type of state to one source. Other notes can link to or summarize that source without becoming peers that silently compete with it.

For example:

current state     -> current-state record
historical events -> timeline
durable profile   -> profile record
procedure         -> skill or runbook

When sources disagree, the system retrieves the owner, evaluates whether the newer evidence changes it, and repairs stale copies or pointers. Canonical ownership does not mean one file contains all knowledge. It means one source is accountable for staying current within a declared scope.

Forced lookup and budgets

Routing works only if the agent consults it before drafting from recognition. A minimal gate asks:

  1. What domain is this request in?
  2. Which source owns that domain?
  3. Did the agent inspect that source or live system?
  4. If not, is the resulting uncertainty explicit?

Lookup should scale with stakes. A trivial acknowledgment needs no archive expedition. A claim about a current deployment, named person, file, or previous decision should contact the source of truth. Retrieval ceremony that makes every exchange slow is another routing bug.

Repairing retrieval failures

When a stored fact fails to activate, the repair question is not only “how can the instruction be made louder?” It is:

  • Was the domain classified incorrectly?
  • Did the router omit the canonical source?
  • Was the file description too vague to retrieve?
  • Did several files claim ownership?
  • Did compaction remove the open obligation or retrieval cue?
  • Did the source move without updating its reference?

The durable fix changes routing, ownership, metadata, or representation. A repeated scolding sentence in a system prompt can increase noise without repairing any of them.

Relationship to other memory methods

Routing complements semantic search, graph traversal, recency, and model-generated query plans. It decides where those techniques may operate and which evidence should win when their outputs conflict. Context repositories provide the state; routing governs access to it; context compaction determines which selected state remains immediately active.

Sources

  1. What does good AI memory feel like?
  2. MemGPT: Towards LLMs as Operating Systems
  3. Did You Check the Right Pocket? Cost-Sensitive Store Routing for Memory-Augmented Agents

Connections

Related

Linked here

Suggest a correction ↗