Skip to main content

Module encoder

Module encoder 

Source
Expand description

Encoder abstraction for the ripvec static-table engine.

VectorEncoder exposes the surviving ripvec engine behind one interface, so downstream search code (CLI dispatch, HybridIndex, cache layer) does not branch on encoder internals.

§Implementation

  • StaticEncoder — static embedding-table lookup via the in-process Model2Vec engine. Used for --model ripvec. CPU-only; no batching or ring buffer (table-lookup encoder is memory-bound, not compute-bound).

§Design rationale

VectorEncoder abstracts at the repo→(chunks, embeddings) boundary, where the concrete pipeline shape does not leak through. Callers receive a (Vec<CodeChunk>, Vec<Vec<f32>>) pair regardless of how the encoder implements walk, chunk, and embed internally.

@Parnas (1972) — the module hides which engine is active; the trait is the stable interface boundary. @Postel (1980) — callers use the same VectorEncoder surface; no change at the call site after the transformer path was removed.

See docs/PLAN.md cluster B6 for the surgery context.

Modules§

ripvec
Ripvec retrieval pipeline ported into Rust.

Traits§

VectorEncoder
Trait that abstracts text/chunks → embedding vectors.