# Agent Memory Techniques

> An open-source collection of 30 runnable Jupyter notebooks covering every major LLM agent memory technique, from conversation buffers to production deployment patterns.

Agent Memory Techniques is an open-source GitHub repository by Nir Diamant that provides 30 runnable Jupyter notebooks teaching every major memory pattern for LLM-based agents. Licensed under Apache 2.0, the project covers the full spectrum from simple conversation buffers to production-grade memory infrastructure, and is designed to be both a learning resource and a practical reference for developers building AI agents.

## What It Is

Agent Memory Techniques is a structured educational codebase that documents how to give LLM agents the ability to remember information across turns, sessions, and tasks. Without memory, an agent re-derives context every time and cannot personalize, learn, or maintain coherence over long interactions. The repository organizes 30 distinct techniques into six families: short-term context management, long-term storage, cognitive architectures, retrieval and multi-agent patterns, batteries-included frameworks, and production deployment patterns. Each technique lives in its own folder with a notebook and README, and every notebook can be run locally or opened directly in Google Colab.

## The Six Technique Families

The taxonomy covers the full memory lifecycle for LLM agents:

- **Short-Term (01–05):** Conversation buffer, sliding window, summary memory, summary buffer, and token budget management — the building blocks for managing context within a single chat.
- **Long-Term (06–11):** Vector store memory, entity memory, knowledge graph memory, episodic memory, semantic memory, and procedural memory — storage that survives across sessions and users.
- **Cognitive Architectures (12–19):** Working memory and context window management, hierarchical memory layers, memory consolidation, compaction, self-reflection memory, memory routing, temporal memory, and forgetting/decay — patterns borrowed from human cognition.
- **Retrieval & Multi-Agent (20–23):** Memory retrieval patterns (semantic, recency, hybrid, re-ranking), cross-session memory, multi-agent shared memory, and memory-as-tools.
- **Frameworks & Platforms (24–27):** Hands-on notebooks for Graphiti (time-aware knowledge graphs), Mem0 (managed memory layer), Letta/MemGPT (self-editing memory with inner monologue), and Zep (temporal knowledge graphs for production).
- **Evaluation & Production (28–30):** Memory evaluation metrics, LoCoMo and LongMemEval benchmarks, and production deployment patterns covering caching, TTLs, sharding, backups, GDPR, and observability.

## Learning Paths and Navigation

The repository provides four structured learning paths — Beginner, Intermediate, Advanced, and Practitioner — each sequencing specific notebooks to build skills progressively. A decision tree diagram helps readers quickly identify which technique fits their use case. A side-by-side comparison matrix in `docs/comparison.md` covers all 30 techniques filtered by persistence, retrieval style, token cost, and best-fit use case. The project also includes a glossary, FAQ, architecture design patterns document, and a keyword index.

## Frameworks Covered

The notebooks integrate with several leading memory frameworks and libraries:

- **Mem0:** Managed memory layer that handles extracting, storing, and fetching user-specific memories.
- **Letta (MemGPT):** Self-editing memory architecture with inner/outer monologue and heartbeat events.
- **Zep:** Dialog classification, entity extraction, and time-aware knowledge graphs built for production.
- **Graphiti:** Episodic-to-semantic knowledge graph extraction from Zep.

The repository also references Anthropic's 7 Layers of Memory framework (March 2026) as context for the memory hierarchy used in Claude Code.

## Update: v1.0.0 Release

The repository reached its v1.0.0 release on May 30, 2026, titled "Agent Memory Techniques." The project was created in May 2026 and last pushed in June 2026, indicating active early development. The README references a roadmap document (`ROADMAP.md`) and CI workflows, suggesting ongoing maintenance. The author's related repositories — RAG Techniques, GenAI Agents, Agents Towards Production, and Prompt Engineering — form a broader open-source AI education collection from the same author.

## Setup Path

The project requires Python 3.10+ and Jupyter Notebook. Setup involves cloning the repository, creating a virtual environment, installing dependencies from `requirements.txt`, and configuring an `.env` file with OpenAI and/or Anthropic API keys. All notebooks also carry Google Colab badges for zero-install cloud execution.

## Features
- 30 runnable Jupyter notebooks covering all major agent memory techniques
- Six technique families: short-term, long-term, cognitive architectures, retrieval, frameworks, production
- Conversation buffer, sliding window, summary, and token budget memory
- Vector store, entity, knowledge graph, episodic, semantic, and procedural memory
- Cognitive patterns: working memory, hierarchical layers, consolidation, compaction, self-reflection, routing, temporal, forgetting/decay
- Multi-agent shared memory and cross-session memory
- Hands-on integration with Mem0, Letta/MemGPT, Zep, and Graphiti
- Memory evaluation metrics and LoCoMo/LongMemEval benchmark notebooks
- Production deployment patterns: caching, TTLs, sharding, backups, GDPR, observability
- Google Colab badges for zero-install cloud execution
- Decision tree for technique selection
- Side-by-side comparison matrix for all 30 techniques
- Four structured learning paths (Beginner, Intermediate, Advanced, Practitioner)
- Apache 2.0 open-source license

## Integrations
OpenAI, Anthropic, LangChain, Mem0, Letta, MemGPT, Zep, Graphiti, Google Colab, Jupyter Notebook, Python, Vector databases

## Platforms
WINDOWS, WEB, API, VSC_EXTENSION, CLI

## Pricing
Open Source

## Version
v1.0.0

## Links
- Website: https://github.com/NirDiamant/Agent_Memory_Techniques
- Documentation: https://github.com/NirDiamant/Agent_Memory_Techniques/blob/main/docs/comparison.md
- Repository: https://github.com/NirDiamant/Agent_Memory_Techniques
- EveryDev.ai: https://www.everydev.ai/tools/agent-memory-techniques
