Loading...
Loading...
Fast, accurate code search for AI agents using ~98% fewer tokens than grep+read. Indexes any local or remote repository in under a second (~250ms on CPU, no GPU or API key needed). Supports natural-language and symbol queries, semantic similar-code discovery, and MCP server integration for Claude Code, Codex, Cursor, and OpenCode. Python library available for programmatic use. Triggers on: semble, code search, semantic code search, semble search, token-efficient search, find code, code search mcp, agent code search, semble find-related, semble savings.
npx skill4agent add akillness/oh-my-skills semble~98% fewer tokens than grep+read. Index in ~250ms. Query in ~1.5ms. No GPU, no API key.
"authentication flow""save_pretrained"# Requires uv: https://docs.astral.sh/uv/getting-started/installation/
claude mcp add semble -s user -- uvx --from "semble[mcp]" semble~/.codex/config.toml[mcp_servers.semble]
command = "uvx"
args = ["--from", "semble[mcp]", "semble"]~/.cursor/mcp.json{
"mcpServers": {
"semble": {
"command": "uvx",
"args": ["--from", "semble[mcp]", "semble"]
}
}
}~/.opencode/config.json{
"mcp": {
"semble": {
"type": "local",
"command": ["uvx", "--from", "semble[mcp]", "semble"]
}
}
}pip install semble # pip
uv tool install semble # uv (recommended for CLI use)npx skills add https://github.com/akillness/oh-my-skills --skill semble"how is rate limiting handled""save_pretrained"find-relatedReadGlobGrep# Natural-language search in a local repo
semble search "authentication flow" ./my-project
# Symbol search
semble search "save_pretrained" ./my-project
# Search with a limit on returned chunks
semble search "save model to disk" ./my-project --top-k 10
# Search a remote git repo (no clone needed)
semble search "save model to disk" https://github.com/MinishLab/model2vec
# Find semantically similar code given a known file+line
semble find-related src/auth.py 42 ./my-project
# Show token savings vs grep+read for the last query
semble savings
semble savings --verbosefrom semble import SembleIndex
# Index local directory
index = SembleIndex.from_path("./my-project")
# Index remote repository (no clone required)
index = SembleIndex.from_git("https://github.com/MinishLab/model2vec")
# Natural-language or symbol query
results = index.search("save model to disk", top_k=3)
# Find semantically similar code to a known chunk
related = index.find_related(results[0], top_k=3)
# Inspect results
result = results[0]
print(result.chunk.file_path) # "model2vec/model.py"
print(result.chunk.start_line) # 127
print(result.chunk.end_line) # 150
print(result.chunk.content) # the function/class bodyAGENTS.mdCLAUDE.md## Code Search
Use `semble search` to find code by describing what it does or naming a symbol, instead of grep:
```bash
semble search "authentication flow" ./my-project
semble search "save_pretrained" ./my-project
semble search "save model to disk" ./my-project --top-k 10
```
Use `semble find-related` to discover code similar to a known location (pass `file_path` and `line` from a prior search result):
```bash
semble find-related src/auth.py 42 ./my-project
```
`path` defaults to the current directory when omitted; git URLs are accepted.
If `semble` is not on `$PATH`, use `uvx --from "semble[mcp]" semble` in its place.semble init| Metric | Semble | grep+read |
|---|---|---|
| Indexing speed | ~250ms | n/a |
| Query speed | ~1.5ms | varies |
| Token use at 94% recall | ~2k tokens | ~100k tokens |
| NDCG@10 | 0.854 | — |
| vs 137M-param CodeRankEmbed | 99% quality | — |
| Indexing vs transformer | 218× faster | — |
--top-kfind-relatedsearchsemble initsemble$PATHuvx --from "semble[mcp]" semble# Search for how a feature is implemented
semble search "rate limiting middleware" ./api-service
# Find all code related to database migrations
semble search "database migration" ./backend --top-k 5
# Explore similar code patterns near a known function
semble find-related src/middleware/auth.py 88 ./api-service
# Index and query a remote library without cloning
semble search "tokenizer padding" https://github.com/huggingface/transformers