Semble

by MinishLab

Community Developer Tools 6k likes

A code search tool built for agents that returns exact, relevant snippets from a codebase in under a second, using roughly 98% fewer tokens than a typical grep-then-read loop.

Install and set up

uv tool install semble && semble install

Source: https://github.com/MinishLab/semble

About

Semble indexes a codebase using static Model2Vec embeddings combined with BM25 lexical search and reciprocal rank fusion, then answers natural-language or code-shaped queries with the specific snippets that matter, not the surrounding files an agent would otherwise have to grep for and read in full. Indexing and querying both run on CPU with no API keys, GPU, or external service required, and indexes are cached and automatically invalidated as files change, so repeat searches against the same repo stay fast.

It exposes exactly two MCP tools: `search`, for natural-language or syntax-based lookups across a local path or a git URL, and `find_related`, which takes a specific file and line number and returns semantically similar code elsewhere in the repo, useful for tracing a pattern's other usages without a full-text grep. It also runs standalone as a CLI, and its own installer auto-detects whichever coding agent you're using and offers to wire itself in as an MCP server, as AGENTS.md/CLAUDE.md instructions, or as a dedicated sub-agent.

Key features

  • Combines static embeddings (Model2Vec) with BM25 and reciprocal rank fusion for retrieval
  • Full codebase index/search cycle in under a second, no GPU or API key needed
  • Automatic cache invalidation as files change, so re-indexing is incremental
  • Two focused MCP tools: `search` and `find_related`
  • Accepts a local path or a git URL as the target codebase
  • Self-installer that auto-detects and configures your coding agent

Use cases

  • Cutting an agent's token spend on codebase exploration by replacing grep+read loops with targeted snippet search
  • Finding every place a pattern or utility function is used across a large, unfamiliar repo
  • Giving an agent fast semantic search over a codebase it hasn't indexed with a heavier embedding model
  • Running ad hoc code search from the terminal outside of any agent, via the CLI

Available tools

search

Searches a codebase (local path or git URL) using natural language or code syntax.

find_related

Given a file and line number, returns semantically similar code elsewhere in the repo.

Frequently asked questions

Does Semble need an API key or GPU?

No. Indexing and search both run entirely on CPU using static embeddings, with no external API calls required.

Can I use Semble without MCP?

Yes. It ships as a standalone CLI (`semble search "query" ./path`) in addition to the MCP server, and the installer also offers a CLI-instructions or sub-agent integration mode.