aicx-retrieve 0.9.2

Retrieval trait surface, Tantivy adapter, and manifest contract for aicx hybrid indexes.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Vibecrafted with AI Agents by VetCoders (c)2024-2026 LibraxisAI
use anyhow::Result;

use crate::{DenseChunkRef, Distance, FilterSet, Hit};

/// Contract for dense-vector retrieval adapters.
///
/// Trait boundaries use `anyhow::Result` so adapter crates can preserve their
/// native error context while manifest validation remains typed.
pub trait DenseIndex {
    fn dim(&self) -> usize;
    fn distance(&self) -> Distance;
    fn kind(&self) -> &str;
    fn build(&mut self, chunks: &[DenseChunkRef]) -> Result<()>;
    fn insert(&mut self, chunk: &DenseChunkRef) -> Result<()>;
    fn query(&self, embedding: &[f32], limit: usize, filters: &FilterSet) -> Result<Vec<Hit>>;
    fn count(&self) -> usize;
}