NirDiamant/Agent_Memory_Techniques is a collection of runnable Jupyter notebooks that teaches how LLM agents retain and retrieve information, including conversation history, vector stores, knowledge graphs, and episodic or semantic memory. It is for learners and developers studying agent-memory designs and production patterns. The catalogue instruction supports working through these techniques with a coding agent.
Borrowing it
Nothing to install: this file belongs to NirDiamant/Agent_Memory_Techniques. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/NirDiamant/Agent_Memory_Techniques/main/AGENTS.mdgit clone --depth 1 https://github.com/NirDiamant/Agent_Memory_TechniquesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/nirdiamant/agent_memory_techniques/agents-md)<a href="https://agentmods.dev/instructions/nirdiamant/agent_memory_techniques/agents-md"><img src="https://agentmods.dev/badge/instructions/nirdiamant/agent_memory_techniques/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/nirdiamant/agent_memory_techniques/agents-md"><img src="https://agentmods.dev/badge/instructions/nirdiamant/agent_memory_techniques/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00975 | $0.00975 |
| Opus 5.5 | $0.00390 | $0.00390 |
| Sonnet 5.5 | $0.00195 | $0.00195 |
| Haiku 4.5 | $0.00097 | $0.00097 |
Grade A, and why
Agent_Memory_Techniques AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 14d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Guidance for AI coding agents working in this repository. Humans are welcome to read it too; it is plain Markdown and GitHub renders it.
What this repository is
Agent_Memory_Techniques is a hands-on cookbook for agent memory in LLM applications: 30 runnable Jupyter notebooks covering every major memory pattern, from short-term conversation buffers through vector and graph stores, cognitive architectures, retrieval patterns, the major frameworks (Mem0, Letta/MemGPT, Zep, Graphiti), evaluation and production deployment. Each notebook is paired with a sub-README explaining the technique, when to use it, its limitations and an architecture diagram.
It is a teaching repository, not a library. There is no package to install.
- Canonical URL: https://github.com/NirDiamant/Agent_Memory_Techniques
- Author: Nir Diamant
- License: Apache 2.0, see
LICENSE. - A machine-readable link map already exists at
llms.txt. Keep it in sync when you add or rename a technique.
Layout
| Path | What lives there |
|---|---|
all_techniques/ |
The 30 technique directories, numbered 01_ to 30_. Each holds a notebook plus its own README. |
docs/ |
CONTENT_STANDARDS.md, glossary.md, learning_path.md, architecture.md. |
utils/ |
Shared helpers imported across notebooks. |
tests/ |
Import and smoke tests. |
data/ |
Sample data. |
llms.txt |
Machine-readable link map of the whole repository. |
CITATION.cff |
Citation metadata. |
ROADMAP.md |
Current state and upcoming work. |
Working here
docs/CONTENT_STANDARDS.mdis binding. Short sentences, active voice, no marketing words, analogy first. Read it before writing any prose in this repository. It overrides your default writing style.- One technique, one numbered directory, containing the notebook and a README that covers what the technique is, when to use it, when not to, and a diagram.
- Numbering is meaningful.
01-05short-term,06-11long-term,12-19cognitive architectures,20-23retrieval and multi-agent,24-27frameworks,28-30evaluation and production. A new technique goes where it belongs in that progression. - Every new term goes in
docs/glossary.md. - Update
llms.txtandREADME.mdwhenever you add, rename or remove a technique. - Notebooks must run top to bottom from a clean kernel. API keys come from the environment.
- Read
.github/CONTRIBUTING.mdbefore opening a pull request. It supersedes this file where they differ.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 14d ago Changed · -1 lines · -16 tokens per session 4bb1e9f2007f
- 1mo ago First seen · 57 lines · 991 tokens per session scan A 4c02d1f1a58e
Agent_Memory_Techniques AGENTS.md is an instructions file published in the GitHub repository NirDiamant/Agent_Memory_Techniques (1,133 stars, last pushed 5d ago), licensed Apache-2.0. It adds 975 tokens to every session, about $0.0039 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-16.
Agent_Memory_Techniques AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| Agent_Memory_Techniques AGENTS.mdNirDiamant/Agent_Memory_Techniques | Instructions file | 1.1k | 5d ago | Apache-2.0 | A | 975 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |