MinishLab/semble
Fast and Accurate Code Search for Agents. Uses ~98% fewer tokens than grep+read
What it solves
Semble addresses the inefficiency of coding agents (like Claude Code or Cursor) when searching through large codebases. Traditionally, agents use "grep and read" methods, which consume massive amounts of tokens by reading entire files to find relevant snippets. Semble provides a fast, accurate way to retrieve only the exact code chunks needed, reducing token usage by approximately 98%.
How it works
Semble uses a hybrid retrieval approach that runs entirely on the CPU without requiring GPUs or API keys:
- Chunking: It uses
tree-sitterto split files into code-aware chunks. - Retrieval: It combines semantic similarity (via static
Model2Vecembeddings and thepotion-code-16Mmodel) with lexical matching (viaBM25) for identifiers and API names. - Fusion & Reranking: Results are combined using Reciprocal Rank Fusion (RRF) and then reranked based on code-specific signals, such as boosting function definitions over references and penalizing noise like test files or legacy shims.
- Caching: Indexes are cached to disk and automatically rebuilt when file changes are detected.
Who it’s for
It is designed for developers building or using AI coding agents, as well as those who want a standalone CLI tool for fast, natural-language code search across local or remote repositories.
Highlights
- Extreme Efficiency: Indexes average repositories in ~250ms and queries in ~1.5ms on CPU.
- Token Savings: Significantly reduces context window bloat by returning only relevant snippets rather than full files.
- Agent Integration: Works as an MCP (Model Context Protocol) server, a CLI tool, or a dedicated sub-agent for tools like Claude Code and Cursor.
- Zero Dependency: No external services, API keys, or GPUs required.