mem0 AGENTS.md

Repository instructions for Mem0, a memory layer for AI agents that stores personalized information through hosted services or open-source software. They describe how to work in its monorepo, a repository containing multiple related packages.

In plain words
What is it for?
They are for finding the right code and documentation, choosing the correct setup and test commands, and preparing changes for the Mem0 repository.
Why use it?
They help an agent follow the package-specific rules and avoid contribution, tooling, credential, and workflow mistakes.

Instructions file for CodexOpenCode

▶ Mem0 + Claude Code MCP — Give Your AI Agent a Permanent Memory Prompt Engineer · about mem0ai/mem0 · on YouTube →
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/mem0ai/mem0/agents-md
Clone the repo
git clone --depth 1 https://github.com/mem0ai/mem0

Made for: Codex, OpenCode.

Per session 3,110 This file is loaded in full into every session.
When invoked 3,110 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.03110 $0.03110
Opus 5 $0.01555 $0.01555
Sonnet 5 $0.00622 $0.00622
Haiku 4.5 $0.00311 $0.00311

Measured 3d ago against content hash 2c10bf04736a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 3d 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.

AGENTS.md · 176 lines

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 accepted label. 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 .env files, API keys, or credentials.
  • Skip pre-commit hooks.
  • Use npm or yarn in TypeScript packages. This repo is pnpm-only (Bun in .opencode-plugin/).
  • Use require() in TypeScript. ES module import syntax 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 dependencies list in pyproject.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

Read the full file on GitHub · 176 lines

Changes

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.

  1. 3d ago First seen · 176 lines · 3,110 tokens per session scan A 2c10bf04736a

Subscribe to this mod's changes

mem0 AGENTS.md is an instructions file published in the GitHub repository mem0ai/mem0 (64,535 stars, last pushed today), licensed Apache-2.0. It adds 3,110 tokens to every session, about $0.0155 per session on Opus 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.