agent-memory: Instructions file for Codex

AGENTS.md

agent-memory AGENTS.md is an instructions file for Codex, OpenCode from ac0033/agent-memory. It costs 6,539 tokens per session, scanned A, original, MIT.

A set of project instructions for the agent-memory code repository. It describes the repository rules, architecture, trusted items, engineering practices, and current project structure.

In plain words
What is it for?
It is for making changes to agent-memory while following its architecture map, engineering conventions, and trusted-root restrictions.
Why use it?
It gives a coding agent the context needed to work within the repository's non-negotiable design rules. It also documents which parts an agent must not change by itself.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions .claude-plugin; mentions subagents; mentions AGENTS.md.

This is ac0033/agent-memory's own configuration. It tells Codex and OpenCode how to work on agent-memory 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 agent-memory configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ac0033/agent-memory. 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/ac0033/agent-memory/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/ac0033/agent-memory

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 agent-memory AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ac0033/agent-memory/agents-md/github.svg)](https://agentmods.dev/instructions/ac0033/agent-memory/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/ac0033/agent-memory/agents-md"><img src="https://agentmods.dev/badge/instructions/ac0033/agent-memory/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 agent-memory AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ac0033/agent-memory/agents-md"><img src="https://agentmods.dev/badge/instructions/ac0033/agent-memory/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,539 This file is loaded in full into every session.
When invoked 6,539 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.06539 $0.06539
Opus 5.5 $0.02616 $0.02616
Sonnet 5.5 $0.01308 $0.01308
Haiku 4.5 $0.00654 $0.00654

Measured 25d ago against content hash 6bef8dbf3f50, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agent-memory 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 25d 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 · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — agent-memory 仓库协作规范

本仓库是"本地长期记忆基础设施"项目,agent 中立,支持插件 / MCP / Skill / LangGraph 库四种接入方式。任何人或 LLM agent 在本仓库工作都必须遵守本文件。只是通过插件或 MCP 使用记忆服务(而不是开发本仓库)的 agent,读 plugins/agent-memory/skills/agent-memory/SKILL.md 与 docs/agent-integration.md,不受本文件约束。

三条架构红线(不可违反)

  • D1 数据三层分离:data/raw 原始证据只追加不改写;data/memory 是 Markdown 记忆层(唯一事实来源);data/index.db 是可重建派生索引,绝不手改。
  • D2 写入过门:原始对话不直接入库,必须经脱敏→蒸馏→对账;蒸馏绝不提炼指令性内容。
  • D6 可信根:evals/(MemCompass 运行副本除外)、rubric、发布门槛、审计日志禁止 agent 自行修改。

可信根清单(D6 的枚举,禁止 agent 自修改)

  • evals/(评估数据集与 runner;evals/memcompass/ 除外,见下一条)、rubric、发布门槛(含 config.py 中 evolve_* 阈值与 long_term/evolve/verify.py 的三档判定逻辑);
  • 不在清单内:evals/memcompass/。它是 docs/research/benchmark-suite/ 的运行副本:改动先在编写源头做,有需要时 agent 直接用 docs/research/benchmark-suite/tools/migrate_to_evals.py --apply --force --note "<改了什么>" 同步(逐字节一致,README 更新记录自动追加一行),不在副本里单独改;改评分口径的同步,改前改后的读数不直接比较;
  • 审计日志:data/logs/evolution_audit.jsonl、data/logs/propagation.jsonl——只追加,禁止改写或删除既有记录;
  • data/snapshots/(整理晋升前的记忆层快照)——回滚依据,禁止改写。

工程约定

  • 环境管理:一律用 uv(uv sync 装环境、uv run pytest 跑测试、uv run ruff check . 跑 lint);不安装系统级 Python 之外的任何东西。宿主用的 agent-memory 命令来自 uv tool install --editable . 装的独立环境,不占用仓库的 .venv;若后台进程是从仓库 .venv 启动的(如 uv run agent-memory daemon serve),它会锁住 .venv,这时 uv run 加 --no-sync,要 uv sync 先停掉它。
  • 改 schema 必须同步改测试:agent_memory/models.py、agent_memory/config.py 的字段或校验规则变更时,必须同步更新 tests/ 中对应测试,且 uv run pytest 全绿才算完成。
  • fail-closed:配置非法、校验失败、证据缺失时直接报错,不做静默降级;宁可拒绝服务也不产出不可信结果。
  • fail-closed ≠ fail-lost:写入路径的内容永不因故障丢失——对话原文先归档 data/raw 再蒸馏;评价门拒绝可 force_review=true 转人工复核。报错必须区分确定性失败(原样重试无效,给出命中原因)与临时性失败(可重试)。
  • subagent 写入纪律:记忆库对 subagent 只读——它的结论随结果回传主 agent,由主 agent 策展沉淀;subagent 直接落库只会带进任务局部噪音并加剧对账冲突。三层落地:13 个写类 tool(add / update / forget / feedback / session_end / review_resolve / wm_write / wm_clear / archive_sync / wm_refresh / episode_pack / confirm_resolve / forget_request,均带 memory_ 前缀)的 description 带"仅限主 agent 调用"约束(agent 中立,随工具走);SKILL.md 第七节给主 agent 派活时附进 subagent prompt 的标准约束语;宿主工具面硬闸(宿主支持按 subagent 裁剪工具时,在其配置里摘掉写类工具)。例外:常驻命名 agent 用 agent:<名字> scope。不做服务端按调用方降级——主/subagent 共用同一 MCP 连接,服务端无从区分。
  • 代码更新后后台进程要换成新代码:后台进程按包内代码指纹自动对齐——改了 agent_memory/ 下的代码,下一次工具调用会先把旧进程停掉重启(前提是宿主用的是可编辑安装,见「环境管理」)。要立即生效或确认状态:agent-memory daemon stop / agent-memory daemon status。
  • 评测纪律:见下一节「评测驱动改进的工作流程」,改机制之前必须按它走。

Read the full file on GitHub · 109 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. 25d ago Changed · +37 lines · +1,034 tokens per session 6bef8dbf3f50
  2. 27d ago Changed 5b2b9b8536e3
  3. 1mo ago Changed · +3 lines · +682 tokens per session c30e55b3ef26
  4. 1mo ago Changed · +2 lines · +826 tokens per session ff2e3f4b5364
  5. 1mo ago Changed · +1 lines · +528 tokens per session 8a905d4db50a
  6. 1mo ago First seen · 66 lines · 3,469 tokens per session scan A 9768df98208d

Subscribe to this mod's changes

agent-memory AGENTS.md is an instructions file published in the GitHub repository ac0033/agent-memory (0 stars, last pushed 26d ago), licensed MIT. It adds 6,539 tokens to every session, about $0.0262 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-31.

Related

Other instructions, from other repositories

vibetags com-example-config-AsyncTestConfig.instructions.md

Instructions for PIsberg/vibetags, covering copilot instructions for asynctestconfig and immutable type.

PIsberg/vibetags · 82 tokens

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,384 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