PromptZone - Leading AI Community for Prompt Engineering and AI Enthusiasts

Cover image for Semble Delivers 98% Token Savings for Agent Code Search
Carmen Nasrallah
Carmen Nasrallah

Posted on

Semble Delivers 98% Token Savings for Agent Code Search

MinishLab released Semble on Hacker News, a code search tool built specifically for AI agents that reduces token consumption by 98% compared with standard grep.

The project surfaced in a thread that reached 135 points and 37 comments, highlighting demand for lighter context windows when agents explore large codebases.

Tool: Semble | Token Reduction: 98% vs grep | Target: AI agent workflows | Source: GitHub

What It Is and How It Works

Semble indexes code repositories and returns only the minimal relevant snippets agents need. Instead of dumping entire files or long match lists, it delivers compact, ranked results optimized for insertion into LLM prompts.

The approach avoids the full-text expansion typical of grep, which forces agents to process thousands of unnecessary tokens before reasoning begins.

Semble Delivers 98% Token Savings for Agent Code Search

Token and Performance Numbers

Early tests shared on Hacker News show consistent savings. On a 50,000-line repository, grep returned results averaging 4,200 tokens while Semble averaged 84 tokens for equivalent relevance.

The reduction holds across Python, TypeScript, and Rust codebases. Latency remains comparable to ripgrep on consumer hardware because indexing occurs once per repository.

Tool Avg tokens per query Relevance score (agent-rated) Index time
grep 4,200 0.62 0s
ripgrep 3,800 0.65 0s
Semble 84 0.89 12s

How to Try It

Clone the repository and run the provided indexing command on any local folder. Agents can then query via a simple CLI or Python API that returns JSON snippets ready for prompt injection.

Full setup instructions and example agent integrations sit in the project README at the official GitHub page.

Pros and Cons

  • Pros: 98% token reduction directly lowers API costs and fits inside smaller context windows; relevance scores reported by agents exceed traditional search.
  • Cons: Requires one-time indexing per repository; currently limited to local files rather than remote Git hosting platforms.

Alternatives and Comparisons

Traditional tools like grep and ripgrep remain faster for one-off human searches but flood agent prompts with noise. Semantic code search services such as Sourcegraph or GitHub Copilot Workspace add context understanding yet require cloud access and higher latency.

Semble sits between the two: local, deterministic, and explicitly tuned for token efficiency.

Who Should Use This

Developers building autonomous coding agents or retrieval-augmented generation pipelines gain the clearest benefit. Teams already constrained by context length limits or token budgets should evaluate it first.

Users running simple one-off searches or working exclusively in browser-based IDEs can continue with existing grep-based workflows.

Bottom Line and Verdict

Semble provides the first practical code search layer that treats token count as a primary optimization target rather than an afterthought.

Bottom line: For agent builders who repeatedly query large repositories, the 98% token cut translates into measurable cost and speed gains today.

Early adoption will likely concentrate among teams shipping production agents that must stay inside strict context budgets.

Top comments (0)