Ask ten engineers what ‘agent memory’ means and you’ll get eleven answers. That ambiguity isn’t just semantic—it’s the root of persistent failures that resurface long after the original mistake. Memory, properly defined, is information an agent writes to external storage during runtime and retrieves in later calls. It’s not the system prompt, not conversation history, not a static vector database. Those are configuration, context, and fixed retrieval sources. Conflating them is where architectures start to rot.
The patterns that actually work are unglamorous but specific. Before saving anything, an agent should score it by importance—is this a one-time preference or a lasting constraint? High-value entries get timestamps and confidence scores; low-value noise gets discarded. A MemoryEntry model gives every write a consistent shape, and a should_persist gate filters against importance and confidence thresholds before anything hits storage. At retrieval time, filtering by those same fields before running semantic search keeps the candidate pool small. Ranking an entire store by embedding distance alone is how you drown in irrelevant results.
Multi-agent systems have their own failure mode: shared memory stores. A research agent writes notes meant for its own next step. A code agent reads those notes, misreads context that was never meant for it, and acts on something irrelevant. The fix is namespace scoping—each agent writes to its own namespace and reads from that plus a shared facts layer the orchestrator maintains. Agents that try to write outside their scope should fail loudly, not silently pollute another agent’s context.
Perhaps the most common architectural mistake is writing to memory only when a task completes successfully. Fail halfway through, and all intermediate learning evaporates. The pattern that works: write to working memory after every individual step, with a time-to-live that clears entries if the broader task never completes. Only promote completed steps to episodic memory, where query costs are higher. This is the kind of boring engineering discipline that separates systems that degrade gracefully from those that collapse without a trace.