Skip to main content

Crate omni_index

Crate omni_index 

Source
Expand description

Omniscient Code Index (OCI)

A semantic, interventionist code indexer for AI coding agents.

§Architecture

The OCI maintains three interconnected graph layers:

  1. Module Topology (Layer 1): High-level view of crates, modules, and files with import relationships and PageRank-based relevance scoring.

  2. Symbol Resolution (Layer 2): Precise symbol definitions and call graph using incremental analysis for fast updates.

  3. Semantic Embeddings (Layer 3): Vector embeddings for semantic search and duplicate detection.

§Key Features

  • Incremental Indexing: Only re-parse changed files
  • Active Intervention: Detect semantic duplicates before code is written
  • Dead Code Analysis: Global reachability analysis across workspace
  • Test Coverage Integration: Map coverage data to symbols
  • Virtual Context Documents: Auto-generated architectural documentation

§Usage

use omni_index::{OciState, IncrementalIndexer};

let state = OciState::new("/path/to/repo".into());
let indexer = IncrementalIndexer::new();
indexer.full_index(&state, &state.root_path).await?;

// Search for symbols
let results = state.find_by_name("my_function");

Re-exports§

pub use cache::FileFingerprint;
pub use cache::IndexManifest;
pub use discovery::FileDiscovery;
pub use fold::FunctionSignature;
pub use fold::fold_to_signatures;
pub use fold::parse_single_file;
pub use incremental::IncrementalIndexer;
pub use incremental::IndexOptions;
pub use incremental::IndexReport;
pub use query::QueryFilters;
pub use query::QueryResponse;
pub use query::QueryResult;
pub use query::SearchDoc;
pub use query::SearchIndex;
pub use query::SearchState;
pub use search::Bm25Index;
pub use search::HybridSearch;
pub use search::HybridSearchConfig;
pub use search::HybridSearchResult;
pub use search::SearchQualityMetrics;
pub use state::IndexStats;
pub use state::OciState;
pub use state::SharedState;
pub use state::create_state;
pub use analysis::DeadCodeAnalyzer;
pub use context::ContextChunk;
pub use context::ContextQuery;
pub use context::ContextResult;
pub use context::ContextSynthesizer;
pub use intervention::InterventionEngine;
pub use types::*;

Modules§

analysis
Code analysis modules.
cache
context
Context synthesis (“Ghost Docs”).
discovery
File discovery module.
export
Export utilities for downstream tools (e.g., Engram).
fold
Code folding and parsing utilities.
incremental
Incremental indexing engine.
intervention
Active intervention system for duplicate detection.
mcp
MCP server implementation.
parsing
Parsing module for extracting symbols from source code.
query
search
Hybrid search combining BM25 and semantic embeddings.
semantic
Semantic embedding layer (Layer 3).
state
Global state management for the Omniscient Code Index.
topology
Module topology graph builder.
types
Core types for the Omniscient Code Index.

Constants§

SERVER_NAME
Server name for MCP.
SERVER_VERSION
Server version.