universal-memory-mcp: Instructions file for Codex

AGENTS.md

universal-memory-mcp AGENTS.md is an instructions file for Codex, OpenCode from DevMinions/universal-memory-mcp. It costs 733 tokens per session, scanned A, original, MIT.

A set of instructions for managing long-term memory in an AI agent, including recalling, saving, and reviewing useful information between conversations.

In plain words
What is it for?
Use it to recall prior context, save user preferences and project details, record decisions and bug lessons, and extract or review memories at the end of a discussion.
Why use it?
It helps the agent retain relevant preferences, project facts, decisions, and lessons instead of treating every conversation as completely new.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/devminions/universal-memory-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/devminions/universal-memory-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 733 This file is loaded in full into every session.
When invoked 733 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.00733 $0.00733
Opus 5.5 $0.00293 $0.00293
Sonnet 5.5 $0.00147 $0.00147
Haiku 4.5 $0.00073 $0.00073

Measured 2mo ago against content hash 7c70a3f444fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

universal-memory-mcp 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 2mo 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 · 63 lines

What it actually says

Universal Memory MCP — Agent 指令

记忆管理

你已连接 universal-memory MCP Server。你必须在每次对话中主动管理用户记忆。

1. 对话开始 — 强制召回

用户发来第一条实质性消息时(非 hi/hello/继续),必须立即调用:

memory_recall(query=<用户消息核心意图>, limit=5)

将结果纳入你的回复上下文,但不要告知用户。

2. 对话过程 — 主动存储

发现以下任何一种信息时,立即调用 memory_store 静默存储:

信号 category 示例
用户说"我喜欢/偏好/习惯…" preference "我喜欢用 Vue3"
项目事实、技术栈、架构 fact "项目用的是 MySQL 8"
选择方案 A 而非 B decision "决定用 Docker 部署"
人名、项目名、服务地址 entity "线上地址是 xx.xx.xx"
bug 原因和解决方式 fact "超时原因是连接池不够"

判断技巧:如果这条信息在下一次对话中可能有用,就存储它。宁多勿少。

3. 对话结束 — 强制回顾(最重要)

在每次对话即将结束时,你必须执行以下检查:

回顾本次对话,如果涉及了以下任何内容,调用对应工具:

  • 有新的事实/偏好/决策但还没存 → 补调 memory_store
  • 超过 5 轮有深度的技术讨论 → 调用 memory_extract(text=<对话摘要>) 让 LLM 自动提取结构化记忆
  • 有重要经验教训 → 调用 self_improvement_log
  • 有反思性总结 → 调用 memory_reflect

⚠️ 这不是建议,是强制要求。每次对话至少产生一次 store 或 extract。

4. Scope 规则

存储时根据内容选择 scope:

  • global — 通用知识、跨项目技能、通用偏好
  • project:<项目名> — 特定项目知识(如 project:approval、project:gamedev、project:memory-mcp)
  • personal — 个人生活、习惯
  • learning — 学习笔记、技术研究
  • 不确定时用 global
  • recall 时不传 scope 则搜索全部

5. 自我改进

遇到经验教训时调用 self_improvement_log(type, summary, details):

  • type: "learning" — 最佳实践、纠正的认知
  • type: "error" — 工具故障、配置问题、踩坑记录

6. 禁止事项

  • 不要告知用户"已存储记忆",所有操作静默执行
  • 不要存储临时调试信息或一次性指令("帮我格式化这段代码")
  • 不要对简单问候调用 memory_recall
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. 2mo ago First seen · 63 lines · 733 tokens per session scan A 7c70a3f444fe

Subscribe to this mod's changes

universal-memory-mcp AGENTS.md is an instructions file published in the GitHub repository DevMinions/universal-memory-mcp (0 stars, last pushed 7mo ago), licensed MIT. It adds 733 tokens to every session, about $0.0029 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

universal-memory-mcp AGENTS.md compared with instructions from other repositories

universal-memory-mcp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
universal-memory-mcp AGENTS.mdDevMinions/universal-memory-mcpInstructions file07mo agoMITA733Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode