Skip to main content

Module vector

Module vector 

Source
Expand description

Vector index module for HNSW-based approximate nearest neighbor search. Vector index abstractions for semantic search.

This module provides a trait-based abstraction over vector indexes, allowing different ANN (Approximate Nearest Neighbor) backends. The primary implementation uses hnsw_rs (pure Rust, ADR-005).

§Architecture

┌──────────────────────────────────┐
│         VectorIndex trait         │
└──────────┬───────────────────────┘
           │
   ┌───────┴────────┐
   │   HnswIndex    │  (hnsw_rs wrapper)
   └────────────────┘

Embeddings stored in redb are the source of truth. The HNSW index is a derived, rebuildable structure — if files are missing or corrupt, rebuild from stored embeddings.

Structs§

HnswIndex
HNSW vector index backed by hnsw_rs.

Traits§

VectorIndex
Vector index trait for approximate nearest neighbor search.