pub struct MemoryEmbeddingStore { /* private fields */ }Expand description
In-memory embedding store for testing, development, and prototyping.
Uses brute-force O(n) cosine similarity scan for nearest-neighbor search.
Data is lost when the process exits. Implements EmbeddingStore.
Implementations§
Trait Implementations§
Source§impl Default for MemoryEmbeddingStore
impl Default for MemoryEmbeddingStore
Source§fn default() -> MemoryEmbeddingStore
fn default() -> MemoryEmbeddingStore
Returns the “default value” for a type. Read more
Source§impl EmbeddingStore for MemoryEmbeddingStore
impl EmbeddingStore for MemoryEmbeddingStore
Source§fn upsert<'life0, 'async_trait>(
&'life0 self,
record: EmbeddingRecord,
) -> Pin<Box<dyn Future<Output = StoreResult<EmbeddingRecord>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert<'life0, 'async_trait>(
&'life0 self,
record: EmbeddingRecord,
) -> Pin<Box<dyn Future<Output = StoreResult<EmbeddingRecord>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Inserts or updates an embedding record. Read more
Source§fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 [f32],
limit: usize,
) -> Pin<Box<dyn Future<Output = StoreResult<Vec<ScoredEmbedding>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 [f32],
limit: usize,
) -> Pin<Box<dyn Future<Output = StoreResult<Vec<ScoredEmbedding>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns the
limit nearest neighbors to the query vector. Read moreSource§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes an embedding by identifier. Read more
Source§fn delete_by_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_by_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = StoreResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes all embeddings associated with a session. Read more
Auto Trait Implementations§
impl !Freeze for MemoryEmbeddingStore
impl !RefUnwindSafe for MemoryEmbeddingStore
impl Send for MemoryEmbeddingStore
impl Sync for MemoryEmbeddingStore
impl Unpin for MemoryEmbeddingStore
impl UnsafeUnpin for MemoryEmbeddingStore
impl UnwindSafe for MemoryEmbeddingStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more