mem0: Instructions file for Codex

AGENTS.md

mem0 AGENTS.md is an instructions file for Codex, OpenCode from mem0ai/mem0. It costs 3,112 tokens per session, scanned A, original, Apache-2.0.

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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Claude Code; mentions AGENTS.md; mentions Codex.

This is mem0ai/mem0's own configuration. It tells Codex and OpenCode how to work on mem0 itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mem0 configures →

About the project

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.

mem0ai/mem0 · 67,370 stars · on GitHub · mem0.ai

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/mem0ai/mem0/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/mem0ai/mem0

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for mem0 AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/mem0ai/mem0/agents-md/github.svg)](https://agentmods.dev/instructions/mem0ai/mem0/agents-md)
Your own site
<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.

agentmods 80×15 button for mem0 AGENTS.md

Your own site · 80×15
<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>
Per session 3,112 This file is loaded in full into every session.
When invoked 3,112 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.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

Measured 1mo ago against content hash b2a7dada23c7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

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 integrations/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. 1mo ago Changed · +2 tokens per session b2a7dada23c7
  2. 1mo 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 (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.

Related

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).

microsoft/vscode · 9,649 tokens

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.

vercel/next.js · 7,257 tokens

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).

microsoft/vscode · 5,262 tokens

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.

langchain-ai/langchain · 4,680 tokens

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).

microsoft/vscode · 2,731 tokens

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.

deepseek-ai/deepseek-harness · 4,159 tokens