Semble: Open-Source Code Search for AI Agents That Uses 98% Fewer Tokens
Original: Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep View original →
The Problem
When AI agents like Claude Code navigate large codebases, they typically rely on grep and broad file reads — consuming enormous amounts of context tokens. grep+read needs a full 100k context window just to hit 85% recall. Semble, released by MinishLab, tackles this directly.
How It Works
Semble uses a two-stage retrieval pipeline. The first stage applies tree-sitter for code-aware chunking, then scores candidates using both Model2Vec semantic embeddings and BM25 lexical matching. The second stage reranks results with code-specific signals: definition boosts, identifier stem matching, file coherence, and noise penalties for test and legacy code.
Everything runs on CPU. No external APIs, no GPU, no authentication required. A typical repository indexes in ~200ms; queries return in ~1.5ms.
Benchmarks
- Token efficiency: 94% recall at just 2k tokens — vs. 100k context for 85% recall with grep+read
- NDCG@10: 0.854 — 99% of the 137M-parameter CodeRankEmbed transformer model
- Indexing speed: ~200x faster than code-specialized transformers (~200ms)
- Query speed: ~10x faster (~1.5ms per query)
Integration
Add Semble to Claude Code as an MCP server with a single command:
claude mcp add semble -s user -- uvx --from "semble[mcp]" sembleCursor, Codex, and OpenCode support the same uvx command structure. For shell-based workflows, document semble search and semble find-related in AGENTS.md.
Why It Matters
Token efficiency directly impacts cost, speed, and context window limits for AI agent workflows. Semble hits a practical sweet spot: near-transformer search quality with zero external dependencies, running fully offline. As AI coding agents become standard development tools, efficient codebase navigation becomes a first-class engineering concern.
Related Articles
AI coding is shifting from picking one assistant to orchestrating several agents. Omnigent is an open-source meta-harness with shared sessions, guardrails, and human-in-the-loop workflows.
OpenCode drew 1,238 points and 614 comments on Hacker News, highlighting an open-source AI coding agent that spans terminal, IDE, and desktop clients. The project site emphasizes broad provider support, LSP integration, multi-session workflows, and a privacy-first posture.
Together AI said on March 13, 2026 that v2 of Open Deep Research is fully free and open source. The companion blog describes a planner and self-reflection workflow for multi-hop web research and ships code plus evaluation assets for developers.