398894496-arch/KRouter ↗★ 44

dsh-krouter

为编程 Agent 提供免维护的本地知识库路由 适合使用 Cursor/Claude Code 且需精准检索 Obsidian 的用户。

套件
dsh-krouter
相容性
待驗證
Harness 依賴範圍
*
Cordis 依賴範圍
*
版本
1.0.2
授權
MIT
最近更新
2026年10月12日

同名套件的其他儲存庫

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:398894496-arch/KRouter

KRouter

Your coding agents remember what you decided — and what you changed your mind about.

Claude Code, Codex, Cursor and DeepSeek Harness share one memory: a folder of plain Markdown in Obsidian that you can read and edit. Ask "how did we decide to ship?" and the agent answers with the page it came from. A correction replaces the old answer instead of competing with it. When the vault does not know, the agent is told so, rather than handed something close.

ci release license · 中文:README.zh.md

Monday we decide A, Wednesday we change it to B, Thursday the agent answers B and cites the correction; a question the vault cannot answer is refused

Install

curl -fsSL https://raw.githubusercontent.com/398894496-arch/KRouter/main/scripts/bootstrap.sh | sh

Windows (PowerShell): irm https://raw.githubusercontent.com/398894496-arch/KRouter/main/scripts/bootstrap.ps1 | iex · Claude Code plugin: /plugin install krouter --marketplace 398894496-arch/KRouter (Claude Code 2.1.275 or later; from a shell, claude plugin install krouter --marketplace 398894496-arch/KRouter needs 2.1.292). Third-party marketplaces do not auto-update: run claude plugin update krouter@krouter, or turn it on in /plugin → Marketplaces → krouter → Enable auto-update.

Python 3 is the only requirement. The installer makes a vault (or uses yours with --vault, overwriting nothing), connects Claude Code and Codex to it through MCP, and then asks you two questions.

Five minutes later

  1. "Import the agent sessions already on this machine?" On a yes, the last 7 days of Claude Code and Codex sessions become pages, one per session: your questions and each turn's closing answer. Key-shaped text is redacted first, and nothing leaves the machine.
  2. "Have your model pull out what was decided?" On a yes, the model you already use (a logged-in CLI or an API key) writes "what was decided, what changed" at the top of each recent session's page. The installer tells you how many characters that sends before it sends anything.
  3. Ask your agent: "what did we decide about X last week?" It answers from the vault, names the page, and says plainly when the vault has nothing on it.

From then on a nightly job, which also asks first, imports yesterday, distills it, and keeps the vault tidy. Nothing needs maintaining.

How it is different

KRouterTypical agent memory
Where memory livesMarkdown pages you can open, edit, diff and syncA database or vector store
After a correctionThe new page replaces the old one, which is marked supersededOld and new chunks both match; you hope the right one wins
When nothing matchesrecall: none — the agent says the vault does not knowThe nearest chunk, presented with confidence
Every answerCarries its source page and a receiptUsually unsourced
Who shares itOne vault for every agent on the machine (MCP, skill, rules)Usually one tool

Coming from claude-mem? Keep it. The importer has been run end to end against a live claude-mem 13.35.0 install. The installer finds its memory and offers to import it: session summaries become pages, and each project's decisions become one page you confirm. Your model can then sort those decisions into the ones still in force and the ones a later decision replaced, which claude-mem itself does not do. The Claude Code plugin also does what makes claude-mem feel like memory, in plain Markdown: when a session ends it is recorded, and when a new one starts, this repository's confirmed decisions and recent corrections come with it, each naming its page. Repositories are told apart by their path, never by folder name. Both happen only after you said yes to importing.

What leaves your machine

Queries never do: lookup is a local SQLite full-text index, about 110 ms. Session import is local. Text goes to a model only for the steps you said yes to: distilling sessions and nightly upkeep. It goes to the CLI or API key you already use, and --dry-run shows the size first. Keys and pages marked secret are never sent or quoted. Details: SECURITY.md.

Honest numbers

MeasuredResult
Refuses instead of guessing (public benches, CI)Off-topic questions refused 12/12 (English) and 6/6 (Chinese)
Wrong citations on questions it was never tuned on (memory honesty bench, 25 held-out questions)KRouter 25%; basic-memory 60%, claude-mem 60%, plain full-text search 61%. Neighbour questions refused: 8 / 10 vs 0, 0 and 1. The cost: of 15 answerable questions KRouter got 9 right, basic-memory and claude-mem 10, full-text search 9
Exact match vs embeddings on a supersede / neighbor set (CI)Exact match refuses where TF-IDF, MiniLM and BGE-M3 cite a neighbor
Real traffic, author's vault0.62 → 1.47 of 2, blind-judged. This is a development set: on held-out questions the gain is flat. A blind test on fresh traffic runs 2026-10-16

Methods and what still fails: docs/VERIFY.md.

More

Formerly DSH-KRouter. Old links, clone URLs and install lines still redirect. MIT.