Ultra-fast local hybrid semantic code search
Combines BM25 lexical precision with neural embeddings for intelligent, privacy-first code discovery.
Traditional code search tools force you to choose: exact keyword matching (fast but misses concepts) or semantic search (understands intent but slow on identifiers). Seekr combines both approaches, giving you:
- π― Exact matches when you search for
getUserById - π§ Conceptual matches when you search for "authentication flow"
- β‘ Sub-20ms responses on codebases with 100k+ lines
All processing happens locally. No cloud APIs, no data leaving your machine.
| Feature | Description |
|---|---|
| Hybrid Search | Fuses BM25 + semantic vectors using Reciprocal Rank Fusion (RRF) |
| Semantic Understanding | Finds code by concept using BGE neural embeddings |
| Incremental Indexing | Only re-indexes files that changed since last run |
| Watch Mode | Automatically updates index when files are saved |
| Syntax Highlighting | Beautiful colorized output with context |
| JSON Output | Machine-readable format for editor integration |
| Privacy-First | 100% local β no telemetry, no cloud dependencies |
# Install from source
git clone https://github.com/brobert1/seekr
cd seekr
cargo install --path .
# Initialize your project (builds lexical + semantic index)
cd /path/to/your/project
seekr init
# Search!
seekr search "error handling" --hybridseekr init # Index current directory
seekr init /path/to/project # Index specific pathFirst run downloads a 23MB embedding model. Subsequent runs are instant.
# BM25 Lexical Search β fast, exact keyword matching
seekr search "useState"
# Semantic Search β understands concepts and synonyms
seekr search "user authentication" --semantic
# Hybrid Search β best of both (recommended)
seekr search "handle database errors" --hybridseekr search <QUERY> [OPTIONS]
Options:
-l, --limit <N> Maximum results to return [default: 10]
-c, --context <N> Lines of context around matches [default: 3]
--semantic Use semantic (embedding) search
--hybrid Use hybrid BM25 + semantic search
--alpha <FLOAT> Weight for BM25 in hybrid mode [default: 0.5]
--json Output results as JSONseekr watch # Monitor current directory
seekr watch /path/to/src # Monitor specific pathWatches for file changes with 500ms debouncing, then incrementally updates the index.
seekr index . # Incremental update (only changed files)
seekr index . --force # Full reindex from scratch
seekr status # Show index health and statisticsβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Source Files β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββ΄βββββββββββββββ
βΌ βΌ
βββββββββββββββββββββ βββββββββββββββββββββ
β File Walker β β Tree-sitter β
β (respects β β Chunker β
β .gitignore) β β (AST parsing) β
βββββββββββββββββββββ βββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββ βββββββββββββββββββββ
β Tantivy β β BGE-small-en β
β BM25 Index β β Embeddings β
βββββββββββββββββββββ βββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββ βββββββββββββββββββββ
β Lexical Results β β USearch HNSW β
β β β Vector Index β
βββββββββββββββββββββ βββββββββββββββββββββ
β β
ββββββββββββββββ¬ββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββ
β Reciprocal Rank Fusion β
β (Hybrid Ranking) β
βββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββ
β Syntax-Highlighted β
β Results β
βββββββββββββββββββββββββββββ
| Component | Technology | Purpose |
|---|---|---|
| Lexical Search | Tantivy | BM25 full-text indexing |
| Code Parsing | Tree-sitter | AST-based semantic chunking |
| Embeddings | Fastembed | Local BGE-small-en-v1.5 (384d) |
| Vector Search | USearch | HNSW approximate nearest neighbors |
| File Watching | Notify | Cross-platform filesystem events |
| CLI | Clap | Argument parsing and help |
| Language | Extensions | Semantic Chunking |
|---|---|---|
| Rust | .rs |
β Tree-sitter |
| Python | .py |
β Tree-sitter |
| TypeScript | .ts, .tsx |
β Tree-sitter |
| JavaScript | .js, .jsx |
β Tree-sitter |
| Go | .go |
β Tree-sitter |
| Java | .java |
Sliding window |
| C/C++ | .c, .h, .cpp, .hpp, .cc |
Sliding window |
| Ruby | .rb |
Sliding window |
| Markdown | .md |
Sliding window |
| Config | .toml, .yaml, .yml, .json |
Sliding window |
Languages with Tree-sitter support get intelligent chunking by functions/classes. Others use overlapping sliding windows.
Benchmarked on a 116k LOC TypeScript/JavaScript project:
| Metric | Value |
|---|---|
| BM25 Index Time | 0.19s |
| Query Latency | 5-20ms |
| Index Size | 2.33 MB |
| Files Indexed | 1,606 |
Automatically skipped 55,000+ files in
node_modulesvia.gitignoreintegration.
All data is stored in ~/.seekr/:
| Path | Description |
|---|---|
~/.seekr/index/ |
Tantivy BM25 index |
~/.seekr/semantic/ |
Vector embeddings and metadata |
~/.seekr/file_cache.json |
File modification timestamps |
~/.seekr/workspace.txt |
Indexed workspace path |
rm -rf ~/.seekr
seekr initgit clone https://github.com/brobert1/seekr
cd seekr
cargo install --path .- Rust 1.75 or later
- Platform: macOS, Linux (Windows untested)
- Disk: ~150MB for embedding model (first run only)
Contributions are welcome. The codebase compiles with zero warnings.
cargo build # Development build
cargo test # Run test suite
cargo clippy # Lint
cargo build --release # Optimized buildMIT Β© Robert Bercaru