Knowledge Graph Memory ServerKnowledge Graph Memory Server
用本地知识图谱做跨会话持久记忆的 reference server。它记忆落盘、跨会话共享,但没有访问控制。
A reference server implementing cross-session persistent memory with a local knowledge graph — memory is written to disk, shared across sessions, with no access control.
适合与不适合When to use it, when not to
让 Agent 跨会话记住用户偏好、项目背景等长期信息。
不适合存放需要审计或追溯的场景(图谱会原地修改), 也不适合存放高敏感信息——记忆文件无加密、无独立访问控制, 任何能读该文件的进程都能拿到全部记忆。
Scenarios needing cross-session memory that survives restarts and is queryable as a graph.
Not a fit for anything with access-control requirements — memory is written to disk with no access control.
中文生态China availability 国产 / 国内可直接用 / 备案状态 · 快照domestic / direct access / CAC filing · snapshot 2026-10-20
- 出品属地Origin
- 国外出品foreign-made 国外主体(网信办公示名单未见对应备案主体)。foreign entity (no matching filing entity in the CAC registry).
- 国内使用Direct access
- 大陆可直连direct OK 官网仓库在 GitHub,大陆直连波动(同日实测 200/000 混合);npm / PyPI 安装源实测稳定可达。Hosted on GitHub — direct reachability from mainland fluctuates (200/000 mixed on the same day); npm / PyPI install routes measured stable.
- 备案状态CAC filing
- 未见于备案名单not in filing list:未见于网信办公示名单(2026-10-20 检索 13 批附件,https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm);该产品未面向大陆公众提供服务,备案不适用。not in the CAC public registry (13 batch attachments searched 2026-10-20, https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm); the product does not serve the mainland public, so filing does not apply.
备案信息以网信办《生成式人工智能服务已备案信息》公示名单为准(按批次滚动更新,本站只抄编号不解读);「大陆可直连」是本站从大陆网络直连实测的结果,不是厂商承诺。GitHub 类站点当日实测有波动,口径写在依据里。Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.
固定坐标系Fixed coordinate system
11 个维度dimensions, 与同分区其他对象逐项可比each comparable item by item against others in the same section.
- 模型与开放条件Model & openness
本身不调用模型,是被客户端调用的接口实现。
设计与 Claude 的持久记忆场景绑定(README 明言「lets Claude remember information about the user across chats」)。
It calls no model itself; it is an interface implementation called by clients.
Its design is tied to Claude's persistent-memory scenario (the README states plainly "lets Claude remember information about the user across chats").
- 运行位置Where it runs
本地 Node.js 进程,通过 stdio 通信。
数据持久化在本地 JSONL 文件,生命周期独立于客户端进程。
A local Node.js process communicating over stdio.
Data persists in a local JSONL file, with a lifecycle independent of the client process.
- 本地文件Local files
只访问自己的记忆文件(默认在 memory 目录下),不提供任意文件读写工具。
存储位置可通过参数指定,实际可访问范围取决于该路径的权限。
Accesses only its own memory file (by default under the memory directory); it provides no arbitrary file read/write tools.
The storage location can be set via a parameter; the actual accessible range depends on the permissions of that path.
- 关机后的任务Tasks after shutdown
server 进程随客户端生死,
但记忆数据持久存在磁盘上,重启后仍在。
2026-09-03 修复了图变更序列化以避免并发写竞争。
The server process lives and dies with the client,
but memory data persists on disk and survives restarts.
A 2026-09-03 fix serialized graph mutations to avoid concurrent-write races.
- 工具与扩展Tools & extensions
提供 9 个工具:
- create_entities、create_relations、add_observations、delete_entities、delete_observations、delete_relations、read_graph、search_nodes、open_nodes。
另暴露一个 resource:
memory://knowledge-graph。含 3 个删除工具(delete_entities / delete_observations / delete_relations), 输出为结构化 JSON,可直接消费。
It provides 9 tools:
- create_entities, create_relations, add_observations, delete_entities, delete_observations, delete_relations, read_graph, search_nodes, open_nodes.
It also exposes one resource:
memory://knowledge-graph.Including 3 delete tools (delete_entities / delete_observations / delete_relations); output is structured JSON, ready for direct consumption.
- 上下文与记忆Context & memory
这是本 server 的核心能力:跨会话持久记忆。
用知识图谱结构存储实体、关系与观察, 支持检索(search_nodes)与按名读取(open_nodes)。
This is the server's core capability: cross-session persistent memory.
It stores entities, relations and observations in a knowledge-graph structure, supporting retrieval (search_nodes) and read-by-name (open_nodes).
- 权限与限制Permissions & limits
无独立审批机制。
记忆图谱是全局共享状态,任何写入都会影响后续所有会话。
提供 3 个删除工具,可删除实体、观察与关系。
2026-09-03 增加了 search_nodes 查询长度限制与去重修复。
No separate approval mechanism.
The memory graph is global shared state; every write affects all subsequent sessions.
It provides 3 delete tools that can remove entities, observations and relations.
On 2026-09-03 a search_nodes query-length limit and a deduplication fix were added.
- 适合什么任务Best for
让 Agent 跨会话记住用户偏好、项目背景等长期信息。
不适合存放需要审计或追溯的场景(图谱会原地修改)。
Lets an Agent remember long-term information such as user preferences and project context across sessions.
Not a fit for scenarios needing audit or traceability (the graph is mutated in place).
- 传输方式Transport
仅 stdio。本地 Node.js 进程,通过标准输入输出通信(npx 启动)。
官方 README(2026-10-08 全文核验)没有远程传输的官方启动方式。
stdio only. A local Node.js process communicating over standard input/output (launched via npx).
The official README (full-text verification 2026-10-08) has no official launch method for a remote transport.
- 认证机制Authentication
无独立认证层。stdio 形态继承客户端用户权限。
记忆文件本身无加密,任何能读该文件的进程都能获取全部记忆内容。
No separate authentication layer. In stdio form it inherits the client user's permissions.
The memory file itself is unencrypted — any process that can read that file can obtain all memory content.
- 权限范围Permission scope
作用域最窄的一类:只读写自己的记忆文件,不提供任意文件访问工具。
权限风险不在文件范围,而在内容敏感度——
记忆里可能有用户偏好、项目信息等隐私, 且文件无加密、无独立访问控制。
The narrowest-scope class: it reads and writes only its own memory file and provides no arbitrary file-access tools.
The permission risk lies not in file scope but in content sensitivity —
the memory may hold user preferences, project information and other privacy, and the file is unencrypted with no independent access control.
头号误解Top misconception
- 以为记忆只存在于当前会话,实际是磁盘持久化的全局状态Assuming memories live only in the current session — they are disk-persisted global state
- 以为删除操作需要审批,实际没有,误删会影响后续所有会话Assuming deletion needs approval — it does not, and an accidental delete affects every later session
- 以为它是简单的 key-value 存储,实际是知识图谱结构Assuming it is a plain key-value store — it is a knowledge-graph structure
未知项清单Known unknowns
- 记忆文件的默认位置与命名
- 是否支持 Streamable HTTP(仓库未声明)
- 存储后端是否可替换(是否只支持 JSONL)
- 并发写的最终一致性保证程度
- The default location and naming of the memory file
- Whether Streamable HTTP is supported (not declared in the repo)
- Whether the storage backend is replaceable (is JSONL the only supported form)
- The degree of eventual-consistency guarantees for concurrent writes
证据来源Evidence sources
判断可回到以下一手源复核。本站核验日Every judgement can be rechecked against the primary sources below. Verified on 2026-10-23,内容更新日content updated on 2026-10-08。
| 类型Type | 名称Name | 链接Link |
|---|---|---|
| docs | MCP · Memory ServerMCP · Memory Server | https://github.com/modelcontextprotocol/servers/tree/main/src/memory |
| changelog | MCP · Memory 目录变更历史MCP · Memory directory change history | https://github.com/modelcontextprotocol/servers/commits/main/src/memory |
| changelog | MCP · Servers ReleasesMCP · Servers Releases | https://github.com/modelcontextprotocol/servers/releases |
| repo | MCP · Servers 仓库 README(生产环境免责声明)MCP · Servers repo README (production-use disclaimer) | https://github.com/modelcontextprotocol/servers |
实测记录Measured runs
本档未在真实客户端逐项跑通;工具清单与权限来自官方 README。
This site has not completed measured runs. The test protocol is at protocols/mcp/_protocol.md.
变更记录说明Change-log notes
本对象无独立 changelog 页,变更记录在目录 commit 历史中:
| 日期 | 内容 |
|---|---|
| 2026-09-03 | 序列化图变更,避免并发写竞争 |
| 2026-09-03 | 单批次内跳过重复实体与关系 |
| 2026-09-03 | 限制 search_nodes 查询长度 |
三条修复集中在同一天(09-03),说明这一版对稳定性做了集中处理。特别是「并发写竞争」——说明多会话同时读写记忆曾有数据损坏风险。
如果你在多会话环境用它,这三条值得读原文。
This object has no standalone changelog page; change records are in the directory's commit history:
| Date | Content |
|---|---|
| 2026-09-03 | Serialize graph mutations to avoid concurrent-write races |
| 2026-09-03 | Skip duplicate entities and relations within one batch |
| 2026-09-03 | Limit search_nodes query length |
All three fixes landed on the same day (09-03), showing that release concentrated on stability. Especially the "concurrent-write race" — it means simultaneous multi-session reads/writes of memory once risked data corruption.
If you use it in a multi-session environment, these three are worth reading at the source.
数据结构Data structures
| 概念 | 说明 | 示例 |
|---|---|---|
| Entity | 图谱节点,有唯一名称、类型、观察列表 | {name: "X", entityType: "person", observations: [...]} |
| Relation | 实体间的有向连接 | {from: "A", to: "B", relationType: "works_at"} |
| Observation | 挂在实体上的原子事实 | 建议一条观察只存一个事实 |
关系用主动语态存储,如 works_at 而非 works at。这是文档里的明确约定。
| Concept | Description | Example |
|---|---|---|
| Entity | a graph node with a unique name, type and observation list | {name: "X", entityType: "person", observations: [...]} |
| Relation | a directed connection between entities | {from: "A", to: "B", relationType: "works_at"} |
| Observation | an atomic fact attached to an entity | one fact per observation is recommended |
Relations are stored in active voice, e.g. works_at rather than "works at". This is an explicit convention in the docs.
工具清单与读写属性Tool inventory and read/write attributes
| 工具 | 属性 | 说明 |
|---|---|---|
read_graph | 读 | 读取整张图 |
search_nodes | 读 | 按条件检索节点 |
open_nodes | 读 | 按名读取特定节点 |
create_entities | 写 | 新建实体 |
create_relations | 写 | 新建关系 |
add_observations | 写 | 给实体追加观察 |
delete_entities | 删除 | 删除实体及其关联 |
delete_observations | 删除 | 删除观察 |
delete_relations | 删除 | 删除关系 |
6 读 3 写 3 删除。删除操作有三个工具,分别用于节点、观察和关系。
| Tool | Attribute | Description |
|---|---|---|
read_graph | read | read the whole graph |
search_nodes | read | search nodes by condition |
open_nodes | read | read specific nodes by name |
create_entities | write | create entities |
create_relations | write | create relations |
add_observations | write | append observations to entities |
delete_entities | delete | delete entities and their connections |
delete_observations | delete | delete observations |
delete_relations | delete | delete relations |
6 read, 3 write, 3 delete. Three deletion tools cover entities, observations and relations.
权限风险的特点What is distinctive about its permission risk
和其他 MCP server 不同,memory 的风险不在文件范围,在内容:
| 维度 | 评价 |
|---|---|
| 文件访问范围 | 最窄 — 只碰自己的记忆文件 |
| 写入影响 | 全局 — 影响后续所有会话 |
| 内容敏感度 | 高 — 可能存有用户偏好、项目信息 |
| 访问控制 | 无 — 文件无加密,无独立鉴权 |
任何能读到那个 JSONL 文件的进程,都能拿到全部记忆。
如果你用它存敏感信息,这一点必须考虑。
Unlike other MCP servers, memory's risk is not in file scope but in content:
| Dimension | Assessment |
|---|---|
| File-access scope | narrowest — touches only its own memory file |
| Write impact | global — affects all subsequent sessions |
| Content sensitivity | high — may hold user preferences, project information |
| Access control | none — the file is unencrypted, no independent auth |
Any process that can read that JSONL file obtains the entire memory.
If you store sensitive information with it, this point must be considered.
与 filesystem 的对比Comparison with filesystem
| 维度 | filesystem | memory |
|---|---|---|
| 访问范围 | 目录白名单(可很宽) | 仅自己的记忆文件(很窄) |
| 删除能力 | 不提供 | 提供 3 个删除工具 |
| 持久化 | 无状态 | 图谱持久化到磁盘 |
| 跨会话 | 不支持 | 核心能力 |
取舍很清楚:memory 用「能力受限但内容敏感」换取「跨会话能力」。
| Dimension | filesystem | memory |
|---|---|---|
| Access scope | directory allowlist (can be wide) | only its own memory file (very narrow) |
| Delete capability | not provided | provides 3 delete tools |
| Persistence | stateless | graph persisted to disk |
| Cross-session | not supported | the core capability |
The trade-off is clear: memory trades "limited capability but sensitive content" for "cross-session capability".
相关条目Related entries
- Sequential Thinking MCP ServerSequential Thinking MCP Server推理结构化方向The reasoning-structuring direction
- Filesystem MCP ServerFilesystem MCP Server若需自行管理记忆文件,可用它替代If you want to manage memory files yourself, it can serve as a substitute
- Hermes AgentHermes Agent另一层 · 框架与运行时Other layer · Frameworks & runtimes
本页由This page is generated from the ai-handbook 数据层生成(CC BY 4.0)。data layer (CC BY 4.0).
方法论与坐标系定义见仓库内For the methodology and coordinate definitions, see METHODOLOGY.md.