khwan-mcp
Officialkhwan-mcp
能跨会话存续的持久记忆。 一个 MCP 服务器,将 Khwan——一个纯 AI 记忆层——接入 Claude Code、Claude Desktop 或任何 MCP 客户端。
Khwan 从不运行模型。客户端即模型。 它负责把重要的内容持久化并提炼成一颗大脑,让你可以在后来的会话中召回它,或用它来初始化一个子代理——这是一组紧凑、有界的事实,而不是回放的转录记录。一个账户可以拥有多个相互隔离的核心(cores,即大脑),在付费套餐中,还可以为每个最终用户提供隔离的子脑。
它如何节省 token(以及在哪些地方不节省)
对机制我们要坦诚——MCP 是向宿主上下文中添加内容,它不能替换宿主已经发送的对话记录。所以:
在一个热会话中,它并不节省 token。 Claude Code 会缓存不断增长的历史(缓存读取 ≈ 0.1×),因此每轮重新注入记忆只会增加开销。这里不要这么做。
跨会话和跨子代理时,它确实能节省。 缓存在几分钟内会失效;会话也会结束。Khwan 会持久化提炼后的事实,好让下一种运行低成本地召回它们——无需冷回放旧转录,且那些已经滚出上下文的事实可以再次被检索到。
省 token 的用法是:初始化(seed)一次,记住持久事实(见下文),而不是在缓存宿主的每一轮中都跑完整的循环。完整的 prepare → record 循环在非缓存宿主上的自定义代理中仍然大放异彩,在那里,用蒸馏后的记忆替换历史能直接约束每轮成本。
Related MCP server: memory-mcp
安装
pip install khwan-mcp # or: uvx khwan-mcp连接到 Claude Code
claude mcp add khwan --scope project \
-e KHWAN_CORE=default \
-- khwan-mcp--scope project 会把 .mcp.json 写入仓库,所以这个设置会跟着项目走。注意该命令中没有什么:密钥。
让密钥不进入仓库
claude mcp add -e KHWAN_API_KEY=… 会把字面量写入 .mcp.json——而这个文件的意义正是要被提交。有两种方式可以避免,第二种是在所有环境下都有效的方式:
Shell 环境变量。 完全不要让 KHWAN_API_KEY 出现在配置里,而是在启动 claude 的 shell 中导出它。服务器会继承它。
export KHWAN_API_KEY=kwk_live_xxx一个启动器(在桌面应用中也有效)。 桌面应用是从 Dock 或菜单启动的,而不是从登录 shell 启动的,所以它不会继承你的任何 shell 导出,上面那种方法会静默地拿不到密钥。改为从文件读取:
mkdir -p ~/.khwan && chmod 700 ~/.khwan
printf 'KHWAN_API_KEY=kwk_live_xxx\n' > ~/.khwan/env && chmod 600 ~/.khwan/env
cat > ~/.khwan/khwan-mcp <<'SH'
#!/bin/sh
set -a
[ -f "$HOME/.khwan/env" ] && . "$HOME/.khwan/env"
set +a
exec khwan-mcp "$@"
SH
chmod 700 ~/.khwan/khwan-mcp然后把配置指向这个启动器,只保留非机密设置内联:
claude mcp add khwan --scope project \
-e KHWAN_CORE=acme -e KHWAN_USER=Web \
-- ~/.khwan/khwan-mcp现在 .mcp.json 可以安全提交了,每个新仓库只需要两行职责,而不是一段粘贴的密钥。团队里的其他人写自己的 ~/.khwan/env 即可。
每个项目一个大脑
记忆只有在正确的项目记忆被取回时才有用。两个维度,它们都提供完全隔离:
项目 | 选择方式 | 成本 |
核心 |
| 占你套餐中的一个核心 |
子脑 |
| 免费——付费套餐上无限 |
子脑是一个完全独立的大脑,而不是一层过滤器:account::acme::@Web 与 account::acme::@Api 不共享任何内容。所以一个客户端如果有多个仓库,可以让它们共用一个核心、各配一个子脑,而不是每个仓库各占一个原创:
# in ~/code/acme-web
claude mcp add khwan --scope project -e KHWAN_CORE=acme -e KHWAN_USER=Web -- ~/.khwan/khwan-mcp
# in ~/code/acme-api
claude mcp add khwan --scope project -e KHWAN_CORE=acme -e KHWAN_USER=Api -- ~/.khwan/khwan-mcp核心在你指向它之前必须存在——未知核心会返回 404。请在控制台中创建。子脑会在第一次写入时自动创建。
推荐用法(省 token)
在像 Claude Code 这样的缓存主机上,优先选用 seed + remember,而不是每轮循环:
初始化(seed):在会话或子代理的开头——调用
khwan_recall(query="<the task>"),并把返回的seed_text作为上下文。记住(remember):当持久的事实浮现时——>“这是个持久决定——调用
khwan_remember(fact="…")。”
在项目的 CLAUDE.md 中强化这个做法,例如:
- At the start of a task, call `khwan_recall` to seed relevant memory.
- When a durable decision/preference/fact emerges, call `khwan_remember`.
- Don't call prepare/record every turn — it adds tokens without saving them here.初始化一个子代理是收益最明显场景:交给它的是一份有界简报,而不是整段转录:
“先用
khwan_recall(query="deploy runbook")召回部署记忆,然后生成一个子代理,子代理收到的简报就是那段seed_text外加该任务。”
连接到 Claude Desktop
Claude Desktop 与 Claude Code 使用独立的 MCP 配置——给一方添加的服务器对另一方法不可见,claude mcp add 也不会动这个文件。请添加到 claude_desktop_config.json:
{
"mcpServers": {
"khwan": {
"command": "/Users/you/.khwan/khwan-mcp",
"env": {
"KHWAN_CORE": "acme",
"KHWAN_USER": "Web"
}
}
}
}使用绝对路径:桌面应用同样不会获得你 shell 的 PATH,因此单独一个 khwan-mcp 可能无法解析。整个应用只能选一个核心——这里没有按项目切换的机制,所以选一个范围较宽的核心。
配置(环境变量)
变量 | 必需 | 用途 |
| 是 | 你从 Khwan 控制台取得的密钥( |
| 否 | 选择一个隔离的核心/大脑(默认:账户的默认核心)。 |
| 否 | 按最终用户设置隔离子脑(付费);会设置 |
| 否 | 改写 API 基地址——例如,本地引擎用 |
工具
工具 | 用途 |
| 初始化一个会话/子代理——返回综合的 |
| 持久化一条对将来会话有用的事实/偏好。 |
| 完整循环,在作答前执行——记忆上下文 + 一个 |
| 完整循环,在作答后执行——把该轮持久化,让 Khwan 学习。 |
| 查看大脑当前记得的内容。 |
| 列出账户上的隔离核心。 |
khwan_recall / khwan_remember 是缓存主机上省 token 的一对;khwan_prepare / khwan_record 是面向自定义代理的完整循环(把 prepare 返回的那个 turn_token 原样传入 record)。
返回了什么,以及空结果的含义
khwan_recall 最多返回三条事实——这个上限是服务器设定的,limit 只能调低,不能调高——另外还会有 lessons 从过去多轮中提炼出的内容。lessons 处于 seed_text 的开头:一份数月形成的规则优先于一条恰好出现在索引同一位置的单轮记录。
检索有一个相似度底限,所以 facts 为空也是答案:表明大脑里没有任何接近这个问题的东西。把它理解为“此处不存在”,而不是一次失败,并不要用“哪一条最近就补哪一条”的办法回避。
这个下限是有意放宽的,因为一条被误丢掉的内容是看不见的,而一条被误保留的内容并非看不见。所以返回的事实按理估计应当合理相关而不是必然相关——依赖之前先读它。
用已有工作初始化大脑
新大脑什么都不知道,所以头几周的召回会比较薄——而这些答案往往早已存在于宿主自己的转录中,从未被读取。
examples/backfill/ 会把 Claude Code 的转录回放到大脑中:确定性、不调用模型、默认试跑。
python3 examples/backfill/backfill_claude_code.py --map cores.json常开记忆(Claude Code hooks)
上面这些工具的调用依赖 Claude 决定调用它们时。要确定性的记忆——不依赖模型——请使用
examples/claude-code-hooks/ 中的钩子预设:一个 UserPromptSubmit 钩子会在每个提示中注入记忆,一个 Stop 钩子会记录每个回答。
⚠️ 在缓存主机上,这是“彻底”而不是“廉价”的选项——它会增加每轮 token 开销。当“召回可靠性”比“token 成本”更重要时(或者在非缓存客户端上),可选它;否则请只在会话开始时使用
khwan_recall。
源码
github.com/khwanlabs/khwan-mcp —— 这个服务器运行在你自己的机器上,使用你的密钥,读取你输入的内容。在安装之前先阅读它。
License
MIT — © Khwan Labs. See LICENSE.
Available Tools
6 toolskhwan_coresA
List the isolated cores (brains) available on this account.
Each core is a fully isolated brain — its own memory, identity and learning.
HOW A CORE IS SELECTED DEPENDS ON HOW YOU CONNECTED, and the two are not interchangeable:
stdio (this package run locally): the
KHWAN_COREenvironment variable, read once at startup. Changing it needs a restart.remote (a hosted URL): the path —
/mcp/{core}/{user}. The path asks, the token answers.KHWAN_COREdoes NOTHING here; setting it and expecting the brain to change is a silent no-op.
On a remote connection, do not advise KHWAN_CORE. To reach a different
brain, point the client at a different URL — usually by adding a second MCP
server entry for it, so each keeps its own credentials and no re-auth is
needed to switch.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | 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 so thoroughly. It discloses the startup-only read of KHWAN_CORE, the restart requirement, the silent no-op on remote connections, and the /mcp/{core}/{user} path-and-token model. This is exceptional transparency for a list tool.
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 sentence, and the bulleted structure makes the connection-mode distinctions easy to scan. The description is longer than average, but every section addresses a real behavioral pitfall or selection rule; only the mild flourish 'The path asks, the token answers' is expendable, and it is not harmful.
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 zero-parameter list tool with an output schema, this description is complete: it explains what is listed, how the result is determined, the silent-failure trap, and how to switch brains on remote connections. There are no annotation or output-format gaps that the description would need to fill.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, so there is nothing for the description to add beyond the schema. The conceptual explanation of cores is useful but is not parameter semantics; the baseline of 4 for a zero-parameter tool applies.
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 ('List') and a specific resource ('isolated cores available on this account') while also defining what a core is. The listing intent is unmistakable and distinct from the sibling tools, which all perform memory-related actions rather than enumeration.
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 clear context for how the tool's result is determined by connection mode, and gives explicit when-not guidance: on a remote connection, do not advise KHWAN_CORE and instead point the client at a different URL. It does not name sibling alternatives, but none of the siblings are listing tools, so the primary usage ambiguity is well covered.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
khwan_memoryA
Inspect what this brain currently remembers, newest first.
A DEBUGGING window on the brain, not a way to seed a session. It returns
recent entries in time order and ignores what you are working on, so it
answers "is anything in here / did that write land" — not "what is relevant
to this task". For the latter use khwan_recall, which ranks by meaning
and returns a bounded set. No model is called.
Reach for it when a recall came back empty and you want to know whether the
brain is empty or merely has nothing close, when confirming a
khwan_remember persisted, or when the user asks what Khwan knows.
Args: limit: max entries to return, newest first (default 20).
Returns: The brain's recent memory entries, in the order they were written.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully bears the responsibility of explaining behavior. It goes beyond expected by stating 'No model is called,' 'ignores what you are working on,' and positions the tool as a debugging window rather than a session-guiding tool. These details illuminate performance, context-invariance, and safety in ways annotations and schema could not.
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?
Every sentence earns its place: primary behavior, key caveat, usage contexts, args, and returns. It is concise enough to parse quickly yet complete enough to avoid misinference, and its most important disambiguation against khwan_recall appears early instead of buried at the bottom.
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 one-parameter, read-only inspection tool with an output schema present, the description covers everything needed to call correctly: order of results, context sensitivity, why to invoke it, and what it returns. The explicit when-not-to-use guidance and sibling reference make it complete in context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Because schema description coverage is 0%, the description is essential and it fully compensates. It explicitly defines limit as 'max entries to return, newest first (default 20),' adding meaningful semantics beyond the schema's bare 'Limit' integer. For a single parameter, this is 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 opening line uses a specific verb and resource: 'Inspect what this brain currently remembers, newest first.' It also explicitly distinguishes itself from khwan_recall by saying it answers 'is anything in here / did that write land', not 'what is relevant to this task.' This makes the tool's purpose unmistakable even among six siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly carves out when to use this tool vs alternatives: for khwan_recall when you need meaning-ranked, bounded results; for khwan_memory when recall came back empty or when confirming a khwan_remember write persisted. It also states clear no-seeding-a-session boundary, giving an agent decisive routing criteria beyond simple sibling overlap.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
khwan_prepareA
Pull the memory-enriched context for a turn BEFORE you answer.
Khwan builds context from memory + the brain's constitution + a coherence
gate. No model is called. Ground your reply in the returned context and
respect allowed/reason. Keep the returned turn_token and pass it
to khwan_record after you answer.
Args: input: The user's message / the turn you are about to answer.
Returns: context: ready-to-use messages (memory + constitution) to ground your reply. coherence: optional float — how coherent this turn is with the brain (may be None). allowed: whether Khwan's coherence gate permits answering. reason: why, when not allowed (else None). turn_token: opaque token — pass it verbatim to khwan_record.
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses a crucial behavioral trait: 'No model is called.' It also explains the exact output types (context, coherence, allowed, etc.), shows how the coherence gate works, and clarifies that turn_token is opaque and must be passed verbatim. This is far beyond the input schema and greatly helps an agent form correct expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is tightly structured and front-loaded: the command phrase appears first, followed by a brief explanation, then consise Args/Returns lists. There is no redundant prose or restatement of the tool name.
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 tool that has no output schema, the description fully defines the request input, the returned fields, how to react to allowed/reason, and how to continue into khwan_record. The agent has everything it needs to call and integrate the result correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema contains only a required field named 'input', with no description; the description expands it to 'the user's message / the turn you are about to answer', resolving ambiguity. The Returns section is also effectively a response contract, though not technically a parameter description. For a single-parameter tool, semantics are well covered.
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?
Description starts by stating an explicit action ('Pull') and exact timing ('BEFORE you answer') and names the core resources (memory-enriched context). It clearly separates this tool from khwan_record by establishing a prepare/record workflow, so the agent cannot confuse it with siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives direct, actionable usage: call before answering, ground the reply in context, respect allowed/reason, and pass turn_token to khwan_record afterward. It does not enumerate alternative conditions for khwan_memory or khwan_cores versus khwan_prepare, but the workflow ordering is explicit enough.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
khwan_recallA
SEED a session/subagent with a COMPACT, bounded set of relevant memories.
The token-smart entry point for a caching host (Claude Code, Claude Desktop): call it ONCE at the start of a session or subagent — or when you need a fact that has scrolled out of context — NOT on every turn. It returns only the relevant facts (not Khwan's full prepared prompt), so you seed a fresh, bounded context instead of replaying a transcript. No model is called.
Two limits are worth knowing, because neither is this tool's to set:
Three facts is the ceiling. The server ranks a wider candidate pool and keeps its top three, so
limitcan only narrow that further, never widen it. Asking for more returns three.A relevance floor applies, so an EMPTY
factsis an answer. It means the brain has nothing close to this question — read it as "not known here", not as a failure. Do not retry with a reworded query hoping for more, and do not fill the gap with whichever fact happened to be nearest.
Lessons — what synthesis distilled from many turns — come back alongside the raw exchanges and LEAD the seed text: a rule earned over months outranks any single turn that happens to sit nearby in the index.
Args: query: the task or topic to recall memory for. Phrase it as the work you are about to do, not as a keyword — it is matched on meaning. limit: cap on facts returned, 1-3. The server's own ceiling is 3, so this can only lower it. Leave it alone unless you want fewer than three.
Returns: lessons: rules synthesis distilled from many past turns. facts: [{you_said, khwan_knows}] — the relevant remembered exchanges. count: how many facts were returned. seed_text: a ready-to-drop-in memory block for a subagent's brief ("" if none).
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Even without annotations, the description discloses key behaviors: the server ranks and enforces a top-3 ceiling, a relevance floor can cause empty facts which is a valid answer, lessons lead the seed text, and no model is called. It explicitly mentions that limit can only narrow not widen, and that seed_text can be empty. This is far beyond what annotations would normally provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is longer than typical but each section earns its place: the opening sentence states purpose, the constraints are genuinely important and specific to the tool, and the returns section aligns with the schema. However, the call-to-action highlighting bold and paragraph spacing adds length; the seed_text return description is slightly redundant with 'facts' and 'lessons' in the returns listing. There is a small amount of wasted space around the returns details, but overall it is structured and scannable.
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?
Despite having no formal annotations, the description thoroughly covers when to call, what it returns, what the limits are, how to interpret empty facts, and how to phrase the query. The output schema fills in the structure details, and the description adds semantics about the returned lessons leading the seed, the count, and seed_text. For a memory tool with no annotations, this is more than complete enough for an agent to invoke it safely and effectively.
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% in this context, so the description carries the full burden. It actually does that: query is defined as a meaningful task description matched on meaning, and limit is described as a cap between 1-3 and can only narrow. That is strong semantic enrichment of the input schema. I'd give 5, but the description doesn't specify the default or required behavior of limit beyond 'leave it alone unless...'—though it implicitly references the default 3. Minor gap relative to perfect.
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 says explicitly that this tool SEEDs a session/subagent with a compact bounded set of relevant memories, names the exact resource (relevant memories/facts) and the verb (seed/recall). It distinguishes itself from siblings by positioning itself as the token-smart entry point for recall at session start, not per-turn, and by noting that no model is called. It is neither tautological nor vague.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives direct instructions: call ONCE at session start or when a fact scrolled out of context, NOT on every turn. It also explains when to avoid retrying on empty results and warns about the relevance floor. It doesn't explicitly name an alternative sibling, but it clearly defines the expected invocation context and anti-patterns, which is stronger than merely naming a sibling.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
khwan_recordA
Hand your answer back to Khwan AFTER you reply, so it persists + learns.
Args:
turn_token: the exact token returned by the matching khwan_prepare.
answer: the answer you gave the user for that turn.
Returns: Khwan's record acknowledgement (persisted state / next-turn hints).
| Name | Required | Description | Default |
|---|---|---|---|
| answer | Yes | ||
| turn_token | Yes |
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 responsibility for behavioral disclosure. It reveals that calling this tool persists state, learns, and returns next-turn prompts or an acknowledgement, which matters because this is a stateful write-like operation. It doesn't cover failure modes or idempotency, but it does address the most impactful behavior: the record affects future turns.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately short and front-loaded with the action and intent. The Args/Returns format is scannable, though the same message that the interplay between the initial sentence and the Returns line, keeping it slightly noise. Still, every sentence contributes value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (two required string parameters, no output schema), the description covers the essential context: when to call it, where the token comes from, and what the return will be. It could mention error cases or reiterating confirmation requirement more explicitly, but enough for an agent to call it correctly.
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%, yet the description adds precise meaning to both required parameters. turn_token is defined as the exact token returned by the matching khwan_prepare, and answer is identified as the actual answer given to the user for that turn—far beyond the schema's simple string types.
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 action with a clear resource: hand the answer back to Khwan AFTER replying, so that the interaction persists and Khwan learns. It also distinguishes itself from the sibling workflow by pointing back to khwan_prepare, making the tool's role in a two-step process explicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives explicit timing guidance (AFTER you reply) and explains the exact required input provenance (the token returned by khwan_prepare). This is enough for an agent to know when to call this tool versus the prepare tool, and the sentence about matching token prevents misuse.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
khwan_rememberA
Persist a durable fact/preference so FUTURE sessions can recall it.
A convenience over the prepare→record loop for the common "just remember this"
case: it stores fact in the brain (no model call) so it outlives this
session's context window and is available to the next khwan_recall.
Reach for this the moment you are corrected. A user rejecting your work, or telling you how they want it done, is the most durable thing a session produces and the easiest to lose — you fix the thing, the session ends, and the next one makes the same mistake. If the user is telling you something for the second time, the first time should have been stored here.
Write the standing RULE, not the utterance. "Deploys go to staging first, never straight to production" survives into a session that never saw the conversation; "no, not like that" does not.
Args: fact: the durable rule/preference to store, phrased to stand alone.
Returns: stored: whether the fact was persisted; reason when not.
| Name | Required | Description | Default |
|---|---|---|---|
| fact | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly states what happens inside the tool: it stores a fact, makes no model call, outlives the context window, and is later reachable via `khwan_recall`. It also describes the return shape (`stored` and `reason` when not persisted).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is front-loaded with its core purpose, then gives the strongest usage signal, then provides parameter and return semantics. Every section adds operational value; the relatively longer 'Reach for this' paragraph is justified because it tells the model exactly when to invoke the tool, not just why it exists.
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 tool has exactly one parameter and an output schema, so the required usage surface here is small. The description covers persistence semantics, return value, and a sibling relationship (`khwan_recall`). It gives the agent enough to invoke the tool correctly without needing to infer anything essential.
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%, but the description's Args section fully compensates: it defines `fact` as a durable rule or preference that must stand alone. It reinforces the meaning with a concrete example contrasting a standalone rule with an unusable utterance. This is ample semantic guidance for a single string parameter.
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 is centered on a specific verb and resource: "Persist a durable fact/preference" so future sessions can recall it, and it explicitly says it stores `fact` in the brain with no model call. It distinguishes itself from the prepare→record loop and states it is available to the next `khwan_recall`, which removes ambiguity versus siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives a very explicit usage trigger: "Reach for this the moment you are corrected." It also contrasts this tool with the more elaborate prepare→record loop, and the 'standing RULE, not the utterance' guidance tells the agent how to phrase the fact. This is far more than a generic call-to-action.
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.
6 tool updates
v0.3.5- First observed
khwan_cores - First observed
khwan_memory - First observed
khwan_prepare - First observed
khwan_recall - First observed
khwan_record - First observed
khwan_remember
TDQS
Scored across 6 tools
The tools split into two semantically overlapping pairs—prepare/recall for retrieval and record/remember for persistence—but the descriptions clearly separate turn-by-turn context from session seeding, and structured recording from standalone fact storage. khwan_memory and khwan_cores are unambiguous. An agent must read carefully, but misselection risk is low.
All tools share the khwan_ prefix and use lowercase snake_case, with most names being imperative verbs: prepare, record, recall, remember. khwan_memory and khwan_cores break the verb pattern by being plain nouns, making the set slightly inconsistent but still readable and predictable.
Six tools is a well-scoped size for a memory/context server: two for the turn loop, one for session seeding, one for direct persistence, one for debugging, and one for core isolation. Each tool has a clear job and none feels redundant.
The core memory lifecycle is covered: prepare/record for turns, remember for durable facts, recall for retrieval, and memory for inspection. However, there is no explicit forget/update or memory-editing tool, which is a notable gap for a persistent brain, though it does not break the main workflows.
Maintenance
Related MCP Connectors
Persistent memory for AI agents to retain, retrieve, and recall conversation context through MCP.
Persistent personal memory for AI assistants — save, search, and recall across every MCP client.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
- KogniteOAuthdev.kognite
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceEnables persistent memory storage and retrieval for MCP clients, allowing AI assistants to remember facts and context across conversations.21 npmMIT- AlicenseAqualityDmaintenanceProvides persistent memory for AI assistants via MCP, enabling them to store and recall facts, preferences, and tasks across conversations using either local file storage or a cloud backend with semantic search.57 npmMIT
- AlicenseNot gradedqualityAmaintenanceProvides AI agents with persistent, human-like memory infrastructure via MCP, enabling them to store, search, summarize, and forget episodic, semantic, procedural, and working memories across sessions.1,237 npmMIT
- AlicenseAqualityBmaintenanceEnables AI agents to persist memory across sessions through MCP, supporting semantic retrieval, source-backed context, knowledge graph relationships, supersession lineage, and topic digests.431MIT