Agent Memory Engineering

· Source: Nicolas Bustamante · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering, Robotics & Autonomous Systems · Depth: Advanced, extended

Summary

Agent memory engineering reveals that large language models (LLMs) are post-trained on their specific harness's memory layer, making memory transfer between agents like Claude Code and Codex challenging. The article analyzes three production implementations: Hermes (Nous Research), Codex CLI (OpenAI), and Claude Code (Anthropic). It finds that simple markdown files and filesystem tools, rather than complex vector databases or knowledge graphs, are winning in production. Key architectural differences include when memory is written (synchronous vs. deferred), how much context is always loaded (snapshot vs. index-only vs. full index), and eviction policies (hard char cap, usage decay, or verification reminders). The prefix cache problem is a critical constraint, driving designs that freeze system prompt snapshots or inject dynamic data into user messages to maintain cost efficiency.

Key takeaway

For AI Architects designing agent systems, prioritize simple, text-file-based memory solutions over complex vector databases. Your design should freeze system prompt snapshots at session start or inject dynamic memory into user messages to ensure cost-effective long sessions. Crucially, implement a "no-op" default for memory writes and integrate dynamic age verification on every memory read to maintain accuracy and prevent silent failures, especially in evolving codebases.

Key insights

LLM memory is fused with its harness during post-training, hindering direct transfer.

Principles

Method

Codex uses a two-phase pipeline: a small model extracts raw memories after session idle, then a larger consolidation agent edits a canonical handbook using standard tools.

In practice

Topics

Code references

Best for: AI Engineer, Machine Learning Engineer, AI Architect

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Nicolas Bustamante.