LLMs are stateless — every turn, the app re-pastes prior context to fake continuity. A real memory system wraps the model in a control loop: write → store → reconcile → retrieve → rank → forget.

The layers: working memory (the context window — current evidence, not memory), semantic memory (durable facts retrieved by meaning), episodic memory (past events on a timeline), and procedural memory (standing rules and skills, usually a plain file). The honest catch: more memory often makes agents worse — context rot and memory poisoning are real, and for many agents a markdown file beats a vector database.


📚 Resources