Skip to main content
Glama

rag-kb — 本地 Agent 记忆与知识服务

License: Apache-2.0 Glama MCP score 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 分文件);用户可查:REST GET /api/v1/audit?client=<客户端>[&project=<项目>] 或 CLI kb 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/macOS source 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,模型加载失败时 写/查请求返回 503 EMBED_MODEL_UNAVAILABLE(含模型名与修复建议),不再裸 500。

CPU 即可运行,不占显卡:Windows / macOS 安装默认使用 CPU 版 torch; Linux 按上面的命令先装 CPU 轮子即可,无独立显卡的机器也能完整使用。 有显卡想加速(大库、批量入库)可另装 CUDA 版 torch 后显式 KB_DEVICE=cuda。

LLM 默认关闭(KB_LLM_MODE=off):服务启动不会探测/加载/调用任何大模型, 零显存、零成本、纯离线;记忆写入、文档入库、混合检索完整可用。 需要 RAG 问答(/ask)时再按下面方式配置本地或云端 LLM。

嵌入模型怎么选

默认用轻量模型,是为了让"先试试"的成本足够低;模型不强绑定,可随时按需切换:

模型

体积

维度

加载后常驻内存

适用

BAAI/bge-small-zh-v1.5(默认)

约 92 MB

512

约 100 MB 量级

日常偏好/决策/笔记类记忆;CPU 上也快

BAAI/bge-m3

约 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(不加载不调用);四个档位:

档位

行为

off(默认)

完全不加载/不调用 LLM;记忆存取与检索完整可用

local

仅本地 Ollama(完全离线,隐私零出网)

auto

本地优先,云端降级:本地 Ollama 可用走本地,无本地但有云端 Key 走云端

cloud

全部走云端(本地仅做压缩与隐私隔离)

本地 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), 让它们知道怎么读写记忆、按什么身份规约、怎么查审计。两种方式,任选其一:

  1. skill(推荐,能自动触发)——可选的独立步骤:仓库内 skills/kb-memory/SKILL.md 是客户端无关的 Anthropic 开格式 skill。把它安装到你所用客户端的用户级 skills 目录后, 该客户端的任何项目会话都会在读写记忆/RAG 问答/审计查询时自动识别并触发。 安装 = 把 skills/kb-memory 目录复制过去即可(有脚本,也可手动复制,无需任何依赖); 更新(重新覆盖)、卸载、以及装好后的使用说明见 scripts/README.md。

    不装也不影响 kb 服务:skill 只是给 AI 客户端的「提示词包装」,与服务的安装、 启动无关——跳过这一步,服务照常运行,你随时可用方法 2 的纯文本提示词接入; skill 安装是一次性、按需、独立执行的,不会随 kb serve 自动触发, 也不会写入你的任何客户端目录以外的文件。

  2. 纯文本提示词(兜底,任何客户端通用):整段复制 docs/AGENT_PROMPT.md 粘贴给 Agent 即可,不依赖 skill 机制。

.trae-cn/skills / .claude/skills / .cursor/skills 是任何客户端都认的「标准」吗?——不是。 这些只是各家客户端各自的用户级约定目录:SKILL.md 本身是统一的 Anthropic 开格式, 但「装到哪个目录、能否自动触发」由各客户端自行决定,支持程度不一:

客户端

用户级 skills 目录

自动加载

TraeWork

~/.trae-cn/skills/

自动发现

Claude Code

~/.claude/skills/

高版本支持

Cursor

~/.cursor/skills/

逐步跟进

其他 / 自建 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-<版本>.zip

zip 内 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

/api/v1/memories

写入记忆 {content, tags?, source?, namespace?}

GET

/api/v1/memories

记忆列表,支持 type/tag/source/q/limit/offset 过滤

GET

/api/v1/memories/{id}

读取单条记忆

PATCH

/api/v1/memories/{id}

更新内容或标签

DELETE

/api/v1/memories/{id}

删除单条记忆

POST

/api/v1/memories/{id}/links

建立记忆关联 {to_id, relation?};relation: related/supersedes/depends_on/part_of/contradicts

GET

/api/v1/memories/{id}/links

列一跳关联(含内容/方向;?project=&relation=)

DELETE

/api/v1/memories/{id}/links/{to_id}

取消关联(任一方向;删除后同步清理)

POST

/api/v1/search

混合检索 {query, top_k?, mode?, type?, tag?},mode: hybrid/vector/keyword

POST

/api/v1/documents

文档入库:multipart file 字段或 JSON {"path": "本地路径"}

GET

/api/v1/documents

已入库文档列表(按 source 聚合)

DELETE

/api/v1/documents/{source}

按 source 删除该文档全部记录(本地文件名等简单 source)

DELETE

/api/v1/documents?source=<urlencoded>

按查询参数删除(URL 等含斜杠的 source 必须用这个)

POST

/api/v1/ingest/web

网页入库 {url},抓取正文切分入库;同 URL 重复入库自动替换旧记录

POST

/api/v1/ask

RAG 问答 {question};未配置 LLM 返回 503

GET

/api/v1/healthz

健康检查与服务统计(含 embedder 状态)

GET

/api/v1/governance/stats

记忆治理统计:total_count/avg_access_count/stale_90d_count(只读)

GET

/api/v1/governance/config

治理配置:衰减+新鲜度开关与参数(只读)

POST

/api/v1/memories → 409

启用语义去重(KB_DEDUP_ENABLED=true)后写入命中重复返回 409:{"error":"DUPLICATE","duplicate_of":"<已有记录id>","similarity":<相似度>}(不写入)

记忆关联默认启用一跳检索扩展:命中的 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 Delete

Linux / 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,真实密钥只放本机,严禁入库)。

配置项

默认值

说明

KB_LLM_MODE

off

LLM 模式:off(默认,不加载/不调用 LLM,零显存零成本)/ local(仅本地 Ollama)/ auto(本地优先,云端降级)/ cloud

KB_DEVICE

空

嵌入模型设备:空或 auto=自动检测(非交互启动回退 cpu),可显式设 cpu / cuda

KB_WATCH_DIR

data

serve 模式监听目录,文件变动自动入库;空串或 . = 不启动

KB_DATA_DIR

kb_data

运行数据根目录(ChromaDB、运行时状态等)

KB_API_HOST / KB_API_PORT

127.0.0.1 / 8000

REST 与 MCP 监听地址

KB_EMBED_MODEL

BAAI/bge-small-zh-v1.5

嵌入模型(轻量默认,约 92 MB);可换 BAAI/bge-m3(约 2.2 GB,更强),见「嵌入模型怎么选」

KB_TORCH_THREADS / KB_EMBED_BATCH_SIZE

0 / 32

低配 CPU 调优:线程数 0=自动(按 cgroup/affinity,最多 4);2G 内存可把批大小降到 8–16

KB_IDLE_UNLOAD_SECONDS

600

嵌入模型空闲 N 秒后卸载;0=不卸载

KB_LLM_MODEL

空

本地 Ollama 模型名(默认空=不配;配 KB_LLM_MODE=local/auto 时须按自己电脑选模型,以 ollama list 为准)

KB_OLLAMA_BASE_URL

http://localhost:11434

Ollama 端点

KB_LLM_API_KEY / KB_LLM_BASE_URL / KB_LLM_CLOUD_MODEL

空

云端 LLM(可选):任意 OpenAI 兼容服务商(DeepSeek / OpenAI / 通义 / 硅基流动等),仅填在本机 .env

KB_CHUNK_SIZE / KB_CHUNK_OVERLAP

500 / 100

文档切分参数

KB_SENSITIVE_NAMESPACES

空

逗号分隔的敏感 namespace,命中强制本地回答不出网

KB_API_KEY

空

空=不鉴权(本地回环零摩擦);非空=启用 Bearer/X-API-Key 鉴权

KB_RERANK_ENABLED / KB_RERANK_MODEL / KB_RERANK_TOP_N

false / BAAI/bge-reranker-v2-m3 / 20

检索精排(A3.5):融合候选送 CrossEncoder 重排,默认关

KB_SPARSE_ENABLED

false

稀疏第三路(A3.5):BGE-M3 稀疏向量 + 倒排索引参与归一化加权融合,默认关

KB_LINK_EXPAND_ENABLED / KB_LINK_EXPAND_LIMIT / KB_LINK_EXPAND_SCORE_RATIO

true / 3 / 0.5

记忆关联一跳扩展:每次最多追加邻居数、邻居分数相对种子的比例

KB_LINK_MAX_PER_RECORD

50

单条记忆的关联边上限(防止单点成为巨型枢纽)

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.md

  • v2.1 设计(当前):docs/superpowers/specs/2026-10-20-kb-v2.1-design.md

  • 开发者维护手册:docs/DEV_HANDBOOK.md

Available Tools

11 tools
add_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.

NameRequiredDescriptionDefault
pathYes
clientNo
projectNo

TDQS

B3.2/5.0
Behavior3/5

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.

Conciseness3/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

NameRequiredDescriptionDefault
urlYes
clientNo
projectNo

TDQS

A3.7/5.0
Behavior4/5

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.

Conciseness3/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
clientNo
projectNo
questionYes

TDQS

A3.7/5.0
Behavior4/5

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.

Conciseness3/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
clientNo
projectNo
record_idYes

TDQS

A4/5.0
Behavior4/5

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.

Conciseness3/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

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.

NameRequiredDescriptionDefault
clientNo
projectNo
record_idYes

TDQS

A4/5.0
Behavior4/5

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.

Conciseness3/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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).

NameRequiredDescriptionDefault
queryYes
top_kNo
clientNo
projectNo

Output Schema

NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior4/5

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.

Conciseness3/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

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.

NameRequiredDescriptionDefault
clientNo
contentYes
projectNo
record_idYes

TDQS

A3.7/5.0
Behavior4/5

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.

Conciseness3/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
tagsNo
clientNo
contentYes
projectNo

TDQS

A3.6/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

  1. 3 tool updatesv2.2.0
    • Addedlink_memory
    • Addedlist_links
    • Addedunlink_memory
  2. 8 tool updates
    • First observedadd_document
    • First observedadd_webpage
    • First observedask_kb
    • First observeddelete_memory
    • First observedread_memory
    • First observedsearch_memory
    • First observedupdate_memory
    • First observedwrite_memory

TDQS

A3.7/5.0

Scored across 11 tools

Disambiguation4/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Persistent 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.
    30
    50 npm
    15
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Durable 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.
    7
    278 PyPI
    9
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP 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