Skip to content
398894496-archPublic

About

Give your agent a subconscious: mention it and it comes to mind, with what is connected to it, and the lessons carry over. Local plain-Markdown memory for Claude Code, Codex, Cursor and any MCP app. Every answer cites its page. No API key, no server.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

79 stars

Watchers

0 watching

Forks

Latest commit

 

History

545 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.0 Hindsight (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 0 the same: 48 / 48, 24 / 24, 0
Prompt tokens a message, same host 3,265 – 4,445 13,611 – 14,511
Of 48 messages that have nothing to do with the memory, how many it touched 13 – 14 48
LongMemEval (Hindsight's own benchmark), 100 held-out questions, same reader, judged blind by Claude Sonnet 5.5 (set 59) 89 / 100 90 / 100 — no difference shown, paired 95% CI [−7, +5]
Model tokens spent writing the memory 0 about 16,500 a session (99 million for set 59)

Read with: the host for the first rows is deepseek-flash; set 59's reader is deepseek-flash, so its accuracy is not comparable with any published chart; 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). Whether 3.0's semantic recall beats plain keyword search at the same page count is still running (set 57 A); until it says so, the honest line is the old one: retrieval is level with BM25. 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. 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; 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.

Works with

App How it connects
Claude Code plugin (session hooks, the per-message layer included) and MCP
Codex MCP and session hooks, the per-message layer included
Cursor rule, skill, MCP and session hooks; no per-message layer (its hook cannot add context)
Claude Desktop double-click KRouter.mcpb
DeepSeek Harness, Hermes, OpenClaw, VS Code, Copilot CLI, Gemini CLI, Kiro, Zed, Cline CLI plugin, skill folder or MCP, written by the installer
LangGraph, LlamaIndex, LangChain and other frameworks; your own code docs/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.
  • Retrieval is level with BM25 at the same page count on LongMemEval (set 55); 3.0's semantic recall against BM25 is being measured (set 57 A).
  • 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 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

About

Give your agent a subconscious: mention it and it comes to mind, with what is connected to it, and the lessons carry over. Local plain-Markdown memory for Claude Code, Codex, Cursor and any MCP app. Every answer cites its page. No API key, no server.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

79 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages