AI/TLDR

Minish Lab · 2026-05-17 · major

Semble — Code Search for AI Agents Uses ~98% Fewer Tokens Than grep+read, Hits the Hacker News Front Page

Local CPU-only code-search MCP server that pairs Model2Vec static embeddings with BM25 lexical matching. Indexes a repo in about 250ms, answers queries in about 1.5ms, and reports 0.854 NDCG@10.

Semble code search repository on GitHub

A CPU-only code-search MCP server that cuts the tokens an agent burns hunting through a repo.

Key specs

GitHub stars2.3K
Hn points417
Token reduction vs grep+read~98%
Index time~250ms
Query latency~1.5ms on CPU
Ndcg@100.854

What is it?

Semble is an open-source code-search library built for AI coding agents. Instead of an agent running grep and reading whole files into its context, Semble returns the specific snippets that match a query. It runs as an MCP server, so Claude Code, Cursor, Codex, and other MCP clients can call it directly.

How does it work?

It combines two retrieval methods: semantic search using Model2Vec static embeddings, and lexical matching with BM25 for identifiers and API names. Results are merged with Reciprocal Rank Fusion, then re-ranked with code-aware signals like definition boosts, identifier stemming, and penalties for test or legacy files. Everything runs on CPU with no API keys, GPU, or external services.

Why does it matter?

Token cost and context bloat limit agent workflows. The project reports indexing a repo in about 250ms and answering queries in about 1.5ms on CPU while using roughly 98% fewer tokens than a grep-and-read loop, leaving more of an agent's context window for actual reasoning.

Who is it for?

developers building or running coding agents

Try it

pip install semble

Sources · 4 outlets

Tags

  • code-search
  • mcp
  • ai-agents
  • embeddings
  • bm25
  • model2vec
  • retrieval
  • open-source
  • python
  • coding-agents

← All releases · Learn AI