Skip to main content

Module search

Module search 

Source
Expand description

Cross-repo precedent search: index the git-tracked content of every registered repo, then retrieve it by meaning or by keyword.

The store (index) is a single SQLite database spanning all repos so one query reaches everything — the answer to “I solved this somewhere, I just don’t remember which repo.” Retrieval is hybrid: BM25 lexical (FTS5) fused with semantic cosine over local embeddings (embed, feature semantic), merged by reciprocal-rank fusion. The binary resolves the data directory and passes it in; this module performs the dirs-free path joins, mirroring how config.rs takes a dir: &Path.

Modules§

chunk
Turning a repo’s git-tracked files into indexable chunks.
embed
Local embedding backend.
index
The SQLite-backed search store.

Structs§

Hit
One ranked search result. Field order is the JSON serialization order and part of the stable output contract.
IndexOutcome
Outcome of build_index.
IndexStatus
Health of the search index, consumed by repograph doctor.
SearchOutcome
Outcome of search: the ranked hits plus retrieval diagnostics for the binary’s stderr (never part of the stdout data contract).

Constants§

FIND_SCHEMA_VERSION
Schema version of the repograph find JSON envelope.
INDEX_DB_NAME
File name of the central index database under the data directory.
MODEL_SUBDIR
Subdirectory of the data directory that caches the embedding model.

Functions§

build_index
Build or refresh the index over repos (each (name, absolute_path)).
index_db_path
Path to the index database within data_dir.
index_health
Compute the IndexStatus for repos.
model_cache_dir
Path to the embedding-model cache within data_dir.
search
Search the index, returning ranked hits across all repos or one workspace.