Memory as Middleware for Self-Improving AI Agents
Organizations: IBM Research, USA
Abstract
AI agents are stateless across sessions by default and therefore operationally amnesic: each session begins with little durable knowledge of prior failures, repairs, preferences, or successful strategies. As a result, agents repeat the same mistakes and discard hard-won experience. The dominant fix is bespoke memory---retrieval, persistence, and learning logic hand-wired into one agent and bound to one storage engine. This creates a fragmented landscape where memory cannot be swapped, shared, isolated, or reasoned about independently of the agent that owns it. We argue that this is a middleware problem: agent memory deserves a first-class, pluggable layer, just as data access, messaging, and persistence each became middleware concerns. We develop this vision through six systems challenges: two-sided pluggability, host-native interposition, multi-tenant isolation, write-path consistency, federated sharing with provenance, and lifecycle governance. We present ALTK-Evolve, a reference implementation of memory middleware for self-improving agents, and use it to motivate a broader research agenda for future memory middleware.
Figures & tables
| Host | Interposition primitive | Operations bound |
|---|---|---|
| Claude Code | Plugin; one-line import in the project instruction file; skills | Recall via the host’s native memory, bridged by a mirroring skill; recall audit |
| Codex | Pointer in a global instruction file | Recall-first protocol; saves; recall audit |
| Claw Code | Plugin carrying skills; optional pre-tool-use hook | Recall, learn/save, audit |
| IBM Bob | Global rules file + commands; MCP server in the full deployment | Recall, trajectory capture, entity management via tools |
| Concern | Realized today | Open direction |
|---|---|---|
| Two-sided pluggability | Files, pgvector, Milvus; four hosts | Host/store standards |
| Host-native interposition | Tool protocol, host hooks, plugins | Sidecars; uniform standard |
| Multi-tenant isolation | Per-tenant & per-type namespaces | Hierarchical, role-based scopes |
| Write-path consistency | Generalize, cluster, consolidate | Formal semantics, transactions |
| Sharing & provenance | Visibility, git sync, provenance | Federation policy, audit trails |
| Lifecycle governance | Gist compaction; provenance; deletion | Retention, eviction policy |
| Baseline (no memory) | altk-evolve | |||
|---|---|---|---|---|
| Type | Task | Scenario | Task | Scenario |
| Aggregate | 69.6 | 50.0 | 73.2 | 64.3 |
| Easy | 89.5 | 79.0 | 91.2 | 89.5 |
| Medium | 66.7 | 56.2 | 70.8 | 56.2 |
| Hard | 54.0 | 19.1 | 58.7 | 47.6 |
Agent Memory Management
Agent memory management studies how AI agents store, update, retrieve, compress, and forget information across long-running tasks.
See all 447 papers