Agents Shouldn't Pass Context. They Should Share Memory
Description and use
Multi‑agent chains often balloon context, raising cost and latency. The solution is a shared memory architecture with three tiers (episodic, semantic, procedural) and token‑budgeted retrieval, keeping prompt size fixed and costs predictable.
Problem
Multi‑agent chains accumulate token‑heavy context, driving up cost, latency, and diluting attention.
Outcome
Token consumption per round became a fixed budget, eliminating linear growth; cost and latency stabilized across long chains and multi‑session use.
Workflow
- 1. Agent writes output to an append‑only episodic log (L1).
- 2. Asynchronously project new log entries into the semantic tier (L2) via LLM extraction.
- 3. Agent retrieves a token‑budgeted slice from both L1 (fresh events) and L2 (distilled facts).
- 4. Agent performs its task and appends its result to L1.
- 5. Repeat for each agent in the chain; on new sessions, L2 provides cross‑session beliefs.
- 6. Periodically rebuild L2/L3 from L1 if needed for consistency.
Evidence
Agents do not hand anything to each other directly. Each agent writes its output to a shared memory layer, and the next agent retrieves only the slice it needs, capped to a token budget.
The episodic tier (L1) is an append‑only log of everything that happens in a session…
If Agent A produced forty thousand tokens of investigation and Agent B needs the three thousand tokens of conclusion, B receives three thousand.
- Record date: 2026-09-09T02:15:22.700Z