
快速混合代码搜索代理。纯Go,可直接插入MCP,兼容Semble。
概览
纯Go,单静态二进制,直接插入MCP,兼容MinishLab/semble——工具模式相同,输出格式相同,安装步骤切换到Go二进制文件。 ken 是 semble 的 Go 移植版:BM25 词汇 + Model2Vec 语义嵌入 + RRF 融合 + 一个代码感知的重新排序器,检索算法从 semble 的 search.py + ranking/*.py 移植而来。 - ——在semble的1,251查询基准测试中,对比grep的~99.9%——而代理的成本高于grep + read(NL查询中中位数token为4,120,对比NL查询的189,773个中位数令牌——在相同默认混合模式下测量)。对于“找到回答此问题的区块”,在接近校验召回时,token的优势是1到2个数量级的胜利。(重现:docs/BENCH.md。)- 纯Go,无cgo,冷启动时无Python解释器,索引时无GIL。免费交叉编译至Linux / macOS / Windows(amd64/arm64)。- 相同的搜索/find_related MCP工具模式和相同的markdown字符串线格式——交换命令:path,现有代理保持不变。
概述(AI 翻译)
快速混合代码搜索代理。 纯Go,单静态二进制,直接插入MCP,兼容MinishLab/semble——工具模式相同,输出格式相同,安装步骤切换到Go二进制文件。
ken 是 semble 的 Go 移植版:BM25 词汇 + Model2Vec 语义嵌入 + RRF 融合 + 代码感知的重新排序器,检索算法是从 semble 的 search.py + ranking/*.py 逐字移植而来。
为什么是肯
- ~97% recall@10默认(混合)模式 — 在 semble 的 1,251 查询基准测试中为 0.967 NL / 0.995 符号**,而 grep 为 ~99.9% — 同时使代理花费的token数**~46×比
grep + Read少(NL 查询中为4,120对189,773个中位数标记——在同一默认混合模式下测量)。对于“找到回答此问题的区块”,在接近奇偶校验召回时,token的优势是1到2个数量级。(重现:docs/BENCH.md。) - 单静态二进制。 纯 Go,无 cgo,冷启动无 Python 解释器,索引无 GIL。免费交叉编译至 Linux / macOS / Windows(amd64/arm64)。
- semble 的直接插入。 相同的
search/ [find_relatedMCP 工具模式和相同的标记字串线路格式——交换command:路径,现有代理保持不变。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
ken
ken is code search built for coding agents: a pure-Go, single-binary engine that runs a 16M-parameter Model2Vec model in-process, with no cgo, Python, vector database, or API key. On ContextBench (53 SWE-bench Pro tasks, 8k-token budget), its default hybrid mode covered 52% of the relevant files versus 29% for BM25 alone, and on tasks where a gold line was retrieved reached the first gold line in about 40% fewer tokens. Warm queries take a millisecond or two, and with KEN_ANN=flat-i8 the watched dense vector store uses about 80% less memory.
Fast hybrid code search for agents. Pure Go, single static binary, drop-in MCP-compatible with MinishLab/semble — same tool schemas, same output format, install steps swapped to a Go binary.
ken is a Go port of semble: BM25 lexical + Model2Vec semantic embeddings + RRF fusion + a code-aware reranker, with the retrieval algorithm ported verbatim from semble’s search.py + ranking/*.py.
Why ken
- ~97% recall@10 in the default (hybrid) mode — 0.967 NL / 0.995 symbol on semble’s 1,251-query benchmark, vs grep’s ~99.9% — while costing an agent ~46× fewer tokens than
grep + Read(4,120 vs 189,773 median tokens on NL queries — measured in the same default hybrid mode). For “find the chunk that answers this,” that’s a 1–2 order-of-magnitude token win at near-parity recall. (Reproduce:docs/BENCH.md.) - Single static binary. Pure Go, no cgo, no Python interpreter on cold start, no GIL on indexing. Cross-compiles to Linux / macOS / Windows (amd64/arm64) for free.
- Drop-in for semble. Same
search/find_relatedMCP tool schemas and the same markdown-string wire format — swap thecommand:path and existing agents work unchanged. - Local, CPU-only. Embedding inference, BM25, and fusion all run on the CPU. No API keys, no GPU, no vector DB, air-gapped friendly.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
// ~/.cursor/mcp.json (or .cursor/mcp.json) — also .vscode/mcp.json with "servers"
{ "mcpServers": { "ken": { "command": "/absolute/path/to/ken-mcp" } } }