I built agent memory the textbook way (agent retrieves on demand). Watching it run made me invert the whole design. Architecture + the failure mode that scared me off write-back.
The author describes inverting the textbook agent memory design from retrieval-on-demand to injection-first to avoid latency and confident empty-context errors, detailing the architecture and a dangerous self-poisoning failure mode with write-back.
My first version of agent memory was the textbook approach: give the agent retrieval tools, let it decide when to fetch. Sounded right. In practice it had two failure modes. It either spent a tool call fetching memory on every trivial turn (latency for nothing), or it skipped retrieval and answered confidently from an empty context (much worse). Letting the model decide when it needs memory assumes it knows what it doesn't know. It doesn't. So I inverted it to inject-first. The architecture: * **Storage:** each turn is a graph node tagged `{role, conversation_id, kind}`. Per conversation there's a meta summary record and a user-preferences record, both as structured data, so memory is addressable state I can inspect, not an opaque vector blob. * **Prompt assembly:** before inference, the layer builds a block with a distilled user summary, standing preferences, and the last N raw turns, in tagged sections (`<start_of_user_context>...`, `<start_of_previous_messages>...`). The agent starts oriented with zero round-trip on the common path. * **Bounded growth:** a background job keeps a rolling summary. While it's under a budget (\~20k chars in my config) it accumulates; past that, an updater agent compresses older turns into observation paragraphs so the prompt never balloons. This is the practical fix for long-context degradation: distill, don't dump. * **Depth on demand:** it still gets tools for multi-hop traversal over a knowledge graph of the user's data, reserved for when the injected summary isn't enough. So it's pin-the-essentials, fetch-the-long-tail, except the pinned part is a generated summary of the user and the long tail is a real graph you can walk. Net effect: far fewer tool calls, and it stops answering from nothing because the basics are always present. **The failure mode that scared me (the gotcha):** I let the updater write new edges back into the graph from the conversation itself. Within a day it had invented relationships (two people connected purely because their names co-occurred near a keyword) and asserted a "decision" I had explicitly argued *against*, because the words appeared in a thread where I was rejecting them. Then it read its own bad edges back as ground truth, so the error compounded every turn. Self-poisoning memory is strictly worse than no memory. I disabled write-back, the agent now reads a graph I curate and doesn't get to rewrite it from chatter. Turning unstructured conversation into reliable graph structure is the genuinely open problem, and it's what the RL-traversal work (Graph-R1) is chasing. Two things I'd actually like input on: how do you decide an extracted edge is trustworthy enough to persist (confidence threshold, human review queue, nothing)? And how are you splitting inject-vs-retrieve in your own agents?
An exploration of the components and design decisions behind agent memory libraries, clarifying the gap between cognitive science terminology and engineering implementation.
The author argues that 'agent memory' is the wrong first framing because it conflates working state and durable memory, leading to debugging issues. They advocate separating messy working state (which should expire) from strict durable memory with provenance and authority.
The article argues that simple RAG-based agent memory systems fail in production due to issues like stale preferences, missed keywords, and prompt injection, and advocates for a layered memory architecture with active selection, deterministic fallback, governance, and testing.
A discussion on the practical challenges of managing agent memory in AI systems, focusing on avoiding information overload that degrades output quality, and proposing strategies like using workflow state and multi-agent architecture.
A developer reconsiders agent memory as more than storage, proposing a living graph with roles and activation fields to give past information appropriate authority and context.