Semantic retrieval layer for normalize.
This crate provides vector embeddings over structurally-derived chunks (symbols + doc comments + caller/callee context + co-change neighbors), stored in SQLite alongside the structural index, queryable by meaning rather than by name.
Architecture
- [
config] --EmbeddingsConfig([embeddings]section of config.toml) - [
chunks] -- context window construction from index rows - [
embedder] -- fastembed wrapper (ONNX, no server required) - [
schema] -- SQLite DDL for theembeddingstable - [
store] -- read/write embeddings to/from SQLite - [
search] -- ANN search + staleness re-ranking - [
populate] -- walk the structural index and embed symbols, docs, and commits - [
service] -- CLI service (normalize structure search) --clifeature
Usage
After structure rebuild, call [populate::populate_embeddings] with the
active FileIndex connection to generate and store embeddings.
For markdown and commit embeddings, call [populate::populate_markdown_docs]
and [populate::populate_commit_messages] respectively.
For .normalize/context/ block embeddings, call [populate::populate_context_blocks].
To search, call [service::run_search] (all source types) or
[service::run_context_search] (context blocks only), or use
[store::load_all_embeddings] + [search::rerank] directly.