Skip to main content

VectorSink

Trait VectorSink 

Source
pub trait VectorSink: Send + Sync {
    // Required method
    fn record<'a>(
        &'a self,
        session_id: &'a str,
        vector: &'a [f32],
    ) -> VectorSinkFuture<'a>;

    // Provided methods
    fn nearest_similarity<'a>(
        &'a self,
        _session_id: &'a str,
        _vector: &'a [f32],
    ) -> VectorSearchFuture<'a> { ... }
    fn delete_scope<'a>(
        &'a self,
        _session_scope: &'a str,
    ) -> VectorSinkFuture<'a> { ... }
}
Expand description

Storage boundary for reasoning-step embeddings.

Required Methods§

Source

fn record<'a>( &'a self, session_id: &'a str, vector: &'a [f32], ) -> VectorSinkFuture<'a>

Persist one session vector without participating in the hot path.

Provided Methods§

Source

fn nearest_similarity<'a>( &'a self, _session_id: &'a str, _vector: &'a [f32], ) -> VectorSearchFuture<'a>

Return the highest cosine similarity among prior vectors for a session.

Source

fn delete_scope<'a>(&'a self, _session_scope: &'a str) -> VectorSinkFuture<'a>

Delete every vector recorded under session_scope. Called best-effort when a session finalizes so the external store does not grow without bound — the id#generation scoping makes prior-generation points permanently unreachable dead weight otherwise. Default no-op for sinks without external state.

Implementors§

Source§

impl VectorSink for NoopVectorSink

Source§

impl VectorSink for QdrantVectorSink

Available on crate feature qdrant only.