v0.1 — Pure Rust, zero dependencies

Find code by
meaning,
not just text.

Grep finds exact text. Ripgrep does it fast. sgrep finds what you mean. Zero API calls. Zero Python. One binary, one 8MB model.

$ curl -fsSL https://sgrep.sh/install.sh | sh
8MB model · Zero API calls · <10ms search · Pure Rust
sgrep "handle errors" src/
sgrep demo — semantic code search
Live demo — runs in your browser

Try it right now

Real semantic search powered by sgrep compiled to WebAssembly. Type a query, see results instantly. No server, no API.

sgrep — ~/docs
Initializing…

Why sgrep?

Built for developers who think in concepts, not keywords.

🧠

Semantic Search

Search by meaning, not keywords. Ask for "recursively walk subdirectories" and find recursive_dir_search.

✈️

Fully Offline

No API keys. No network after first model download (8MB). Everything runs locally on your machine.

Instant Results

Model2Vec embeddings in pure Rust via Candle. Sub-10ms search on most codebases. Faster than grep on cold cache.

🔀

Hybrid Mode

Combine semantic + BM25 keyword search via ripgrep integration. Best of both worlds in one flag.

🦀

Pure Rust

No Python. No Node. Single static binary. Cross-compile anywhere Rust runs. Zero runtime deps.

🔧

Pipeline-Ready

JSON output, configurable thresholds, grep-compatible exit codes. Pipe it anywhere, script everything.

How It Works

Three steps. No configuration. No API keys. Just meaning.

1

Embed

Your query and every code chunk get converted to 256-dimensional vectors via Model2Vec. 8MB model, runs on CPU.

2

Compare

Cosine similarity ranks every chunk by semantic distance to your query. Zero word overlap? No problem.

3

Rank

Top-K results returned instantly, ranked by meaning. Add --hybrid for keyword precision too.

Quick Examples

Four modes. One binary. Pick your workflow.

Search any codebase by meaning — no keyword match required.

# Find code that handles auth errors, even if named differently
$ sgrep "handle authentication errors" src/

src/middleware/auth.rs:42  score=0.91
src/api/handlers.rs:108   score=0.87
src/utils/jwt.rs:67       score=0.82
Star on GitHub
🦀 Written in Rust
⚖️ MIT License