Semble is a code search library built for agents that retrieves exact code snippets using semantic search with dramatically reduced token consumption compared to traditional grep-and-read approaches.
The tool solves the problem of agents wasting tokens by reading entire files or using inefficient search methods. It uses embeddings-based retrieval to index codebases and return only the relevant code snippets in response to natural language queries. The indexing and search operations run entirely on CPU without requiring API keys, GPU resources, or external services. Semble achieves retrieval quality comparable to code-specialized transformer models while indexing significantly faster and using substantially fewer tokens per query.
Semble suits teams integrating coding agents into their workflows who want to reduce token costs and improve search accuracy. It works with any MCP-compatible agent including Claude Code, Cursor, Codex, and OpenCode. The tool can be deployed as an MCP server that agents call directly as a tool, added as CLI instructions in agent configuration files, or run as a dedicated sub-agent. It handles both local repository paths and remote git URLs. An interactive installer detects installed coding agents and configures the appropriate integration method, with options for manual setup if needed.
The project maintains active development with regular updates and comprehensive test coverage. The codebase demonstrates attention to performance optimization, with benchmarks showing substantial speed advantages over transformer-based alternatives. Documentation includes detailed installation guides, CLI usage instructions, and integration examples for multiple agent platforms. The tool is distributed as a Python package with straightforward installation via standard package managers.