Omni Index
A fast, deterministic BM25 index and query tool for AI agents.
Installation
From crates.io
# Install the CLI
# Or add as a library dependency
From source
What It Does
- 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
Core Contract (Stable)
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:
Quick Start
# Index a repo
# Search the index (Claudette interface)
# Query with filters
CLI Usage
Index
Options:
--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
Search (Primary Interface)
This 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).
Query
Filters:
path:src/cli.rsext:rs-path:target
You can pass filters inline in the query or with --filters.
JSON Output
All commands support --json for machine-readable output.
Other Commands (Non-Core)
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)
Building
# Full build (all features, default)
# Slim build (CLI only, no MCP/semantic)
| Profile | Features | Use Case |
|---|---|---|
| Slim | core |
Claudette integration, minimal footprint |
| Standard | core,analysis |
+ dead code analysis |
| Full | default (all) | + MCP server, semantic search |
Default Excludes
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
Cache Layout
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.
MCP Server (Experimental)
Requires building with --features mcp:
Search via MCP:
Tests
# Contract tests only (Claudette interface, core build)
# Full test suite
Test 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) |
Pre-commit Hook
Enforce contract stability with a pre-commit hook:
The hook runs contract tests in core build before each commit.
Architecture
See docs/vision/ARCHITECTURE.md for the full architectural vision.