Semantic search across codebase using LEANN vector index
Use LEANN for meaning-based code search instead of grep.
class Foo, def bar, specific identifierserror.*handling, import.*from*.test.ts, src/**/*.py# Search the current project's index
leann search <index-name> "<query>" --top-k 5
# List available indexes
leann list
# Example
leann search rigg "how do providers handle streaming" --top-k 5
leann_search(index_name="rigg", query="your semantic query", top_k=5)
When codebase changes significantly:
cd /path/to/project
leann build <project-name> --docs src tests scripts \
--file-types '.ts,.py,.md,.json' \
--no-recompute --no-compact \
--embedding-mode sentence-transformers \
--embedding-model all-MiniLM-L6-v2
| Query Type | Tool | Example |
|---|---|---|
| Natural language | LEANN | "how does caching work" |
| Class/function name | Grep | "class CacheManager" |
| Pattern matching | Grep | error|warning |
| Find implementations | LEANN | "rate limiting logic" |