kb-memory
rag-kb — 本地 Agent 记忆与知识服务
English | 中文
本地优先、完全离线可用的 Agent 记忆与知识服务——REST + MCP 双协议,混合检索(向量 + BM25 归一化加权融合),文档/网页入库与 RAG 问答;无 LLM 时存取与检索完整可用。
kb 是本地优先、完全免费的 Agent 记忆与知识服务(v2.2.0)。
开源协议:Apache-2.0(含专利授权,可商用)。
kb — 本地优先的 Agent 记忆与知识服务
Windows 单进程常驻(python -m kb serve),REST + MCP 双协议,向 Claude Code /
Cursor / TraeWork / 自建 Agent 提供记忆写入、文档与网页入库、混合检索
(向量 + BM25 归一化加权融合)与 RAG 问答。
无 LLM 时存取与检索完整可用——记忆写入、文档入库、混合检索不依赖任何大模型;
配置本地 Ollama 或云端 API 后,/ask 问答能力自动启用。
Related MCP server: mnemostack
核心特性
单进程常驻:一个
python -m kb serve同时提供 REST API 与 MCP 端点,无需额外组件混合检索:向量检索 + BM25 关键词检索,归一化加权融合排序(每路 min-max 归一化后按生效路数均权,N32/N33),中文分词友好
嵌入模型:默认
BAAI/bge-small-zh-v1.5(轻量,约 92 MB / 512 维)——开箱成本低、CPU 上也快;需要更强语义理解可换BAAI/bge-m3(约 2.2 GB / 1024 维),见「嵌入模型怎么选」可选精排:
KB_RERANK_ENABLED=true启用 bge-reranker-v2-m3 交叉重排(默认关)可选三路:
KB_SPARSE_ENABLED=true启用 BGE-M3 稀疏向量第三路(默认关,失败自动降级双路;需 bge-m3)
记忆管理:写入 / 更新 / 删除 / 列表,支持 namespace、tags、type 过滤
记忆全共享:所有记忆/知识与任何客户端、任务、AI 全共享——本地单用户定位,跨 agent、跨任务读到同一份用户记忆;client 仅用于审计归类与元数据;主键服务端生成
全局 + 分项目记忆(v2.1):不传
project写入全局库;传project写入独立子库kb_data/projects/<project>/(物理隔离,删目录即删项目记忆);带项目检索 = 项目子库 + 全局库加权合并(KB_PROJECT_BOOST)PyPI 安装与依赖瘦身(v2.1):
pip install "kb-memory[ingest]",摄取/LLM 拆为可选 extras;Linux 可先装 CPU 版 torch,总下载量显著下降Skill 自动安装与发现(v2.1):skill 内置
bootstrap.py,询问用户同意后才建独立环境安装;kb where告诉你装在哪,kb autostart enable开机自启空闲卸载(v2.1):
KB_IDLE_UNLOAD_SECONDS到期自动卸载嵌入模型并释放显存,后台占用趋零记忆语言与自定义规则(v2.1):
KB_MEMORY_LANG=auto跟随操作系统语言存储记忆;~/.kb/rules.md自定义"什么时候该存记忆"存取审计:每次写/读/改/删/检索/问答记 JSON 到
logs/agent-audit/<客户端>__<项目>.log(按 client+project 分文件);用户可查:RESTGET /api/v1/audit?client=<客户端>[&project=<项目>]或 CLIkb audit --client <客户端>知识入库:本地文档(txt/md/pdf/docx 等)上传或路径导入,网页正文抓取入库
目录监听:指定目录内新增/删除文件自动入库/清理(
KB_WATCH_DIR)CLI 工具:
kb add/search/stats/ask/eval/forget/dedup——终端直接完成写入、检索、统计与 RAG 问答隐私护栏:敏感 namespace 强制本地回答不出网;
/ask智能路由(本地优先,难题可选云端)断网可用:模型与数据全部落本地,无网络时存取与检索功能完整
快速开始(Linux / Windows / macOS)
Linux(推荐,含 2 核 2G 小服务器):先装 CPU 版 torch,再装 kb。
pip install torch --index-url https://download.pytorch.org/whl/cpu # CPU 轮子约 196 MB
pip install "kb-memory[ingest]"
python -m kb serve不先装 CPU 版 torch 时,PyPI 默认会拉 CUDA 版本(torch + cudnn + nccl 等合计 2–3 GB), 这是 Linux 新用户最大的下载坑;只做记忆存取与检索不需要显卡。
2 核 2G 服务器建议配置(写入 .env 或环境变量):
KB_DEVICE=cpu
KB_LLM_MODE=off
KB_TORCH_THREADS=2 # 0=自动(按 cgroup/affinity 配额,最多 4)
KB_EMBED_BATCH_SIZE=16 # 默认 32;内存紧张降到 8–16
KB_IDLE_UNLOAD_SECONDS=300 # 空闲 5 分钟卸载嵌入模型启动阶段不加载嵌入模型(百 MB 级);首次检索/写入才加载默认 bge-small(约 92 MB),
加载后常驻通常 < 1 GB,检索为毫秒级,2 核 2G 可运行。LLM 问答(/ask)在 2G 上
建议保持关闭或使用云端。
Windows / macOS:
pip install "kb-memory[ingest]" # 核心 + 文档/网页摄取;[llm]=云端问答,[full]=全部
python -m kb serve源码开发安装:
python -m venv venv
.\venv\Scripts\Activate.ps1 # Linux/macOS: source venv/bin/activate
pip install -r requirements.txt
pip install -e ".[full]" # 开发/测试需要摄取、监听与 LLM 可选依赖
python -m kb serve首次安装要下载什么、大概多久(先看一眼,避免以为卡死了):
Linux 先装 CPU 版
torch(约 196 MB)后,整条核心依赖约 0.5–0.7 GB; Windows / macOS 核心依赖约 400–600 MB(Windows CPU 版torch约 124 MB 为最大单体);可选
[ingest]额外约几十 MB(PDF/DOCX/Office 解析、网页提取、目录监听);首次写入/检索时才加载并下载嵌入模型(懒加载,启动本身很轻),默认
bge-small-zh-v1.5约 92 MB(若显式配了KB_EMBED_MODEL=BAAI/bge-m3,则约 2.2 GB);国内网络可加 pip 镜像加速(实测阿里云可用、清华可能 403),但镜像同步新包有延迟 (实测阿里云对
kb-memory返回过 404);建议同时挂官方源兜底:pip install "kb-memory[ingest]" -i https://mirrors.aliyun.com/pypi/simple/ --extra-index-url https://pypi.org/simple/若仍报No matching distribution,改用官方源:pip install "kb-memory[ingest]" -i https://pypi.org/simple/模型下载走 HuggingFace 镜像:
$env:HF_ENDPOINT='https://hf-mirror.com'(Windows)/export HF_ENDPOINT=https://hf-mirror.com(Linux、macOS)。重要:用源码 venv 安装时
kb命令只装在虚拟环境内。每个新终端都要先激活虚拟环境 (Windows.\venv\Scripts\Activate.ps1,Linux/macOSsource venv/bin/activate), 否则会提示kb:未找到命令。改用python -m kb <子命令>可绕过激活。 不知道自己的 kb 装在哪里、怎么启动:kb where,或运行 skill 包里的python bootstrap.py --status/--start-only。
启动后健康检查:
curl http://127.0.0.1:8000/api/v1/healthz嵌入模型采用懒加载:启动后空闲时几乎不占内存,首次写入或检索才加载
BAAI/bge-small-zh-v1.5(约 92 MB,自动下载并缓存,之后断网可用); 未配置 LLM 时服务照常启动,/ask返回 503 与配置指引。/healthz的embedder字段会显示unloaded/loading/ok/error,模型加载失败时 写/查请求返回 503EMBED_MODEL_UNAVAILABLE(含模型名与修复建议),不再裸 500。CPU 即可运行,不占显卡:Windows / macOS 安装默认使用 CPU 版 torch; Linux 按上面的命令先装 CPU 轮子即可,无独立显卡的机器也能完整使用。 有显卡想加速(大库、批量入库)可另装 CUDA 版 torch 后显式
KB_DEVICE=cuda。LLM 默认关闭(
KB_LLM_MODE=off):服务启动不会探测/加载/调用任何大模型, 零显存、零成本、纯离线;记忆写入、文档入库、混合检索完整可用。 需要 RAG 问答(/ask)时再按下面方式配置本地或云端 LLM。
嵌入模型怎么选
默认用轻量模型,是为了让"先试试"的成本足够低;模型不强绑定,可随时按需切换:
模型 | 体积 | 维度 | 加载后常驻内存 | 适用 |
| 约 92 MB | 512 | 约 100 MB 量级 | 日常偏好/决策/笔记类记忆;CPU 上也快 |
| 约 2.2 GB | 1024 | 约 2 GB | 长文档、跨语言、语义更微妙的内容,需要更强语义召回 |
本项目在自带 50 题中文评测集上的实测(
kb eval):轻量模型 Recall@1 0.760 / MRR 0.847 / 平均延迟 28.6 ms;bge-m3 为 0.740 / 0.841 / 105.6 ms。小样本下二者基本持平,轻量模型更快更省。 但 bge-m3 在长文档与跨语言场景预期更强,两个模型定位不同,按自己数据选。
换模型前必读:向量维度不同(512 vs 1024),ChromaDB 集合维度由首次写入的向量决定, 换了模型后旧数据无法直接检索。所以:
新库(还没写过数据):直接设
KB_EMBED_MODEL=BAAI/bge-m3即可;已有数据的库:kb 会自动沿用建库时使用的模型(记录在
kb_data/runtime.json), 不会因默认值变化而破坏你的数据,启动日志会记录实际沿用的模型; 若能识别的配置与库不一致(你显式改了KB_EMBED_MODEL),还会给出 WARNING 说明如何迁移。 确要换模型,请先备份,再清空kb_data/chroma后重新入库。
配置 LLM(可选,/ask 问答需要)
KB_LLM_MODE 默认 off(不加载不调用);四个档位:
档位 | 行为 |
| 完全不加载/不调用 LLM;记忆存取与检索完整可用 |
| 仅本地 Ollama(完全离线,隐私零出网) |
| 本地优先,云端降级:本地 Ollama 可用走本地,无本地但有云端 Key 走云端 |
| 全部走云端(本地仅做压缩与隐私隔离) |
本地 LLM(Ollama):
# 1. 安装并启动 Ollama(Windows 从开始菜单/托盘启动,不要从 AI 沙箱终端拉起)
# 2. 拉取一个适合你电脑的模型(按显存/内存选择,如 qwen3:4b 约 3.2GB、
# qwen3:1.7b 约 1.8GB;国内可用魔搭加速,拉完 ollama cp 改成短名)
ollama pull <你的模型名>
# 3. 在 .env 配置后重启服务:
# KB_LLM_MODE=local # 仅本地
# KB_LLM_MODEL=<你的模型名> # 以 `ollama list` 输出的名称为准
# KB_OLLAMA_BASE_URL=http://localhost:11434云端 LLM(任意 OpenAI 兼容服务商,不绑定 DeepSeek): DeepSeek / OpenAI / 通义千问 / 硅基流动 / Moonshot 等均可,通用三键:
# .env
KB_LLM_MODE=auto # 本地优先、云端降级;或 cloud 全云端
KB_LLM_API_KEY=sk-xxx # 服务商 API Key
KB_LLM_BASE_URL=https://api.deepseek.com # 换成你所用服务商的 OpenAI 兼容端点
KB_LLM_CLOUD_MODEL=deepseek-v4-flash # 云端模型名验证:GET /api/v1/healthz 的 llm 字段——local/cloud 表示 LLM 已就绪,disabled 表示未启用。
常见问题:嵌入模型下载失败
中国大陆直连
huggingface.co会超时。设置 HF 镜像后重启即可:export HF_ENDPOINT=https://hf-mirror.com # 或写入 ~/.bashrc 永久生效 python -m kb serve模型会自动从镜像下载并缓存到
~/.cache/huggingface/hub/,之后断网也能离线加载。模型已在本机缓存,但无外网:
kb采用离线优先(先命中本地缓存,失败才联网), 只要缓存目录完整即可完全离线运行。报错里出现「torch 版本不满足 transformers 要求」:transformers 检测到 torch 过旧会 静默禁用 PyTorch 后端,底层只抛
NameError: name 'nn' is not defined。kb在加载模型前 预检这条依赖链,并直接给出两个版本号——按提示升级 torch(pip install -U torch)即可。
让 Agent 接入 kb(客户端无关)
把 kb 的接入规约交给 AI 客户端(TraeWork / Claude Code / Cursor / 自建 Agent), 让它们知道怎么读写记忆、按什么身份规约、怎么查审计。两种方式,任选其一:
skill(推荐,能自动触发)——可选的独立步骤:仓库内
skills/kb-memory/SKILL.md是客户端无关的 Anthropic 开格式 skill。把它安装到你所用客户端的用户级 skills 目录后, 该客户端的任何项目会话都会在读写记忆/RAG 问答/审计查询时自动识别并触发。 安装 = 把skills/kb-memory目录复制过去即可(有脚本,也可手动复制,无需任何依赖); 更新(重新覆盖)、卸载、以及装好后的使用说明见scripts/README.md。不装也不影响 kb 服务:skill 只是给 AI 客户端的「提示词包装」,与服务的安装、 启动无关——跳过这一步,服务照常运行,你随时可用方法 2 的纯文本提示词接入; skill 安装是一次性、按需、独立执行的,不会随
kb serve自动触发, 也不会写入你的任何客户端目录以外的文件。纯文本提示词(兜底,任何客户端通用):整段复制
docs/AGENT_PROMPT.md粘贴给 Agent 即可,不依赖 skill 机制。
.trae-cn/skills/.claude/skills/.cursor/skills是任何客户端都认的「标准」吗?——不是。 这些只是各家客户端各自的用户级约定目录:SKILL.md本身是统一的 Anthropic 开格式, 但「装到哪个目录、能否自动触发」由各客户端自行决定,支持程度不一:
客户端 | 用户级 skills 目录 | 自动加载 |
TraeWork |
| 自动发现 |
Claude Code |
| 高版本支持 |
Cursor |
| 逐步跟进 |
其他 / 自建 Agent | 无统一约定 | 需手动加载或不支持 |
不存在「所有客户端都遵循」的统一目录;你的客户端若不支持 skill,永远有方法 2 兜底 (粘贴
AGENT_PROMPT.md,纯文本任何客户端可用)。安装方法、各客户端目录差异与加载机制、 相互引用关系:详细见scripts/README.md(此处不重复)。
打包为独立 skill(Agensi / marketplace)
skills/kb-memory/ 是 kb 的独立交付单元,只依赖 kb 服务本身:
包含标准 front matter 的 SKILL.md(包根)、MCP 配置模板 mcp.json、配置模板
env.example、独立 README 与 LICENSE,覆盖「安装 → 启动 → 配置 → 验证 → 排障」全流程。
python scripts/build_skill_package.py # 产物:dist/kb-memory-skill-<版本>.zipzip 内 SKILL.md 位于包根目录,不含测试、运行数据或任何密钥;
构建脚本会校验 front matter、自包含说明与敏感信息。可直接提交到 Agensi 这类
skill marketplace,用户拿到包后按 SKILL.md 即可把本机 kb 接入自己的 Agent。
MCP 挂载
MCP 端点(streamable HTTP):http://127.0.0.1:8000/mcp/
Claude Code:本仓库已内置项目级 .mcp.json,在本目录启动 Claude Code 即自动挂载;
也可全局添加:
claude mcp add --transport http kb http://127.0.0.1:8000/mcp/Cursor / TraeWork 及其他支持 MCP 的客户端:在 MCP 配置中加入以下 JSON
(Cursor 放 ~/.cursor/mcp.json 或项目 .cursor/mcp.json;TraeWork 在设置中添加 MCP 服务器):
{
"mcpServers": {
"kb": {
"type": "http",
"url": "http://127.0.0.1:8000/mcp/"
}
}
}挂载后可用的 MCP 工具(11 个):write_memory / search_memory / read_memory /
update_memory / delete_memory / link_memory / unlink_memory / list_links /
add_document / add_webpage / ask_kb。
启用
KB_API_KEY鉴权后,MCP 客户端需在连接配置加headers(Authorization: Bearer <key>); 仓库内.mcp.json模板不含真实 key(JSON 不支持注释),配法见 USER_GUIDE §5.2。
REST 端点速查
方法 | 路径 | 说明 |
POST |
| 写入记忆 |
GET |
| 记忆列表,支持 |
GET |
| 读取单条记忆 |
PATCH |
| 更新内容或标签 |
DELETE |
| 删除单条记忆 |
POST |
| 建立记忆关联 |
GET |
| 列一跳关联(含内容/方向; |
DELETE |
| 取消关联(任一方向;删除后同步清理) |
POST |
| 混合检索 |
POST |
| 文档入库:multipart |
GET |
| 已入库文档列表(按 source 聚合) |
DELETE |
| 按 source 删除该文档全部记录(本地文件名等简单 source) |
DELETE |
| 按查询参数删除(URL 等含斜杠的 source 必须用这个) |
POST |
| 网页入库 |
POST |
| RAG 问答 |
GET |
| 健康检查与服务统计(含 |
GET |
| 记忆治理统计: |
GET |
| 治理配置:衰减+新鲜度开关与参数(只读) |
POST |
| 启用语义去重( |
记忆关联默认启用一跳检索扩展:命中的 memory 会带出直接关联的邻居(结果附
via: {id, relation}),无关联数据时与基础检索完全一致;开关与上限见KB_LINK_EXPAND_ENABLED/KB_LINK_EXPAND_LIMIT。设计见 memory-links spec。记忆治理(去重/衰减/新鲜度)均默认关闭、零行为变化;用法见 USER_GUIDE §3.5。
示例(Windows PowerShell 可直接复制;中文必须按 UTF-8 字节发送):
function Invoke-KbJson($Uri, $Body) {
Invoke-RestMethod -Uri $Uri -Method Post -ContentType 'application/json; charset=utf-8' `
-Body ([System.Text.Encoding]::UTF8.GetBytes(($Body | ConvertTo-Json -Depth 5)))
}
# 写入一条记忆
Invoke-KbJson http://127.0.0.1:8000/api/v1/memories @{ content = "用户偏好深色主题"; tags = @("偏好") }
# 混合检索
Invoke-KbJson http://127.0.0.1:8000/api/v1/search @{ query = "用户界面偏好"; top_k = 5 }
# 按 URL 删除网页文档(source 需 URL 编码;PowerShell 用 [uri]::EscapeDataString)
$src = [uri]::EscapeDataString("https://example.com/page")
Invoke-RestMethod -Uri "http://127.0.0.1:8000/api/v1/documents?source=$src" -Method DeleteLinux / macOS 用 curl(curl 在这里是原生命令,不是 PowerShell 别名):
curl -X POST http://127.0.0.1:8000/api/v1/memories \
-H "Content-Type: application/json" \
-d '{"content": "用户偏好深色主题", "tags": ["偏好"]}'配置项简表
全部配置以 KB_ 前缀的环境变量或 .env 文件提供;完整键名见 .env.example
(复制为 .env 后填写,.env 已被 gitignore,真实密钥只放本机,严禁入库)。
配置项 | 默认值 | 说明 |
|
| LLM 模式: |
| 空 | 嵌入模型设备:空或 |
|
| serve 模式监听目录,文件变动自动入库;空串或 |
|
| 运行数据根目录(ChromaDB、运行时状态等) |
|
| REST 与 MCP 监听地址 |
|
| 嵌入模型(轻量默认,约 92 MB);可换 |
|
| 低配 CPU 调优:线程数 |
|
| 嵌入模型空闲 N 秒后卸载; |
| 空 | 本地 Ollama 模型名(默认空=不配;配 |
|
| Ollama 端点 |
| 空 | 云端 LLM(可选):任意 OpenAI 兼容服务商(DeepSeek / OpenAI / 通义 / 硅基流动等),仅填在本机 |
|
| 文档切分参数 |
| 空 | 逗号分隔的敏感 namespace,命中强制本地回答不出网 |
| 空 | 空=不鉴权(本地回环零摩擦);非空=启用 Bearer/X-API-Key 鉴权 |
|
| 检索精排(A3.5):融合候选送 CrossEncoder 重排,默认关 |
|
| 稀疏第三路(A3.5):BGE-M3 稀疏向量 + 倒排索引参与归一化加权融合,默认关 |
|
| 记忆关联一跳扩展:每次最多追加邻居数、邻居分数相对种子的比例 |
|
| 单条记忆的关联边上限(防止单点成为巨型枢纽) |
CLI 速查(无需启动服务)
python -m kb add "记忆内容" --tags 偏好 --client TraeWork # 写入(project 缺省自动取当前目录名)
python -m kb search "查询词" --client TraeWork # 混合检索(v2.1:不传 project 查全局;传 project 合并子库)
python -m kb stats # 统计:类型分布 / 访问热度 / 陈旧分布
python -m kb ask "问题" --client TraeWork # 终端 RAG 问答(LLM 不可用时输出检索命中)
python -m kb audit --client TraeWork --days 7 # 查某客户端/项目存过/读过什么
python -m kb eval --file tests/eval_zh_50.jsonl # 检索质量评测(Recall@1/@5 + MRR)
python -m kb forget --stale --days 90 --dry-run # 全作用域预览(默认 dry-run,删除前自动备份)
python -m kb dedup --threshold 0.92 # 语义去重
kb ask直连本地服务逻辑(不经 HTTP);建议serve停止时使用,避免双进程写库竞争。
目录结构
kb/ kb 服务源码(config / models / embedder / storage / bm25 / retriever /
service / llm / ingest / watcher / api / mcp / cli + reranker / sparse / eval)
tests/ kb 验收测试(462 项通过 / 1 跳过,含 eval_zh_50.jsonl 检索评测数据集)
docs/ 用户指南、开发者手册与设计文档
kb_data/ kb 运行数据(gitignore)更多文档
用户使用手册:docs/USER_GUIDE.md
设计文档(需求、架构、API、里程碑):
docs/superpowers/specs/2026-08-23-kb-memory-service-design.mdv2.1 设计(当前):
docs/superpowers/specs/2026-10-20-kb-v2.1-design.md开发者维护手册:
docs/DEV_HANDBOOK.md
Available Tools
11 toolsadd_documentB
导入本地文档(PDF/DOCX/MD/TXT 及 Office 格式)切分入库; 返回 {"source": 文件名, "chunks": 块数};文件不存在或格式不支持时 返回 {"error": "FILE_NOT_FOUND" | "UNSUPPORTED_FORMAT", "message": 原因}。 project:文档 chunk 落入该项目子库(空=全局库);client:仅用于审计归类。 English: Import a local document (PDF/DOCX/MD/TXT and Office formats), split and ingest it; returns {"source": filename, "chunks": count}; when the file is missing or the format is unsupported returns {"error": "FILE_NOT_FOUND" | "UNSUPPORTED_FORMAT", "message": reason}. project: chunks go to that project's sub-store (empty = global); client is audit-only.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| client | No | ||
| project | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the full burden; it usefully discloses the return shape (source/chunks) and the two error codes with reasons, which is real behavioral value. However it omits permissions/auth, idempotency, and what happens on re-import or duplicate files.
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?
Front-loads the operation and return contract, which is good structure. But the entire content is duplicated in Chinese and English, roughly doubling length without adding information, and the parameter notes trail after the return-value block.
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?
With no output schema the description correctly supplies the return and error contract, and with no annotations it covers parameter meaning. It is only missing the safety/permission profile and path-format semantics, so it is close to complete for a 3-parameter ingest 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?
Schema description coverage is 0%, so the description must compensate. It does well for project (sub-store target, empty = global) and client (audit-only), but the required `path` parameter is left unqualified – no indication of whether it is a server-side or client-side path or an absolute vs relative path.
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 specific verb (import/split/ingest) and resource (local document) plus the supported formats, so it is distinguishable from the sibling add_webpage via the 'local' qualifier. It stops short of naming the sibling explicitly, but the intent is 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?
No explicit when-to-use or when-not-to-use guidance. It never mentions add_webpage (the obvious alternative for remote content) or any prerequisite/precondition, leaving the agent to infer that this tool is only for local files.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
add_webpageA
抓取网页正文并切分入库;返回 {"source": url, "chunks": 块数}; 抓取/正文提取失败时返回 {"error": "WEB_FETCH_FAILED", "message": 原因}。 project:web chunk 落入该项目子库(空=全局库);client:仅用于审计归类。 English: Fetch a webpage body and ingest it after splitting; returns {"source": url, "chunks": count}; on fetch/body-extraction failure returns {"error": "WEB_FETCH_FAILED", "message": reason}. project: chunks go to that project's sub-store (empty = global); client is audit-only.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| client | No | ||
| project | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does reasonably well: it discloses both the success return shape ({source, chunks}) and the failure shape including the WEB_FETCH_FAILED error code and a reason message. It also explains the storage scoping rule (project sub-store vs global). It stops short of auth requirements, rate limits, or duplicate-URL behavior.
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 content is front-loaded and each piece of information is useful, but the entire description is duplicated verbatim in Chinese and English, which doubles the token cost without adding information for a reader who understands either language.
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?
There is no output schema, so the description's disclosure of the return and error shapes is exactly what is needed. For a simple 3-parameter ingestion tool with no annotations, the description covers purpose, parameters, and outcomes adequately; only operational details like deduplication or size limits are absent.
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 0%, so the description must compensate, and it does for the non-obvious parameters: 'project' is explained as the destination sub-store with empty meaning global, and 'client' is explicitly flagged as audit-only metadata. 'url' is self-evident. This adds real meaning beyond the echoed titles in 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 concrete verb chain and resource: fetch a webpage body, split it, and ingest it into the store. That is far more specific than the bare name, but it never differentiates itself from the sibling add_document (file-based ingestion) or write_memory, so an agent must infer which ingestion tool to pick.
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?
Usage is only implied by the phrase 'fetch a webpage body and ingest it' — an agent can infer this is for pulling web content into the knowledge base. There is no statement of when to prefer add_document over this tool, no prerequisites, and no exclusions (e.g. unsupported schemes or already-ingested URLs).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ask_kbA
基于知识库的 RAG 问答(检索 → 上下文拼装 → 护栏生成),返回 answer 与 sources; project:检索该项目子库 + 全局库(空=仅全局库),并写 ask 存取审计; client:来源客户端(可选,缺省从 clientInfo 自动识别,仅审计); LLM 不可用时返回 {"error": "LLM_DISABLED", "message": 配置指引}。 English: Knowledge-base RAG Q&A (retrieve → build context → guarded generation), returning answer and sources; project: search that project's sub-store plus the global store (empty = global only); an ask access-audit is emitted; client is audit-only; returns {"error": "LLM_DISABLED", "message": setup guidance} when the LLM is unavailable.
| Name | Required | Description | Default |
|---|---|---|---|
| client | No | ||
| project | No | ||
| question | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations the description carries the full burden, and it does disclose meaningful behavior: the retrieve→context→guarded-generation pipeline, the side effect that an ask access-audit is written, that client is audit-only, and the exact failure contract {"error": "LLM_DISABLED", ...}. It stops short of covering auth requirements, rate limits, or result-size limits.
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 content is front-loaded and dense, but the English block restates the Chinese block nearly verbatim, roughly doubling the length without adding information. A single-language description would carry the same payload.
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?
No output schema exists, so the description correctly takes on the return contract (answer + sources, plus the error object) and covers the one non-obvious side effect. Missing detail is limited to the shape of sources and any size or rate limits.
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 0%, so the description must compensate. It successfully explains project (sub-store + global, empty = global only) and client (optional, auto-detected from clientInfo, audit-only), which the schema alone gives no meaning for. Only 'question' is left without added detail, but its meaning is self-evident.
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: 'Knowledge-base RAG Q&A (retrieve → build context → guarded generation), returning answer and sources'. It is unambiguous about what the tool produces, but it does not name or contrast with siblings such as search_memory, so an agent must infer the boundary itself.
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?
Usage is implied by the pipeline and by the project/client explanations, and the LLM-disabled fallback gives situational context. However, there is no explicit when-to-use-this-vs-search_memory guidance, no statement about question phrasing, and no exclusion conditions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_memoryA
按 ID 删除一条记忆;成功返回 {"ok": true},记录不存在返回 {"error": "NOT_FOUND"}。 project:先查该项目子库,再查全局库;不传时先查全局库再查各项目子库。 client:来源客户端(可选,缺省从 clientInfo 自动识别,仅审计)。 English: Delete a memory by ID; returns {"ok": true} on success and {"error": "NOT_FOUND"} when it does not exist. project: locate in that project's sub-store then the global store; when omitted, global first and then each project store. client is audit-only.
| Name | Required | Description | Default |
|---|---|---|---|
| client | No | ||
| project | No | ||
| record_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses return payloads ({'ok': true} vs {'error': 'NOT_FOUND'}), the scoped search order for project, and that client is audit-only with auto-detection from clientInfo. It omits whether deletion is permanent/irreversible and any permission requirements.
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?
Content is front-loaded and clear, but it is presented bilingually with the English text duplicating the Chinese nearly verbatim, roughly doubling the length without adding information. That redundancy costs efficiency.
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 mutating tool with no annotations and no output schema, the description covers the essentials: return values, project scoping order, and audit behavior. It is nearly complete, only missing auth/irreversibility details and guidance on obtaining record_id.
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 0%, so the description must compensate. It explains 'project' lookup behavior and clarifies 'client' is optional and audit-only, but says nothing about the required 'record_id' (format, where to obtain it), leaving one of three params undocumented.
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 specific verb+resource ('Delete a memory by ID') and the operation is unambiguously distinct from siblings like read_memory, update_memory, and write_memory. An agent can identify the correct tool without inspecting the schema.
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?
Explains the resolution behavior for the 'project' parameter (project sub-store vs global store, and the lookup order when omitted), which is the main usage-relevant context. It does not state explicit when-not-to-use conditions or name alternative tools, but the delete semantics are self-evident.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
link_memoryA
建立两条记忆的关联(related/supersedes/depends_on/part_of/contradicts); 重复建边幂等(created=false)。仅同作用域的 memory 记录可关联,禁止自关联; 失败返回 {"error": , "message": 原因}(NOT_FOUND/SELF_LINK/...)。 project:项目子库(空=全局库);client:仅审计。 English: Link two memories (related/supersedes/depends_on/part_of/contradicts); duplicate edges are idempotent (created=false). Only memory records in the same scope can be linked, and self-links are rejected; failures return {"error": , "message": reason}.
| Name | Required | Description | Default |
|---|---|---|---|
| to_id | Yes | ||
| client | No | ||
| from_id | Yes | ||
| project | No | ||
| relation | No | related |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses idempotency semantics (`created=false`), the scope-consistency restriction, self-link rejection, and the failure envelope `{"error": <CODE>, "message": reason}` with sample codes. It omits permission/auth requirements and the full success payload beyond the `created` flag.
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?
Each half is tight and front-loaded with the core action before the constraints, but the entire body is duplicated verbatim in Chinese and English, roughly doubling length without adding information. Efficient content, wasteful packaging.
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?
With no annotations and no output schema, the description covers the mutation's semantics, constraints, idempotency and error shape — enough to invoke correctly. Only the precise success return value and any authorization preconditions are unstated.
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 0%, so the description must compensate — and it does for the non-obvious parameters: the five valid `relation` values, `project` (empty = global library) and `client` (audit only). `from_id`/`to_id` are left undefined but are self-evident from the purpose statement.
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 names a specific verb and resource ("Link two memories") and enumerates the exact relation vocabulary (related/supersedes/depends_on/part_of/contradicts), which also implicitly distinguishes it from the sibling `unlink_memory`. An agent knows precisely what this tool creates without opening the schema.
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 concrete preconditions: both records must be in the same scope, self-links are rejected, and duplicate edges are idempotent. It does not explicitly route the agent to `unlink_memory`/`list_links` for the inverse or inspection cases, which keeps it short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_linksB
列某条记忆的一跳邻居,返回 {"record_id", "links"};每项含 id/content/type/tags/relation/direction(out/in/both)。 记录不存在返回 {"error": "NOT_FOUND"}。 English: List one-hop neighbors of a memory as {"record_id", "links"}; each item has id/content/type/tags/relation/direction (out/in/both).
| Name | Required | Description | Default |
|---|---|---|---|
| client | No | ||
| project | No | ||
| relation | No | ||
| record_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must describe behavior itself. It does describe the response keys and the error payload ('记录不存在返回 {"error": "NOT_FOUND"}'), which is useful. However, it says nothing about permissions, result-set size limits, pagination, or the cost of traversing a high-degree node.
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 purpose is front-loaded in the first clause, and the error behavior follows compactly. The content is fully duplicated in Chinese and English, which doubles the length without adding information, but each half is efficient and the overall size is manageable.
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 compensates well for the missing output schema by specifying the response keys and the NOT_FOUND payload. With no annotations and 0% parameter coverage, however, an agent still cannot tell what 'client', 'project', or 'relation' do, so the definition is not complete enough for confident invocation.
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 0% across 4 parameters, so the description must explain them, but it does not. 'relation' and 'direction' appear only as returned fields, not as input filters, and 'client'/'project' are never mentioned at all, leaving half the schema opaque.
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 names a precise verb and resource: 'List one-hop neighbors of a memory'. It also states the return shape, {'record_id','links'}. It never names a sibling such as search_memory or read_memory, so the agent must infer that this is a graph-traversal tool rather than a keyword search, but the purpose itself is 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?
The phrase 'one-hop neighbors' implies graph exploration, but the description gives no explicit condition for choosing this tool over read_memory or search_memory, and it does not say when not to use it. The only usage behavior it states is the NOT_FOUND case for a nonexistent record.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_memoryA
按 ID 读取单条记忆完整内容;记录不存在返回 {"error": "NOT_FOUND"}。 project:先查该项目子库,再查全局库;不传时先查全局库再查各项目子库。 client:来源客户端(可选,缺省从 clientInfo 自动识别,仅审计)。 English: Read the full content of a single memory by ID; returns {"error": "NOT_FOUND"} when absent. project: search that project's sub-store first, then the global store; when omitted, global first and then each project store. client is audit-only.
| Name | Required | Description | Default |
|---|---|---|---|
| client | No | ||
| project | No | ||
| record_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does disclose meaningful behavior: the exact NOT_FOUND error shape, the store-resolution order for project lookups (project sub-store then global, vs global then each project store when omitted), and that client is audit-only and auto-detected. It stops short of stating permissions or the success payload shape.
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 core action is front-loaded and each sentence carries information, but the full Chinese/English duplication roughly doubles the length for a single-language agent, which is redundant rather than additive.
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?
No output schema exists, and the description covers the failure return and store-resolution behavior, which are the non-obvious parts. The success payload is only gestured at ('full content'), a minor gap for a read-by-ID 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?
Schema description coverage is 0%, so the description must compensate, and it explains two of three parameters well: project's lookup-order semantics and client being optional, auto-detected, and audit-only. record_id is left undefined but is self-evident from 'by ID'.
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 specific verb and resource ('Read the full content of a single memory by ID'), and the singular 'by ID' framing cleanly separates it from the sibling search_memory, which returns multiple matches. An agent can pick correctly without opening the schema.
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 'by ID' phrasing implies it is a direct-lookup tool that presupposes a known identifier, but the description never states when to prefer it over search_memory or how to obtain a record_id. Usage is inferred from context rather than stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_memoryA
混合检索记忆与知识(向量语义 + BM25 关键词,归一化融合); 返回命中列表,每项含 id/content/score/type/source。 project 指定项目子库时,检索范围 = 该项目子库 + 全局库(项目命中加分); 不传 project 时只检索全局库。 top_k 小于 1 时返回 {"error": "INVALID_ARGUMENT", "message": 原因}。 client:来源客户端(可选,缺省从 clientInfo 自动识别,仅审计)。 English: Hybrid retrieval over memories and knowledge (vector semantics + BM25 keywords, normalized fusion); returns a hit list, each item having id/content/score/type/source. With project, the scope is that project's sub-store plus the global store (project hits boosted); without project, only the global store is searched. Returns {"error": "INVALID_ARGUMENT", "message": reason} when top_k is less than 1. client: source client (optional; auto-detected from clientInfo when omitted; audit only).
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| top_k | No | ||
| client | No | ||
| project | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | 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 burden and largely meets it: it discloses the return shape (id/content/score/type/source per hit), the error contract for top_k < 1, the project-boost behavior, and that client is audit-only. It omits auth/permission requirements and any latency or rate-limit context, keeping it out of 5 territory.
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?
Content is front-loaded and each clause carries information, but the entire description is duplicated verbatim in Chinese and English, roughly doubling the length for the same payload. That redundancy is a real cost against a tight token budget even if it aids bilingual readability.
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 four-parameter retrieval tool with an output schema present, the description covers the scoping model, error behavior, and audit-only client well enough to call correctly. Since an output schema exists it need not detail return values, though it helpfully does; only query semantics and default top_k are left unaddressed.
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 0%, so the description must compensate, and it does for most parameters: project's scoping effect, top_k's validation boundary, and client's optional/auto-detected/audit-only nature. The query parameter itself is left unexplained and top_k's default (5) and result-count meaning are not spelled out, so it is strong but not complete.
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 — hybrid retrieval over memories and knowledge — and even names the retrieval mechanism (vector semantics + BM25, normalized fusion), so the agent knows exactly what operation this performs. It does not, however, differentiate itself from siblings like read_memory or ask_kb, so it falls short of a 5.
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?
Usage is implied through conditional scoping rules (with project → project sub-store + global; without project → global only), which tells the agent how the call behaves. But there is no explicit guidance on when to choose this over ask_kb or read_memory, and no exclusions stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
unlink_memoryB
取消两条记忆的关联(任一方向);relation 为空时删除该对全部关系。 返回 {"ok": true, "removed": 删除数};记录不存在返回 {"error": "NOT_FOUND"}。 English: Remove links between two memories in either direction; when relation is empty all relations of the pair are removed. Returns {"ok": true, "removed": n}.
| Name | Required | Description | Default |
|---|---|---|---|
| to_id | Yes | ||
| client | No | ||
| from_id | Yes | ||
| project | No | ||
| relation | 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 and does disclose return values and an error case ({"ok": true, "removed": n} and NOT_FOUND). However, it does not state whether unlinking is reversible, what permissions are required, or any destructive side effects beyond link removal.
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 core behavior is front-loaded, but the description is duplicated in Chinese and English, creating redundancy rather than added clarity. It remains reasonably short and does not bury the key relation-empty rule.
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 mutation tool with no annotations, no output schema, and five parameters at 0% schema coverage, the description leaves important gaps: parameter meanings for client/project/from_id/to_id, required permissions, and reversibility are absent. Return shape and NOT_FOUND are covered, but the overall definition is not complete enough for confident invocation.
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 0%, so the description must explain all five parameters, but it only clarifies relation semantics and does not explain from_id, to_id, client, or project. An agent must infer the meanings of most parameters from their names alone.
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 specific verb and resource: remove links between two memories, with scope details such as either-direction removal and clearing all relations when relation is empty. This clearly distinguishes it from the sibling link_memory tool.
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?
Provides implied usage guidance by explaining that an empty relation removes all relations for the pair, but it does not explicitly compare when to use this tool versus link_memory or list_links, nor does it state prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_memoryA
按 ID 更新记忆内容(变更后自动重新嵌入);记录不存在返回 {"error": "NOT_FOUND"}; 内容为空串或纯空白时返回 {"error": "INVALID_ARGUMENT", "message": 原因}。 project:先查该项目子库,再查全局库;不传时先查全局库再查各项目子库。 client:来源客户端(可选,缺省从 clientInfo 自动识别,仅审计)。 English: Update a memory's content by ID (auto re-embed on change); returns {"error": "NOT_FOUND"} when absent; empty content returns {"error": "INVALID_ARGUMENT", "message": reason}. project: locate in that project's sub-store, then the global store; when omitted, global first and then each project store. client is audit-only.
| Name | Required | Description | Default |
|---|---|---|---|
| client | No | ||
| content | Yes | ||
| project | No | ||
| record_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses auto re-embedding, that an absent record returns NOT_FOUND (i.e. no upsert), that blank content yields INVALID_ARGUMENT with a reason, and the project/global store lookup order. It omits permission/auth requirements and whether other fields are preserved, keeping it below 5.
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?
Purpose is front-loaded, but the content is fully duplicated in Chinese and English, roughly doubling the length for the same information. Each individual sentence earns its place, yet the bilingual redundancy is a real efficiency cost.
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 4-parameter mutation tool with no annotations and no output schema, the description supplies the safety-relevant behavior (error codes, no-upsert, re-embed) and the resolution semantics. Auth/authorization and field-preservation behavior are the remaining gaps.
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 0%, so the description must compensate, and it covers all four parameters: content (empty/whitespace validation), record_id (lookup by ID), project (sub-store then global lookup order), and client (audit-only, auto-detected from clientInfo). Values are meaningful beyond the bare schema titles.
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 specific verb and resource ('Update a memory's content by ID') plus the key side effect ('auto re-embed on change'), which clearly separates it from read_memory, delete_memory, and search_memory. It never names a sibling explicitly, so it stops short of a 5, but an agent can pick it correctly without opening the schema.
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?
Usage is implied rather than stated: the ID-based update signals 'edit an existing record', and the project/client resolution rules tell the agent how to target the record. There is no explicit when-to-use vs write_memory alternative and no prerequisite guidance, so it remains minimum viable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
write_memoryA
写入一条记忆短文本(事实/笔记/摘要),可选标签;返回 {"id": 记录ID}。 内容为空串或纯空白时返回 {"error": "INVALID_ARGUMENT", "message": 原因}。 project 指定项目子库(空=全局库);client 仅用于审计归类(自动识别); 记录主键由服务端生成。 English: Write a memory short text (fact/note/summary) with optional tags; returns {"id": record_id}. Returns {"error": "INVALID_ARGUMENT", "message": reason} when content is empty or blank. project selects the project sub-store (empty = global); client is audit-bucketing only (auto-detected). The record primary key is generated server-side.
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| client | No | ||
| content | Yes | ||
| project | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does so well: it states the return shape ({"id": record_id}), the validation failure mode and error payload for empty/blank content, that the primary key is server-generated, and that 'client' is audit-only and auto-detected. It omits concurrency/duplicate-handling behavior, which keeps it from a 5.
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?
Core action and return value are front-loaded, and each sentence is informative. The full bilingual duplication roughly doubles the length, but the structure remains clean and non-repetitive per language.
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 4-param write tool with no annotations and no output schema, the description covers return value, error case, and all parameter roles, which is enough for correct invocation. Remaining gaps (duplicate handling, size limits on content) are minor.
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 0%, so the description must compensate, and it does: content is defined as the fact/note/summary text, project selects the sub-store with 'empty = global', client is audit-bucketing only, and tags is optional. Tags get only a bare mention, leaving room for richer semantics.
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 gives a specific verb+resource ('write a memory short text (fact/note/summary)') and scopes the content type, so an agent understands what the tool does. It does not explicitly differentiate itself from siblings like update_memory or add_document, so it stops short of a 5.
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 hints at content type (fact/note/summary) but provides no explicit when-to-use guidance, no conditions for choosing this over update_memory, add_document, or add_webpage, and no exclusions. Usage must be inferred entirely from the tool name and contents.
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.
3 tool updates
v2.2.0- Added
link_memory - Added
list_links - Added
unlink_memory
8 tool updates
- First observed
add_document - First observed
add_webpage - First observed
ask_kb - First observed
delete_memory - First observed
read_memory - First observed
search_memory - First observed
update_memory - First observed
write_memory
TDQS
Scored across 11 tools
The memory CRUD set (write/read/update/delete/search) is clearly differentiated, as are link/unlink/list_links and add_document/add_webpage. The only mild overlap is between ask_kb (RAG answer) and search_memory (raw retrieval), but their descriptions make the answer-vs-hits distinction clear.
Names follow a consistent snake_case verb_noun pattern (write_memory, read_memory, link_memory, unlink_memory, add_document, ask_kb). Minor deviation: 'write_' and 'add_' both serve creation, and list_links/ask_kb omit the 'memory' noun, but conventions remain readable.
11 tools is well within the ideal 3-15 range and each tool earns its place across distinct clusters (CRUD, linking, ingestion, retrieval/Q&A). No redundant or trivial tools.
Core lifecycle is covered: full memory CRUD plus search, complete link/unlink/list linking, document and webpage ingestion, and RAG Q&A. Minor gaps exist (e.g. no listing/browsing of all memories, no bulk or tag-based management, no document update/re-ingest), but agents can work around these via search.
Maintenance
Related MCP Connectors
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Related MCP Servers
- AlicenseAqualityAmaintenancePersistent memory MCP server for AI coding agents (Claude Code, Codex, Gemini CLI). Hybrid retrieval (vector + BM25), cross-encoder reranking, knowledge graph, session checkpoint/resume, and multi-scope isolation. Local-first with LanceDB.3050 npm15MIT
- AlicenseAqualityAmaintenanceDurable hybrid memory for AI agents. Combines vector search, BM25, temporal retrieval, and optional Memgraph knowledge graph via reciprocal rank fusion. 6 MCP tools: health, search, answer, feedback, graph_query, graph_add_triple. Self-hosted with Qdrant backend.7278 PyPI9Apache 2.0
- FlicenseNot gradedqualityDmaintenancePersistent semantic memory MCP server for AI agents with hybrid search, LLM scoring, and decay engine, fully local.2-
- AlicenseNot gradedqualityDmaintenanceMCP server that enables persistent, hybrid, local memory for LLM agents, with vector + BM25 search, knowledge graph, and policy-driven retention, providing token-budgeted context injection for AI assistants.MIT