跳到正文
FunCoding

KRouter

官方 MCP Registry 已收录

Plain-Markdown memory for your AI: every answer cites its page, and it says when it does not know.

Star
79
版本
v2.1.2
许可证
MIT
最近提交
2026年12月1日

KRouter

Your coding agent's subconscious: mention something you settled before, and it comes to mind.

Local, plain-Markdown memory for Claude Code, Codex, Cursor and any MCP app. Every answer names the page it came from; when the memory has nothing, it says so. No API key, no server, and it calls no model to write or to look things up.

You: Going to move the clippings originals into the archive folder this afternoon.

Agent: That note says not to move the Clippings originals (from your "User preferences" page under 02 Methods/Agent), so I'd hold off. If you meant a copy, tell me and we can sort out a safe way.

You: The coffee machine on our floor is broken again.

Agent: Sorry to hear that. I can help you draft a quick message to facilities if you'd like.

You mentioned it in passing; KRouter recognised a rule you had settled and handed the agent that page. The second remark touches nothing in the memory, so nothing was added. (Real replies, Claude Sonnet 5.5, 2026-11-10; what the agent was handed.)

Measured against the field's leader

Every number below was registered before it was run, on questions never used to tune anything (HELDOUT.md), one run each.

KRouter 3.0Hindsight (its defaults)
The subconscious: 120 spoken-style messages, 48 of them mention a settled rule (set 57 B, 58)right rule 47–48 of 48; changed rules 24 / 24; a replaced rule stated as current 0the same: 48 / 48, 24 / 24, 0
Prompt tokens a message, same host3,265 – 4,44513,611 – 14,511
Of 48 messages that have nothing to do with the memory, how many it touched13 – 1448
LongMemEval (Hindsight's own benchmark), 100 held-out questions, same reader, judged blind by Claude Sonnet 5.5 (set 59)89 / 10090 / 100 — no difference shown, paired 95% CI [−7, +5]
Model tokens spent writing the memory0about 16,500 a session (99 million for set 59)

Read with: the host for the first rows is deepseek-flash, and so is the model that judged their replies; set 59's reader is deepseek-flash, and its answers were judged twice, by Sonnet and by deepseek-flash, which agree on 198 of 200 verdicts (88 vs 89 by the second judge); its accuracy is not comparable with any published chart; set 45's messages were written by Claude, not by a person; Hindsight ran with its default English embedding model on messages half in Chinese; on LongMemEval the reader read more tokens from KRouter's pages (15,716 a question) than from Hindsight's memories (6,744). Retrieval on LongMemEval's held-out half, no model (set 57 A): the default lookup hands over every session the answer needs for 218 of 235 questions, plain BM25 given as many sessions 202 (+16, paired 95% CI [+6, +26]); semantic recall's own gain over the 2.3 engine (212, +6 [−1, +13]) missed its registered line. Answer accuracy at the same page count was level with BM25 (set 55); following the vault's connections is where KRouter brings more (set 18, below). Help us check all of this on your own machine: issue #115.

Install

curl -fsSL https://github.com/398894496-arch/KRouter/releases/latest/download/bootstrap.sh -o /tmp/krouter-install.sh && sh /tmp/krouter-install.sh
~/.dsh-krouter/current/scripts/krouter doctor                                  # OK, or what is missing and how to fix it
~/.dsh-krouter/current/scripts/krouter search "what did we decide about X?"    # your first question

It asks nothing and connects the AI apps it finds. An existing folder keeps every file, and uninstalling never touches your memory. Windows, the Claude Code plugin, --minimal, every file it changes: docs/INSTALL.md.

New in 3.0, optional: semantic recall. One command adds a local embedding model and a reranker (about 600 MB), fetched from whichever of HuggingFace and ModelScope is faster here and checked by sha256:

python3 ~/.agents/skills/krouter/scripts/semantic.py setup /path/to/your/vault

From then on the hooks, lookups and MCP server use them by themselves; a page asked about in other words is found. semantic.py setup runs for real in CI on Linux, macOS and Windows: both models downloaded and checked, then a lookup with them. The refusal still weighs your words only, so a near match never turns "not in the memory" into an answer.

See it in a few seconds, nothing installed, no key:

uvx --from git+https://github.com/398894496-arch/KRouter krouter demo      # or, in a clone: PYTHONPATH=sdk python3 -m krouter.cli demo

How it works

  • Each message, the prompt hook looks the message up on your machine. It hands the agent a page when the message names it or clearly matches it, or, with semantic recall installed, when the reranker is confident it is about that page even in other words (new in 3.1, set 60: twice as many spoken mentions brought by the hook itself on held-out messages, no wrong page); otherwise a few page names, and the agent decides whether to look; for an unrelated message, nothing. That is why it costs a quarter of the tokens of injecting memories into every message.
  • Each session, an index of what has been settled goes in front of the agent.
  • Writing down happens without you: every turn is recorded locally when it ends, with no model. Distilling those records into pages runs at night with a model you agree to once, with a source for every line, as provisional pages you can review and revert. The agent is not left to write into your memory mid-conversation, so a guess never becomes a rule.
  • A changed mind replaces the old answer instead of competing with it; the replaced page stays, marked.
  • You can see all of it: the memory is a folder of Markdown you open in Obsidian or any editor; krouter why and krouter view show what it holds and why it answered.

With what is connected to it

A lookup brings five pages: three that match, then up to two that your vault itself connects to them: a link, a replacement, the same session, rare words they share, being cited together. It is a walk over the vault's own graph, with no model and no graph database to keep. On LongMemEval's held-out half, five pages each, it brings every session the answer needs for 210 of 235 questions; plain BM25 at the same five pages, 198; on questions that span several sessions, 40 against 31 (set 18).

Works with

AppHow it connects
Claude Codeplugin (session hooks, the per-message layer included) and MCP
CodexMCP and session hooks, the per-message layer included
Cursorrule, skill, MCP and session hooks; no per-message layer (its hook cannot add context)
Claude Desktopdouble-click KRouter.mcpb
DeepSeek Harness, Hermes, OpenClaw, VS Code, Copilot CLI, Gemini CLI, Kiro, Zed, Cline CLIplugin, skill folder or MCP, written by the installer
LangGraph, LlamaIndex, LangChain and other frameworks; your own codedocs/FRAMEWORKS.md, a Python package and a JavaScript client

Any other app that runs a local MCP server:

{ "mcpServers": { "krouter": { "command": "python3",
    "args": ["/Users/you/.agents/skills/krouter/scripts/mcp_server.py"] } } }

In the official MCP Registry as io.github.398894496-arch/krouter. What each app was tested on: docs/OVERVIEW.md.

It is also your knowledge base

Folders you declare in krouter-kb.txt (and the clippings it recognises) are reference material: listed apart in the answer and never counted as what you decided. krouter kb import brings in PDF, Word and HTML with tools already on your machine. Details.

For a team

An experimental self-hosted server holds several separate memories, each with its own token (docs/TEAM.md). Tested on one machine only.

From your own code

pip install krouter-memory gives the krouter command and a Python package; a dependency-free JavaScript client is in sdk/js. docs/FRAMEWORKS.md.

See what it remembers

krouter view opens a local, read-only page of what the memory holds and how pages connect; krouter why "<question>" explains one answer. Details.

What leaves your machine

Lookups, hooks, semantic recall and the MCP server send nothing anywhere. Only the optional nightly distilling and the optional team server talk to anything else, and only after you turn them on. SECURITY.md.

What it does not do

  • One maintainer, about 80 stars, three months old: the main risk in adopting it. The team server and the Kubernetes and systemd files have not run on a real cluster.
  • On LongMemEval, answer accuracy at the same page count is no different from BM25's (set 55); the lead is in which sessions are handed over (218 against 202 of 235, set 57 A), most of it from following the vault's connections (set 18). Semantic recall's own gain over the 2.3 engine on held-out data (+6 of 235) missed its registered line.
  • Semantic recall makes a lookup slower: about 3.8 s in the resident MCP server on an 8 GB M2 (0.2 s without it), and each message's hook 4.6–5.4 s instead of 1.2–1.9 s (KROUTER_HOOK_RERANKED=0 for the old speed); the first embedding of a large vault takes an hour or more on a CPU.
  • On Cursor there is no per-message layer.
  • The benchmarks are ours: registered before each run and reproducible, but no third party has rerun them yet (issue #115).

Measured, not claimed

Every benchmark, its registration and its log: bench/memory_honesty/HELDOUT.md; the numbers in one place: docs/NUMBERS.md; what is and is not tested now: docs/STATUS.md.

Check it yourself

Each set's script and command are in its registration; docs/VERIFY.md walks through rerunning them, and issue #115 collects outside results.

More

docs/README-FULL.md (the full 2.3 front page: every earlier number and caveat) · docs/DETAILS.md · docs/COMPARE-ALL.md · docs/INSTALL.md · CHANGELOG.md · SECURITY.md · 中文 · MIT

同类 MCP Server

OpenWork MCP Gateway

Your OpenWork org's skills, plugins, workflows, and connections through one OAuth MCP URL.

DIdifferent-ai/openwork25k近 7 天新增 51 个 star

fastapi_mcp

Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!

TAtadata-org/fastapi_mcp12k

agentgateway

Next Generation Agentic Proxy for AI Agents and MCP servers

AGagentgateway/agentgateway6.5k近 7 天新增 160 个 star

精选

mcp-context-forge

把 MCP、A2A 和 REST 接口汇总到一个入口,集中管理。

IBIBM/mcp-context-forge4.9k近 7 天新增 41 个 star

精选

FreeCAD MCP

创建编辑 3D 模型,运行 Python 脚本,进行 FEM 分析。

NEneka-nat/freecad-mcp3.5k近 7 天新增 88 个 star