Memory comes in distinct types with different jobs. Short-term or working memory is the live state of the current run — the conversation so far and the task state. Semantic memory stores facts learned about a user or domain ("this customer is on the enterprise plan"). Episodic memory records what happened in past runs. Procedural memory captures how the agent should behave. Frameworks reflect the split: LangGraph, for example, separates per-thread checkpointed state from a cross-thread store for long-term facts.
The write path is the hard part, and the part most demos skip. Dumping raw transcripts into a store produces noise that retrieval later surfaces as confident irrelevance. Production memory systems extract candidate facts with a dedicated model step, attach a source and a timestamp, and decide deliberately what is worth persisting — which makes memory a database with a schema and a curation policy, not a transcript bucket.
Memory introduces failure modes chat systems do not have. Stale facts contradict current reality; a prompt-injection attack can instruct an agent to "remember" something malicious; and remembered personal data creates retention and deletion obligations. Per-user isolation, time-to-live on memories, treating retrieved memory as untrusted content, and giving users a way to see and edit what is remembered are the controls that make the capability safe to ship.
The read path decides whether memory helps or hurts. Memories are embedded and retrieved by relevance to the current task, weighted by recency, and injected sparingly — a handful of well-chosen memories sharpens behaviour, while a page of loosely related ones dilutes the context window with confident irrelevance. Each injected memory should carry enough provenance for the model to weigh it: where it came from, when it was learned, and how confident the extraction step was. Without that, the model treats a stale guess and a verified fact as equals.
Memory also has a product dimension that engineering alone does not settle. Users trust agents that remember stated preferences and are unnerved by agents that surface inferred facts at the wrong moment. The implementations that age well make memory visible and editable — a settings surface showing what the agent knows about you — which converts a compliance obligation into a feature users actively maintain, and keeps the store cleaner than any automated curation pass.
Codazz builds this in production — AI Agent Development.