mem0 is memory infrastructure that lets AI agents and applications store and retrieve information across interactions. It supports agents and developers who need persistent context for AI systems.
Borrowing it
Nothing to install: this file belongs to mem0ai/mem0. 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/mem0ai/mem0/main/AGENTS.mdgit clone --depth 1 https://github.com/mem0ai/mem0Wrote 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/mem0ai/mem0/agents-md)<a href="https://agentmods.dev/instructions/mem0ai/mem0/agents-md"><img src="https://agentmods.dev/badge/instructions/mem0ai/mem0/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/mem0ai/mem0/agents-md"><img src="https://agentmods.dev/badge/instructions/mem0ai/mem0/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.03112 | $0.03112 |
| Opus 5.5 | $0.01245 | $0.01245 |
| Sonnet 5.5 | $0.00622 | $0.00622 |
| Haiku 4.5 | $0.00311 | $0.00311 |
Grade A, and why
mem0 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 1mo 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 — 176 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Context for AI coding assistants (Claude Code, Cursor, Copilot, Codex) working in the Mem0 repository.
Mem0 ("mem-zero") is a memory layer for AI agents: persistent, personalized memory through a hosted platform API and self-hosted open-source SDKs. Apache-2.0. Repository · Documentation
This is a polyglot monorepo and every package sets its own rules. Read the AGENTS.md nearest the files you are editing before running any command. The linters, formatters, test runners, and line lengths genuinely differ per package, and using the wrong one fails CI or produces a diff full of noise.
Do NOT
- Open a pull request without a signed CLA. It will not be reviewed. See The CLA is not optional.
- Open a pull request that does not link an issue carrying the
acceptedlabel. A bot closes it within a minute. See Two gates decide whether your pull request stays open. - Modify anything in
.github/workflows/without explicit maintainer approval. Publishing credentials are pinned to workflow filenames. - Commit
.envfiles, API keys, or credentials. - Skip pre-commit hooks.
- Use npm or yarn in TypeScript packages. This repo is pnpm-only (Bun in
integrations/opencode-plugin/). - Use
require()in TypeScript. ES moduleimportsyntax only. - Mix up linter configs. Root Python is ruff at line length 120,
cli/python/is ruff at 100,cli/node/is Biome,mem0-ts/is Prettier,integrations/vercel-ai-sdk/is ESLint. - Add Python dependencies to the core
dependencieslist inpyproject.toml. Use an optional group. - Change a public API without updating
docs/in the same pull request. - Introduce a new framework or abstraction without discussion. Follow the patterns already in the file you are editing.
Where to look
| Editing | Read | Toolchain |
|---|---|---|
mem0/ |
mem0/AGENTS.md |
hatch, ruff 120, pytest |
tests/ |
tests/AGENTS.md |
pytest |
mem0-ts/ |
mem0-ts/AGENTS.md |
pnpm, tsup, Prettier, jest |
cli/python/ |
cli/python/AGENTS.md |
ruff 100, pytest |
cli/node/ |
cli/node/AGENTS.md |
pnpm, tsup, Biome, vitest |
integrations/ |
integrations/AGENTS.md |
varies per integration |
server/ |
server/AGENTS.md |
Docker Compose, FastAPI |
docs/ |
docs/AGENTS.md |
Mintlify |
skills/ |
skills/AGENTS.md |
markdown, size-budgeted |
.github/ |
.github/AGENTS.md |
GitHub Actions |
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.
- 1mo ago Changed · +2 tokens per session b2a7dada23c7
- 1mo ago First seen · 176 lines · 3,110 tokens per session scan A 2c10bf04736a
mem0 AGENTS.md is an instructions file published in the GitHub repository mem0ai/mem0 (67,370 stars, last pushed today), licensed Apache-2.0. It adds 3,112 tokens to every session, about $0.0124 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-08-30.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.