档案库 · 开发与企业工具 · 技术决策 · 2024–2026
Semble押注静态嵌入加BM25能胜过grep,为编码代理节省99%的令牌
MinishLab的Semble为编码代理提供CPU代码搜索——Model2Vec静态嵌入加BM25在质量上媲美transformer,同时比grep加读取节省约99%的令牌。
Semble (MinishLab)
做的是什么生意
Semble is an open-source code-search library and MCP server for coding agents (Claude Code, Cursor, Codex, OpenCode): it indexes a repo on demand and returns the exact relevant code snippets in milliseconds, running entirely on CPU with no API keys, GPU or external services.
起因
Stephan Tulkens and Thomas van Dongen built MinishLab's Model2Vec in 2024, a method that distills sentence transformers into small static embeddings. Using their own Claude Code sessions on large codebases, they kept hitting the same wall: when the agent could not find something directly, it fell back to grep, read whole files or spawned subagents — burning tokens and still missing relevant code. Existing retrieval tools were either too slow to index on demand, needed API keys, or had poor quality, so in early 2026 they started building Semble.
经过
Semble was open-sourced in spring 2026 (an initial Show HN ran 2026-04-26; the main one, 2026-05-17, drew 445 points and 151 comments). It combines potion-code-16M static embeddings with BM25, fuses them via RRF, and reranks with code-aware signals like definition boosts and test-file penalties. On their benchmark of ~1,250 query/document pairs across 63 repos and 19 languages it scored 0.854 NDCG@10 — about 99% of a 137M-parameter code transformer — at roughly 200x faster indexing, all on CPU. The README's telemetry shows the bet landing: 14.3k search calls and ~714.2M tokens saved as of September 2026.
还没有结局,它还在跑。
背景
Semble是一个开源代码搜索库和MCP服务器,由Model2Vec背后的两人研究团队MinishLab构建。它回答针对代码库的自然语言查询——"认证是如何处理的?"——并在毫秒内返回相关片段,完全在CPU上运行,无需API密钥、GPU或外部服务。其目标用户是编码代理:Claude Code、Cursor、Codex和OpenCode。
这个赌注是代理在简单的探索上浪费大量令牌。当Claude Code无法找到东西时,它回退到grep、读取整个文件或生成子代理。Semble结合1600万参数的静态嵌入模型(potion-code-16M)和BM25,通过倒数排名融合(RRF)融合排名,并用代码感知信号重新排序。在其基准测试中,跨越63个仓库和19种语言的约1,250个查询,达到0.854 NDCG@10——大约是137M参数transformer的99%——索引速度快约200倍,令牌消耗比grep+读取少约99%。
该发布在2026-05-17在Hacker News上获得445分和151条评论,项目持续增长:README内置的节省遥测截至2026年9月记录了14.3千次搜索调用和约7.142亿令牌的节省。Semble仍然是一个没有付费产品的开源库,但它是一个活生生的证明,检索质量可以与模型大小解耦。
这件事要成立,得有什么
- 它针对的是可衡量的痛点——令牌消耗——而不是模糊的功能,因此价值主张是一个数字(减少98-99%的令牌),用户可以自己验证。
- 它颠覆了AI的剧本:不是用更大的模型或GPU重型检索器,而是使用1600万参数的静态模型加上BM25,使产品免费运行且零配置。
- 作为MCP服务器发布意味着即时分发:一条命令将Semble接入所有主要编码代理,而不是要求新工作流程。
- 创始人首先为自己的工作流程构建了该工具,这就是为什么质量标准(这是否真正找到代码)超过了架构炒作。
可借鉴之处
在购买更大的模型之前,衡量代理查找代码的成本——当任务是检索时,1600万参数的静态模型加上BM25以一小部分成本胜过137M transformer。
后续进展
截至2026年9月2日,Semble以MIT许可的开源项目形式活并增长:一个交互式安装器、一个CLI、一个Python库和一个用于Claude Code、Cursor、Codex、OpenCode和VS Code的MCP服务器,支持增量重新索引和代码感知排序流程。自己的遥测报告了14.3千次搜索调用和约7.14亿令牌的节省,在7天前达到高峰。没有披露资金或商业定价;MinishLab继续发布围绕静态嵌入的开源模型,而Semble仍然是一个库而不是一个创收公司。
资料来源
- Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep
- MinishLab/semble: Fast and Accurate Code Search for Agents
发现哪里写错了?告诉我们。
轮到你了
你刚读完一家。说说你在做什么,看看谁在赌同一件事。
免费账号 · 3 次免费提问 · 不用绑卡