@QingQ77: 30 runnable Jupyter notebooks that thoroughly cover LLM agent memory technologies from short-term to long-term, simple to production-grade. https://github.com/NirDiamant/Agent_Memory_Techniques… This repo covers L...

X AI KOLs Timeline Tools

Summary

A GitHub repository containing 30 runnable Jupyter notebooks that comprehensively explain LLM agent memory technologies, from short-term context to production-grade patterns, covering methods like MemGPT, Zep, Graphiti, along with decision trees and comparison tables.

30 runnable Jupyter notebooks that thoroughly explain LLM agent memory technologies from short-term to long-term, from simple to production-grade. https://github.com/NirDiamant/Agent_Memory_Techniques… This repository breaks down LLM agent memory into six directions: how to manage short-term context, how to store long-term information, how to build cognitive architectures, how to choose retrieval routes, how to use existing frameworks, and how to evaluate and deploy. Each direction comes with runnable notebooks, covering everything from basic conversation buffers to MemGPT self-editing memory, Zep temporal knowledge graphs, Graphiti situational-to-semantic extraction — all with code. Anthropic's seven-layer memory definition and Mem0's managed memory layer are also covered. Additionally, decision trees and comparison tables are provided for quickly determining which technology to use.
Original Article Export to Word Export to PDF
View Cached Full Text

Cached at: 05/08/26, 03:35 PM

30 runnable Jupyter notebooks that thoroughly cover LLM agent memory techniques from short-term to long-term, from simple to production-grade. https://github.com/NirDiamant/Agent_Memory_Techniques… This repository breaks down LLM agent memory into six directions: how to manage short-term context, how to store long-term information, how to build cognitive architectures, how to select retrieval routing, how to use existing frameworks, and how to evaluate and deploy. Each direction has a runnable notebook, from the most basic conversation buffer to MemGPT self-editing memory, Zep temporal knowledge graphs, Graphiti episodic-to-semantic extraction — all with code. It also covers Anthropic’s seven-layer memory definition and Mem0’s managed memory layer. Additionally, it includes a decision tree and comparison table for quick reference when you’re unsure which technique to use.


NirDiamant/Agent_Memory_Techniques

Source: https://github.com/NirDiamant/Agent_Memory_Techniques

🧠 Agent Memory Techniques

Learn every agent memory technique for LLM agents.

If you find this useful, please star the repo so more learners can discover it. 🧭 New here? Start with 01 Conversation Buffer Memory or pick a Learning Path. Prefer a visual? See the Decision Tree below.

30 runnable Jupyter notebooks covering conversation buffers, vector stores, knowledge graphs, episodic and semantic memory, working memory, MemGPT, Mem0, Letta, Zep, Graphiti, LoCoMo benchmarks, and production memory patterns.


📖 The RAG Techniques Book is HERE (https://europe-west1-rag-techniques-views-tracker.cloudfunctions.net/rag-techniques-tracker?notebook=agent-memory-techniques–readme&click=book-buy-amazon-title&target=https%3A%2F%2Fwww.amazon.com%2Fdp%2FB0D76734SZ%3Ftag%3Ddiamantai-amt-20&text=The%20RAG%20Techniques%20Book%20is%20HERE)

From the same author

#1 Best Seller on Amazon in Generative AI Want to go deeper on RAG (Retrieval-Augmented Generation, the technique of giving a model extra documents so it can answer better)? The book is the long version. You’ll get the intuition behind every technique. You’ll get side-by-side comparisons that show when each one wins and when it quietly fails. You’ll get illustrations that make the tricky parts click.

⏳ Launch window only: $0.99

The price goes up once the launch window closes. Readers who grab it now lock in the lowest price it will ever have.

👉 Get the book on Amazon before the price changes (https://europe-west1-rag-techniques-views-tracker.cloudfunctions.net/rag-techniques-tracker?notebook=agent-memory-techniques–readme&click=book-buy-amazon-cta&target=https%3A%2F%2Fwww.amazon.com%2Fdp%2FB0D76734SZ%3Ftag%3Ddiamantai-amt-20&text=Get%20the%20book%20on%20Amazon%20before%20the%20price%20changes)

📫 Stay Updated

🚀WeeklyUpdates 💡ExpertInsights 🎯Top 0.1%Content Join over 50,000 readers getting clear AI tutorials every week. Subscribers also get early access and a 33% discount on my book.

🗺️ Taxonomy of Agent Memory Techniques

The 30 techniques fall into six families. Each family solves a different memory problem. Each technique lives in its own notebook.

FamilyWhat it solvesTechniques
Short-termKeep recent turns in memory without filling up the context window.01 - 05
Long-termSave knowledge across sessions, users, and time.06 - 11
Cognitive architecturesWorking, hierarchical, and reflective memory systems.12 - 19
Retrieval & routingChoose what to recall and when.20 - 23
FrameworksProduction-ready memory libraries (Mem0, Letta, Zep, Graphiti).24 - 27
Evaluation & productionMeasure, benchmark, and deploy memory.28 - 30

📐 Compare Techniques at a Glance

Looking to filter by constraint (persistence, retrieval style, token cost, best-for use case)? See the side-by-side comparison matrix covering all 30 techniques in one table.


📚 All 30 Techniques

🔄 Short-Term Memory (Techniques 1-5)

Manage the conversation inside a single chat.

#TechniqueDescriptionNotebook
01Conversation Buffer MemorySave the full conversation, word for word. The simplest pattern, and the base for everything else.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/01_conversation_buffer_memory/conversation_buffer_memory.ipynb)
02Sliding Window MemoryKeep only the last few messages. You limit the size, but you keep the recent parts.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/02_sliding_window_memory/sliding_window_memory.ipynb)
03Summary MemoryReplace old turns with a short summary written by the model. You lose length but keep the meaning.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/03_summary_memory/summary_memory.ipynb)
04Summary Buffer MemorySummarize older turns, but keep recent messages word for word. You get both.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/04_summary_buffer_memory/summary_buffer_memory.ipynb)
05Token Buffer MemoryTrim the history to fit a strict token budget. Drop the oldest messages first.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/05_token_buffer_memory/token_buffer_memory.ipynb)

💾 Long-Term Memory (Techniques 6-11)

Storage that survives across sessions and users.

#TechniqueDescriptionNotebook
06Vector Store MemoryTurn past messages into vectors (number lists that capture meaning). Search them later by similarity.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/06_vector_store_memory/vector_store_memory.ipynb)
07Entity MemoryPull out and track facts about people, projects, and preferences. Update them as the conversation grows.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/07_entity_memory/entity_memory.ipynb)
08Knowledge Graph MemoryBuild a graph of how entities connect. Walk the graph to reason over what the agent has learned.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/08_knowledge_graph_memory/knowledge_graph_memory.ipynb)
09Episodic MemoryStore complete interactions with when-and-where context. Good for “what happened when” questions.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/09_episodic_memory/episodic_memory.ipynb)
10Semantic MemoryPull general facts out of interactions. Store them on their own, away from the raw episodes.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/10_semantic_memory/semantic_memory.ipynb)
11Procedural MemoryCapture “how-to” knowledge: the procedures and workflows the agent picks up over time.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/11_procedural_memory/procedural_memory.ipynb)

🧩 Cognitive Architectures (Techniques 12-19)

Patterns borrowed from how humans remember.

#TechniqueDescriptionNotebook
12Working Memory & Context WindowManage the agent’s limited attention. Prioritize, pin, and evict context on the fly.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/12_working_memory_context_window/working_memory_context_window.ipynb)
13Hierarchical Memory LayersTiered storage with hot, warm, and cold layers. Promote and demote items as they age.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/13_hierarchical_memory_layers/hierarchical_memory_layers.ipynb)
14Memory ConsolidationMerge, deduplicate, and strengthen memories. Inspired by how the brain consolidates during sleep.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/14_memory_consolidation/memory_consolidation.ipynb)
15Memory CompactionCompress stored memories with summaries, entity extraction, or distillation. Save storage and tokens.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/15_memory_compaction/memory_compaction.ipynb)
16Self-Reflection MemoryThe agent looks back at its own actions. It writes notes on what worked, and uses them next time.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/16_self_reflection_memory/self_reflection_memory.ipynb)
17Memory RoutingPick the right memory store to read from or write to. Route by content type and intent.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/17_memory_routing/memory_routing.ipynb)
18Temporal MemoryAttach timestamps to memories. Retrieve with time awareness and weight recent items higher.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/18_temporal_memory/temporal_memory.ipynb)
19Forgetting & DecayForget on purpose. Use decay, access counts, or relevance to prune.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/19_forgetting_and_decay/forgetting_and_decay.ipynb)

🔍 Retrieval & Multi-Agent (Techniques 20-23)

How agents find and share memories.

#TechniqueDescriptionNotebook
20Memory Retrieval PatternsCompare retrieval strategies: semantic search, recency, hybrid scoring, diversity, and re-ranking.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/20_memory_retrieval_patterns/memory_retrieval_patterns.ipynb)
21Cross-Session MemorySave and reload agent state across sessions. The user picks up where they left off.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/21_cross_session_memory/cross_session_memory.ipynb)
22Multi-Agent Shared MemoryShared stores, message passing, and agreement protocols for multi-agent teams.Notebook · Colab (https://colab.research.google.com/github/NirDiamant/Agent_Memory_Techniques/blob/main/all_techniques/22_multi_agent_shared_memory/multi_agent_shared_memory.ipynb)
23Memory with ToolsGive the agent memory tool

Similar Articles

@GitTrend0x: The Killer Open-Source Tool That Transforms AI from a Goldfish Memory to Perfect Recall https://github.com/run-llama/llama_index… Meet LlamaIndex, the most mature RAG framework in the Python ecosystem, with a blockbuster open-source project boasting 49k+ stars! AI…

X AI KOLs Timeline

Introduces LlamaIndex, a mature Python open-source framework with 49k+ stars, designed to provide AI assistants with persistent memory and efficient RAG capabilities through vectorized storage and semantic search.

rohitg00/agentmemory

GitHub Trending (daily)

agentmemory is an open-source persistent memory layer for AI coding agents (Claude Code, Cursor, Gemini CLI, Codex CLI, etc.) that uses knowledge graphs, confidence scoring, and hybrid search to give agents long-term memory across sessions via MCP, hooks, or REST API. Built on the iii engine, it requires no external databases and exposes 51 MCP tools.

@QingQ77: 'Dive into Deep Learning' is an excellent introductory book, but its update speed struggles to keep pace with the field's development. Since the Transformer, content like CLIP, Diffusion, vLLM, and more has proliferated. While online resources are abundant, they are highly fragmented—today you study Attention, tomorrow LoRA, the day after...

X AI KOLs Timeline

This project is a systematic deep learning notes repository covering PyTorch, Transformers, generative models, and more. It aims to address the fragmentation of learning materials and provides code implementations along with practical guides.