pub trait VectorRecall: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn upsert(&self, record: &VectorRecord) -> Result<(), CapabilityError>;
fn query(
&self,
query: &VectorQuery,
) -> Result<Vec<VectorMatch>, CapabilityError>;
fn delete(&self, id: &str) -> Result<(), CapabilityError>;
fn clear(&self) -> Result<(), CapabilityError>;
fn count(&self) -> Result<usize, CapabilityError>;
// Provided method
fn upsert_batch(
&self,
records: &[VectorRecord],
) -> Result<(), CapabilityError> { ... }
}Expand description
Trait for vector stores that enable similarity search.
Vector stores are caches, not authoritative state. They can always be rebuilt from the Context which is the source of truth.
§Design Note
This follows Converge’s principle: vector stores expand what agents can see, not what they are allowed to decide.
Required Methods§
Sourcefn upsert(&self, record: &VectorRecord) -> Result<(), CapabilityError>
fn upsert(&self, record: &VectorRecord) -> Result<(), CapabilityError>
Sourcefn query(
&self,
query: &VectorQuery,
) -> Result<Vec<VectorMatch>, CapabilityError>
fn query( &self, query: &VectorQuery, ) -> Result<Vec<VectorMatch>, CapabilityError>
Provided Methods§
Sourcefn upsert_batch(&self, records: &[VectorRecord]) -> Result<(), CapabilityError>
fn upsert_batch(&self, records: &[VectorRecord]) -> Result<(), CapabilityError>
Batch upsert multiple records.
Default implementation calls upsert for each record.
§Errors
Returns error if any upsert fails.