universal-memory-mcp AGENTS.md

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

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/devminions/universal-memory-mcp/agents-md
Clone the repo
git clone --depth 1 https://github.com/DevMinions/universal-memory-mcp

Made for: Codex, OpenCode.

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. 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.00733 $0.00733
Opus 5 $0.00367 $0.00367
Sonnet 5 $0.00147 $0.00147
Haiku 4.5 $0.00073 $0.00073

Measured yesterday against content hash 7c70a3f444fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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:approvalproject:gamedevproject: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. yesterday 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 5mo ago), licensed MIT. It adds 733 tokens to every session, about $0.0037 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-31.

Related

Other instructions, from other repositories

Tutorial_AwesomeModernCPP AGENTS.md

Instructions for Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP, covering agents.md, 这是什么, 通用 essentials(所有 agent 必读) and 你来做什么?(按场景路由).

Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP · 778 tokens

fix-quera AGENTS.md

Instructions for AlirezaKeshavarz83/fix-quera, covering agent guidance, project shape, visual style, quera page data findings and compatibility findings.

AlirezaKeshavarz83/fix-quera · 1,338 tokens

ab900 CLAUDE.md

Instructions for timothywarner-org/ab900, covering claude.md, repository purpose, architecture, commands and 2. non-ascii punctuation -- must return zero.

timothywarner-org/ab900 · 7,662 tokens

agentconfig.org AGENTS.md

Instructions for agentconfig/agentconfig.org, covering agent instructions for agentconfig.org, project overview, target audience, site structure and tech stack.

agentconfig/agentconfig.org · 2,368 tokens

canvas-lms-mcp AGENTS.md

Instructions for bruchris/canvas-lms-mcp, covering agents.md — canvas lms mcp server, quick start, run with npx (no install needed), or install globally and architecture.

bruchris/canvas-lms-mcp · 1,800 tokens

obsidian-university-workflow CLAUDE.md

Instructions for ABO896/obsidian-university-workflow, covering obsidian university workflow, project structure, rules for working on this project, templater api — always read the docs first and config alignment.

ABO896/obsidian-university-workflow · 810 tokens