openmem
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@openmemsearch my memories for lessons about PostgreSQL connection timeouts"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
openmem
个人多 Agent 的统一记忆中枢:一个 PostgreSQL 库,一处写、全体读。
其他 AI 通过 MCP 接入;人通过 Web 控制台检索、问答、治理记忆。
它解决什么
问题 | openmem 的做法 |
记忆散落在多个 agent / 文件 | 统一进 |
标准问题每个 bot 都重推一遍 |
|
需要「像问本人一样」的综合回答 |
|
Related MCP server: MCP AI Memory
架构
MCP clients (Claude / Codex / bots / …)
│
▼
server.js ──spawn──► mem_core.py ──► PostgreSQL (openmem)
:3466 MCP │
├── Embeddings API(OpenAI 兼容)
└── Chat LLM API(OpenAI 兼容)
web_server.py :3467 ────────┘
(Web 控制台,复用同一内核)server.js:MCP 层(stdio / Streamable HTTP),工具转发到 Python 内核mem_core.py:业务内核 + CLI(写入、混合检索、咨询、预设工具、导入)web_server.py+web_page.html:Web 控制台cred_guard.py:写库前打码(防明文密钥进记忆)
数据表
表 | 用途 |
| 记忆正文 + embedding + pinned / superseded 链 |
| 治理待审冲突 |
| 预生成答案(prompt + 缓存 + 保鲜周期) |
| 咨询日志与引用 |
| 运行配置(persona / 模型 / key 等,覆盖环境变量默认值) |
建库:
createdb openmem
psql openmem -f schema.sql快速开始
1. 依赖
Node.js 18+
Python 3.10+:
psycopg2-binary、requests(见requirements.txt)PostgreSQL 14+
OpenAI 兼容的 embeddings 与 chat 端点
npm install # @modelcontextprotocol/sdk + zod(若未提供 package.json,按需安装)
python -m pip install -r requirements.txt2. 配置
cp .env.example .env
# 编辑 .env:PG、LLM、embedding 等进程启动时会自动读项目根目录的 .env(不要提交)。
可选本地文件(均 gitignore):
文件 | 用途 |
|
|
| 短口令精确替换表(公开仓 |
3. 启动
# MCP over HTTP
node server.js --http 3466
# MCP over stdio
node server.js
# Web 控制台
python web_server.py --port 3467MCP 接入
HTTP:
{ "mcpServers": { "openmem": { "url": "http://127.0.0.1:3466/mcp" } } }stdio:
{ "mcpServers": { "openmem": { "command": "node", "args": ["./server.js"] } } }MCP 工具
工具 | 作用 |
| 写入记忆( |
| 按 id 原地更新(保留 id,重算向量) |
| 混合检索(向量 + 元数据过滤) |
| 按 id 取单条 |
| 服务台账按名查询(若已导入 agent-matrix) |
| AI 对 AI 咨询,答案带 |
| 预生成答案(秒回) |
| 健康与统计 |
建议优先级:标准问题 → mh_tool → 需要原始片段 → mh_search → 需要综合口吻 → mh_ask。
写入示例:
mh_write(content="…结论/坑…", source="<agent名>", layer="m",
category="lessons", tags=["…"], confidence=0.8)Web 控制台
默认 http://127.0.0.1:3467(无鉴权,勿对公网裸奔)。
页签 | 能力 |
检索 | 语义检索 + 高亮,可编辑/删除 |
浏览 | 分页 + 分类/来源过滤 |
问问 | 流式问答、引用卡片、历史 |
预设工具 | 查看/刷新缓存答案 |
入职包 | 导出新 agent 需要的钉住事实与工具清单 |
AI 设置 | 提示词 / 模型 / key(写入 |
主要 API:/api/stats /api/search /api/browse /api/ask_stream /api/tools /api/config /api/health 等。
CLI(不经 MCP)
python mem_core.py write --content "..." --source me --layer m --category lessons
python mem_core.py search --query "..." --top_k 5
python mem_core.py ask --query "..." --agent mybot
python mem_core.py status辅助脚本
文件 | 用途 |
| 从本地 markdown 目录批量导入(路径请按环境改) |
| 服务总表目录指纹同步导入 |
| 命令行调用 MCP 工具 |
| 一次性审计/聚类辅助 |
配置优先级
对 AI 问答相关项(模型、key、persona 等):
数据库 app_config > 环境变量 / .env > 代码默认值安全
密钥只放
.env或服务环境变量,不要写进源码或提交 gitcred_guard是写入时的尽力打码,不能替代密钥治理Web / MCP 默认无鉴权:本机或反向代理 + 认证后再暴露
License
按你的仓库选择(例如 MIT)。
Available Tools
9 toolsmh_askA
AI 对 AI 咨询:像直接问老大陈丹本人一样提问,openmem 基于全部记忆给出完整、准确、口语化的答案(走 litellm GwV4F,数秒级,较慢)。只在 mh_tool 里没有对应成品答案、且问题需要理解+综合时才用:要标准答案走 mh_tool(秒回),要原始记忆片段走 mh_search(更快)。
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | 提问方 agent 名 | unknown-agent |
| query | Yes | 要问老大/问记忆的问题 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral burden. It discloses that the tool is slower (seconds-level), uses litellm GwV4F, and produces answers by synthesizing all memories. It doesn't mention error handling or side effects, but for a consultation tool this is adequate. It adds value beyond the schema by noting the performance characteristic.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core purpose and then providing usage guidelines with bold for emphasis. It is concise, well-structured, and every sentence earns its place. The key constraints (when to use, speed) are highlighted effectively.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple 2-parameter tool with no output schema, the description provides all necessary information: what it does, when to use it, how it differs from siblings, and its performance characteristics. An agent can confidently decide and call this tool correctly based on this description alone.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, meaning both parameters (query and agent) are already described in the schema. The description adds no additional semantic detail about parameters, so the baseline score of 3 applies. It doesn't compensate for any gaps because there are none.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: an AI-to-AI consultation that answers questions based on all memories, giving complete, accurate, and colloquial answers. It explicitly distinguishes from siblings by naming mh_tool for standard answers and mh_search for raw memory fragments, making the unique role unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit when-to-use guidance: only when mh_tool lacks a ready-made answer and the question requires understanding and synthesis. It also states when not to use it, directing to mh_tool for standard answers and mh_search for raw memory, with speed comparisons. This leaves no ambiguity for the agent.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mh_getA
按 id 取单条记忆完整内容。
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the behavioral burden. '取' and '完整内容' make clear this is a read operation returning the full memory, but it does not mention behavior for missing ids, output format, permissions, or potential side effects. For a simple get operation this is acceptable but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The entire description is one short, front-loaded sentence with no filler. It conveys the key action, object, and selection criterion efficiently.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-id fetch operation, the description covers the essential action. However, with no output schema and no annotations, it leaves open the exact return structure and edge-case behavior (e.g., non-existent id). The description is minimally viable but not fully self-sufficient for an agent operating without additional context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema documents 'id' as a required UUID but provides no description (0% coverage). The description adds that the id selects a single memory, which is useful, but beyond that it does not elaborate on the parameter's meaning or constraints. The parameter is simple enough that the schema plus minimal reference is adequate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a clear verb ('取' / get) and a specific resource ('单条记忆完整内容' / full content of a single memory), and explicitly ties retrieval to an id. This distinguishes it from sibling tools like mh_search (query-based) and mh_write/mh_update (mutating operations).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool: when you have a known id and need the complete memory record rather than search results. However, it does not explicitly contrast with mh_search or state when not to use it, leaving the routing partially implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mh_searchA
检索老大的统一记忆,返回原始条目(适合查历史细节、具体事件、某个坑的完整经过)。混合检索:向量语义 + 元数据过滤(layer/category/source/tags/时间)。⚠️ 但「老大是什么人 / 什么偏好 / 本机环境 / 服务与端口 / 某项目怎么改」这类标准问题请先试 mh_tools_list → mh_tool(成品答案,秒回、后台已保鲜),不要直接搜、更不要猜。注意:nssm 服务台账(agent-matrix/services)默认不返回,要查某服务的启动参数/端口用 source="agent-matrix" 显式指定。
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| layer | No | ||
| query | Yes | 查询问题或关键词 | |
| since | No | ISO 日期,如 2026-09-01 | |
| top_k | No | ||
| source | No | ||
| category | No | ||
| include_archived | No | 含已归档旧版本 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden and does it well: it discloses hybrid retrieval (vector semantics + metadata filtering) and a non-obvious default exclusion (nssm service ledger not returned unless source is specified). It stops short of explicitly declaring read-only behavior, but 'search/retrieve' plus the absence of side-effect language makes that reasonably clear.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three dense sentences with no filler: the core purpose is front-loaded, and each subsequent sentence delivers either routing guidance or an important retrieval caveat. The warning about standard questions is placed immediately after the purpose, which is exactly where an agent needs it.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For an 8-parameter search tool with no output schema, the description covers the essential context: what is returned, when to use it, how the retrieval works, which metadata filters apply, and an important default-exclusion gotcha. An agent has enough to decide whether to call this tool and how to route alternative requests.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is only 38%, so the description must compensate. It does so by identifying layer, category, source, tags, and time as metadata filters and giving a concrete example for source. It does not explain layer's k/m enum or top_k semantics, but the added context goes meaningfully beyond the sparse schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a clear verb and resource: retrieve the boss's unified memory and return raw entries, specifically suited for historical details, concrete events, and full accounts of past pitfalls. It further distinguishes itself from curated answer tools like mh_tool and mh_tools_list, so an agent can tell them apart.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly describes when to use the tool (historical details, specific events, full stories of pitfalls) and when not to (standard questions about the boss, preferences, environment, services, ports, project changes), routing those to mh_tools_list → mh_tool. It also gives a concrete alternative path for nssm service ledger queries by specifying source='agent-matrix'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mh_serviceA
查本机 nssm 服务台账:按服务名返回该服务的启动参数/端口/路径等配置明细(不走语义检索,按名精确匹配)。不知道确切名字就先不传 name,会列出全部服务名。
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | 服务名关键词,如 dsh / claude / visionqa;留空列出全部服务名 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and it discloses key behaviors: exact-name matching rather than semantic search, and a list-all fallback when 'name is empty. It also previews return content including startup parameters, port, and path, which goes beyond a generic query description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences front-load the core operation and then provide the key behavioral caveat and fallback instruction. There is no filler or redundant restatement of structured fields.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one optional parameter and no output schema, the description is complete: it tells the agent what is returned, how matching works, and what to do when the name is unknown. Nothing necessary for correct invocation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds real value by clarifying that the name must be exact and that omitting it triggers a full list, which is more specific than the schema's '关键词' phrasing. This helps the agent use the single parameter correctly without opening the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('查') and resource ('本机 nssm 服务台账'), and further scopes behavior to exact-name matching with a non-semantic-search caveat. This makes it clearly distinguishable from semantic-search siblings like mh_search.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly instructs the agent to omit 'name' when the exact service name is unknown, resulting in a list-all-services fallback, and states that exact matching is required. It does not explicitly name alternative tools for fuzzy/semantic lookup, but the '不走语义检索' caveat implies that boundary clearly enough.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mh_statusB
openmem 健康状态:总条数/钉住数/归档数/待审冲突/工具数/咨询次数。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what metrics are reported but does not explicitly say the operation is read-only, whether it has side effects, what permissions are needed, or how the data is returned. The read-only nature is only inferred from 'status'.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single compact sentence that front-loads the tool's purpose and immediately lists the six key metrics. There is no redundant filler, and every element contributes to understanding what the tool provides.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers what metrics are included, but with no output schema and no annotations, it leaves out details about the return format, data types, and whether the operation is strictly read-only. For a simple status tool it is adequate, but it is not fully complete for an agent needing to interpret the response reliably.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the baseline is 4. The description adds meaningful context by listing the categories of data the no-argument call will return, which helps the agent understand the call's output even though there is no parameter schema to enrich.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description identifies a specific resource ('openmem 健康状态') and enumerates six concrete metrics it reports (总条数/钉住数/归档数/待审冲突/工具数/咨询次数). It goes beyond the bare tool name, though it lacks an explicit verb. It is reasonably distinguishable from sibling tools like mh_write or mh_search because it clearly denotes a status/overview operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase '健康状态' implies this tool is used for health/status checks, but the description provides no explicit when-to-use guidance, exclusions, or comparison with sibling tools. There is an implied usage context, but no direct routing or alternatives are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mh_toolA
【首选 · 秒回】调用预生成答案工具:标准化提示词 + 后台已备好最新最准的答案,不走 LLM、几乎零等待。凡「老大是什么人 / 偏好习惯 / 铁律清单 / 本机环境 / 服务与端口 / 12 bot 花名册 / 项目索引 / openmem 使用手册」这类标准问题一律先用这个,别用 mh_search 现搜、更别凭印象猜。不知道有哪些成品答案就先调 mh_tools_list(一次看清全部 + 新鲜度)。
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 工具名,如 主人的喜好 | |
| force_refresh | No | 强制重新生成 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses that it uses pre-generated answers, does not invoke the LLM, and returns near-instantly, which is key behavioral context. With no annotations, this is the primary source of behavioral information, though it does not cover failure modes or side effects of force_refresh.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is longer than typical but front-loads the core purpose and includes structured examples and bolded guidance. Every sentence serves a purpose, though it could be tightened.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter retrieval tool, the description covers purpose, usage, and discovery guidance. It lacks output format details, but that is acceptable given no output schema and the simplicity of the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already describes both parameters with 100% coverage, so the description adds little beyond the example name. It does not clarify semantics further than the schema does.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool as a caller for pre-generated answers, with a specific resource (standard questions) and distinguishes it from mh_search. It lists concrete categories, making the purpose unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly instructs to use this tool for standard questions first, forbids using mh_search instead, and directs to mh_tools_list for discovery. Provides both positive and negative usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mh_tools_listB
列出全部预生成答案工具及答案新鲜度。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the burden. The description only states what it lists but doesn't disclose any behaviors like whether it requires authentication, whether it returns stale data, or whether it makes external calls. It doesn't contradict anything, but it's thin on behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence in Chinese, which is concise and to the point. It front-loads the purpose ('列出全部预生成答案工具') and adds the extra detail (freshness). It could be slightly more structured but it's efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a listing tool with no parameters, the description provides the essential what (list) and the extra (freshness). It doesn't describe the output format, but since there's no output schema, the description might need to hint at what 'freshness' means, but it's not critical. It's minimally complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With zero parameters, the description doesn't need to explain parameter semantics. The schema is empty, and the description correctly avoids mentioning parameters. A baseline of 4 is not necessary because there's nothing to compensate for.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific purpose: listing all pre-generated answer tools and providing freshness information. It is clear about the resource (pre-generated answer tools) and the action (list). It doesn't explicitly distinguish from siblings, but the siblings have different names suggesting different functions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use it (when you need an overview of available pre-generated tools and their freshness), but it doesn't explicitly state when not to use it or mention alternatives. For a tool with no parameters, context is limited, so a 3 is reasonable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mh_updateA
按 id 原地更新一条记忆(改错字、补内容、转 pinned、换 category 都用这个)。只改传了的字段,未传的保持不动;改了 content 会自动重算向量与 hash。保留 id,不打断 superseded_by / 冲突记录引用链——优于"删了重写"。改内容前建议先 mh_get 看一眼原文。
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | 要更新的条目 id | |
| tags | No | 给了就整组替换,不给则不动 | |
| layer | No | ||
| pinned | No | true/false;不给则不动 | |
| source | No | ||
| content | No | 新内容(给了就整条替换并重算向量) | |
| category | No | ||
| confidence | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly states partial-update semantics (only provided fields change), automatic vector and hash recomputation when content changes, and id preservation that doesn't break superseded_by/conflict reference chains. It doesn't mention error cases or permission requirements, but the core behavioral traits are well disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded: the first sentence states the action and use cases, the second explains the partial-update semantics and side effects, and the third gives the id-preservation rationale and a practical recommendation. Every sentence earns its place with no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For an 8-parameter mutation tool with no annotations and no output schema, the description covers the essential behavioral contract: partial updates, side effects, and id preservation. It doesn't describe return values or error conditions, but the core semantics an agent needs to invoke it correctly are present. The recommendation to use mh_get first adds practical completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 50%, and the description adds meaningful semantics beyond the schema: it explains the in-place partial-update model ('只改传了的字段,未传的保持不动'), the vector/hash recomputation side effect for content, and the id-preservation guarantee. This compensates well for the parameters that lack schema descriptions (layer, source, category, confidence).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('原地更新' / in-place update) and resource ('一条记忆'), and enumerates concrete use cases (fixing typos, supplementing content, toggling pinned, changing category). It also explicitly distinguishes itself from the alternative '删了重写' (delete-and-recreate), which differentiates it from sibling tools like mh_write.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit when-to-use guidance: use this for in-place updates to preserve id and reference chains, and it explicitly recommends reading the original with mh_get before modifying content. It also names the alternative approach ('删了重写') and explains why this tool is superior, giving clear context for when to choose this over other operations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
mh_writeC
写入一条记忆/知识到老大的统一记忆中枢(openmem)。source 必填=写入方 agent 名。layer: k=知识 m=记忆。category: rules/facts/projects/lessons/knowledge/archive/verification/services/capabilities/misc(或项目名如 dsh / agents-to-feishu)。重要结论不写入=任务不算完成。
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | 标签列表 | |
| layer | No | k=知识 m=记忆 | k |
| pinned | No | 关键事实钉住,免疫自动归档 | |
| source | Yes | 写入方 agent 名,如 codex / dsh / WorkBuddy | |
| content | Yes | 记忆内容正文 | |
| category | No | rules/facts/projects/lessons/knowledge/archive/verification/services/capabilities/misc,或项目名如 dsh / agents-to-feishu | misc |
| confidence | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full behavioral disclosure burden. It confirms the write nature and the mandatory completion rule, but does not mention whether the operation is new-entry-only, whether it can overwrite or merge, authentication/permissions, or any failure/error behavior. For a mutation tool with zero annotation coverage, this is a meaningful transparency gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loads the core action, then lists the essential parameter semantics in compact clauses. It avoids excessive wording and every sentence adds information. The only minor loss is a slightly disorganized ordering of requirements, but overall it is well-suited for an efficient read.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 7 parameters and no output schema, the description leaves several operational gaps: it doesn't state what the tool returns, how errors are signaled, or exactly what happens when a new entry conflicts with existing data. It also does not differentiate between writing a new memory and updating/replacing one via siblings. These are non-trivial details an agent needs to reliably invoke and verify the operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 86% schema coverage, the schema already documents most parameters. The description reinforces layer/category semantics and adds the 'important conclusions must be persisted' rule, but it mostly duplicates the schema's own parameter descriptions. It does not add per-parameter nuance that goes beyond the schema, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description starts with a clear verb and object (写一条记忆/知识 to the memory hub), explicitly names the target resource (openmem), and constrains it with required source, layer, and category values. It does not explicitly contrast itself with the sibling mh_update, but the verb 'write' versus 'update' strongly suggests a create-style operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives a high-level condition (重要结论不写入=任务不算完成), which implies that important conclusions should be written here, but it does not state when not to use it or mention alternatives like mh_update or mh_service. There is no inclusion/exclusion guidance or reference to other tools, leaving an agent to infer when to switch to a sibling tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
9 tool updates
v0.1.0- First observed
mh_ask - First observed
mh_get - First observed
mh_search - First observed
mh_service - First observed
mh_status - First observed
mh_tool - First observed
mh_tools_list - First observed
mh_update - First observed
mh_write
TDQS
Scored across 9 tools
The tools have distinct purposes, and the descriptions explicitly separate raw memory search (mh_search), synthesized answers (mh_ask), and pre-generated answers (mh_tool). Some risk remains because these three query-ish tools overlap in intent, but the guardrails in the descriptions are strong enough to guide selection.
All tool names use the consistent lowercase mh_ prefix and mostly follow a verb-based pattern like write, update, search, get, ask, and status. The noun-style exceptions mh_service, mh_tool, and mh_tools_list are minor deviations, and tools_list also reverses the expected order slightly.
Nine tools is well-scoped for a memory hub: core memory operations (write/get/search/update), specialized lookups (service/tool), and meta/status tools are all represented. Each tool has a clear role and none feel redundant.
The surface covers create, read, update, query, status, and specialized lookup workflows well. There is no explicit delete or conflict-resolution tool even though mh_status surfaces pending conflicts, but this may be intentional and can be worked around via archive/update and category changes.
Maintenance
Related MCP Connectors
Shared cross-LLM long-term memory over MCP: semantic recall, sessions, and media (pgvector).
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Persistent memory for AI agents — log and recall conversation context over MCP.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to store and retrieve long-term memories using PostgreSQL with vector similarity search. Supports semantic memory operations, tagging, and real-time updates for persistent learning across conversations.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to store, retrieve, and manage contextual knowledge across sessions using semantic search with PostgreSQL and vector embeddings. Supports memory relationships, clustering, multi-agent isolation, and intelligent caching for persistent conversational context.11 npm48MIT
- AlicenseNot gradedqualityAmaintenanceUser-owned shared memory for AI agents, providing a persistent, curated knowledge layer with hybrid search and cross-agent coordination via Postgres + pgvector.16Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to store and retrieve long-term memories with semantic search, supporting various memory types and tags via PostgreSQL and pgvector.11 npmMIT