@aigclink: An Agent-oriented code search tool: Semble. It uses natural language to search codebases and returns precise code snippets, saving 98% token consumption compared to grep+read. The method lets Agents use natural language to directly locate the most relevant lines of code, without guessing keywords or reading entire files. Speed: indexing a typical…
Summary
Semble is an Agent-oriented code search tool that supports natural language queries, accurately returns semantically complete code snippets, saves 98% token consumption compared to traditional grep+read methods, and features intelligent chunking, dual-path retrieval, and code-aware re-ranking.
View Cached Full Text
Cached at: 05/19/26, 02:46 PM
An Agent-oriented code search tool: Semble — uses natural language to query codebases and returns precise code snippets, saving 98% token consumption compared to grep+read.
The approach lets the Agent directly locate the most relevant lines of code using natural language, without guessing keywords or reading entire files.
In terms of speed, indexing a typical repository takes ~250ms, answering a query takes ~1.5ms, with NDCG@10 = 0.854.
Semble achieves 94% recall with 2k tokens, while grep+read needs to fill a 100k token window to reach 85%.
First, it uses intelligent chunking — not mechanical line-based splitting, but smart segmentation based on code structure (functions, classes, code blocks). Each chunk is a meaningful code unit, never cutting a function in half.
The search returns semantically complete code blocks — a function, a class, or an independent logical unit — without truncating code mid-stream.
It employs dual-path retrieval (semantic path + lexical path) combined with Reciprocal Rank Fusion (RRF), where each path produces a ranking and RRF merges them.
Code-aware re-ranking: after the initial results, the ranking is fine-tuned using code-specific signals to push the most relevant items to the top.
It should be quite effective for Agent code search scenarios.
#Semble #AgentCodeSearch
Similar Articles
Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep
Semble is a fast code search library for AI agents that uses ~98% fewer tokens than grep+read, runs on CPU with no external dependencies, and integrates via MCP or CLI.
@Trtd6Trtd: https://github.com/MinishLab/semble… High-speed code search library specialized for AI Compared to grep + reading, it s…
Semble 是一个面向 AI 代理的高效代码搜索库,使用模型如 Model2Vec 或 BM25 实现快速索引和检索,比 grep+read 节省约 98% 的 token,支持 MCP 服务器和 CLI 集成。
@Ryrenz: The token-saving artifact for coding agents has arrived—cocoindex-code, one command for semantic search on your codebase. Just open-sourced, quickly gaining stars with the selling point of "saving 70% tokens". Enabling agents like Claude Code, Codex…
cocoindex-code is an AST-based semantic code search tool that can be quickly integrated into coding agents, saving up to 70% tokens and improving search efficiency.
@Pluvio9yte: After integrating AnySearch, my agent's search efficiency improved. Tools like Parallel, Perplexity, and Tavily have a persistent issue when used by agents — they return links and summaries, so the agent still has to open pages, filter content, and assess relevance. For verticals like finance, academia, and code, search quality is even worse. Output lacks structure, and parsing content alone burns a lot of tokens.
AnySearch is a search infrastructure designed for AI agents. It supports real-time web search and vertical domain search, outputting structured Markdown that agents can directly use, improving search efficiency.
@justloveabit: https://x.com/justloveabit/status/2055263377006747820
Introducing the new version of Claude Code 2.1.142 in combination with CodeGraph and MCP, which greatly improves the efficiency of exploring large codebases through a local semantic knowledge graph, with a 92% reduction in tool calls and a 71% speed improvement.