NirDiamant/Agent_Memory_Techniques
Agent memory for LLMs: 30 runnable Jupyter notebooks covering conversation buffers, vector stores, knowledge graphs, episodic and semantic memory, MemGPT, Mem0, Letta, Zep, Graphiti, LoCoMo benchmarks, and production patterns.
📚 What Agent Memory Techniques is
A curated collection of 30 runnable Jupyter notebooks that demonstrate the most common memory patterns used in LLM‑based agents. The repo groups the techniques into six families – short‑term buffers, long‑term stores, cognitive‑architecture patterns, retrieval/routing strategies, ready‑made frameworks (Mem0, Letta, Zep, Graphiti) and production‑ready evaluation/benchmarking – and provides a short, visual decision tree to help you pick the right one for your project.
How it works
| Family | Goal | Example techniques |
|---|---|---|
| Short‑term | Keep recent turns inside the model’s context window without blowing the token budget. | Conversation Buffer, Sliding Window, Summary, Token Buffer |
| Long‑term | Persist knowledge across sessions, users, or runs. | Vector Store, Entity Memory, Knowledge‑Graph, Episodic, Semantic, Procedural |
| Cognitive architectures | Organise memory like a brain – hot vs. cold layers, consolidation, working memory. | Hierarchical Layers, Memory Consolidation, Self‑Reflection, Routing |
| Retrieval & routing | Decide what to recall and when (e.g., cross‑session recall, selective retrieval). | |
| Frameworks | Plug‑and‑play libraries that implement the patterns above. | Mem0, Letta (MemGPT), Zep, Graphiti |
| Evaluation & production | Benchmark memory performance and ship to production. |
Each technique lives in its own folder with a self‑contained notebook that you can run locally or in Google Colab. The notebooks include:
- Minimal Python code (Python 3.10+)
- Explanations of the underlying concept
- Simple example prompts and data
- Visualisations of how the memory evolves over time
Who should use it
- Developers building chat‑bots, personal assistants, or autonomous agents who need to keep context across turns or sessions.
- Researchers exploring memory‑augmented LLMs and looking for quick reference implementations.
- Product teams that want a checklist of production‑grade patterns (e.g., Mem0, Zep) before shipping a memory‑enabled service.
What you get out of the box
- Hands‑on learning path – start with
01_conversation_buffer_memoryand follow the linked learning paths. - Decision tree & comparison matrix – quickly filter techniques by persistence, token cost, or use‑case.
- Production‑ready examples – notebooks for frameworks that already power commercial agents.
- Free educational resources – links to a companion video course, a 464‑page visual book, and a newsletter with weekly AI tutorials.
Quick start
# clone the repo
git clone https://github.com/NirDiamant/Agent_Memory_Techniques.git
cd Agent_Memory_Techniques
# open a notebook, e.g.
jupyter lab all_techniques/01_conversation_buffer_memory/conversation_buffer_memory.ipynb
Or launch any notebook directly in Colab via the badge next to each entry.
TL;DR
Agent Memory Techniques is a practical, open‑source tutorial library that teaches you how to give LLM agents memory. It covers everything from simple buffer tricks to full‑blown cognitive architectures, all with ready‑to‑run notebooks and clear guidance on when each pattern is appropriate.
Related
- Project
- Project
- Dispatch
- Project
- Project