A fast, deterministic BM25 index and query tool for AI agents.
# Install the CLI
cargo install omni-index
# Or add as a library dependency
cargo add omni-indexgit clone https://github.com/bobamatcha/omni.git
cd omni
cargo build --release- Incrementally indexes a repo with sane ignore defaults
- Ranks results with BM25 over symbol spans
- Returns byte offsets and 1-based line and column numbers
- Emits deterministic JSON with
--json
These commands and their JSON schemas are stable. Claudette depends on this interface.
| Command | Schema |
|---|---|
omni index --json |
{ ok, type: "index", files, symbols, ... } |
omni search <query> -w <workspace> -n <limit> --json |
{ ok, type: "search", results: [...] } |
Search result schema:
{
"symbol": "crate::module::function_name",
"kind": "symbol",
"file": "src/module.rs",
"line": 42,
"score": 6.42
}cargo build --release
# Index a repo
./target/release/omni index --root /path/to/repo
# Search the index (Claudette interface)
./target/release/omni search "parse config" -w /path/to/repo -n 10 --json
# Query with filters
./target/release/omni query "token" --root /path/to/repo --top-k 20omni index --root /path/to/repoOptions:
--forcerebuilds the cache--include GLOBre-includes excluded paths--exclude GLOBadds extra excludes--no-default-excludesdisables defaults--include-hiddenincludes dotfiles--include-largeincludes large files--max-file-size BYTESsets the size cap
omni search <query> -w <workspace> -n <limit> --jsonThis is the primary interface for AI agents like Claudette. The -w flag is a short form specific to the search command. Other commands use --root or --workspace (global alias).
omni query <query> --root /path/to/repo --top-k 20Filters:
path:src/cli.rsext:rs-path:target
You can pass filters inline in the query or with --filters.
All commands support --json for machine-readable output.
These commands may change in future versions:
omni query- BM25 search with filters (similar to search)omni symbol- Symbol lookupomni calls- Call graph queriesomni analyze dead-code- Dead code analysis (requires--features analysis)omni export- Engram exportomni-server- MCP server (requires--features mcp)
# Full build (all features, default)
cargo build --release
# Slim build (CLI only, no MCP/semantic)
cargo build --release --no-default-features --features core| Profile | Features | Use Case |
|---|---|---|
| Slim | core |
Claudette integration, minimal footprint |
| Standard | core,analysis |
+ dead code analysis |
| Full | default (all) | + MCP server, semantic search |
Omni skips these by default:
Directories:
target/,node_modules/,.git/,dist/,build/,out/,coverage/,vendor/,.venv/,.next/,.omni/
Lockfiles:
package-lock.json,yarn.lock,pnpm-lock.yaml,Cargo.lock
Minified and binary assets:
**/*.min.js,**/*.min.css,**/*.map.png,.jpg,.jpeg,.gif,.webp,.pdf,.zip,.gz,.tar,.tgz,.jar,.wasm,.o,.a,.so,.dylib,.dll
The index is stored under .omni/ in the repo root:
.omni/manifest.jsonfile fingerprints and version.omni/state.binsymbol metadata and spans.omni/bm25.binBM25 index
Use omni index --force to rebuild.
Requires building with --features mcp:
cargo build --release --features mcp
export OCI_WORKSPACE=/path/to/repo
./target/release/omni-serverSearch via MCP:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search",
"arguments": {
"query": "parse config",
"top_k": 10
}
}
}# Contract tests only (Claudette interface, core build)
cargo test --no-default-features --features core --test contract_test
# Full test suite
cargo testTest organization:
| Test File | Runs In | Purpose |
|---|---|---|
contract_test.rs |
core, full | Claudette contract (search + index) |
cli_compat_test.rs |
full only | CLI convenience (non-contract) |
error_handling_test.rs |
full only | Error behavior (non-contract) |
comparative_test.rs, property_tests.rs |
full only | Feature tests (analysis/intervention) |
ln -sf ../../scripts/pre-commit .git/hooks/pre-commitRuns format, clippy, and tests before each commit.
See docs/vision/ARCHITECTURE.md for the full architectural vision.