pub struct FileVectorStore { /* private fields */ }Expand description
File-backed vector store that persists entries as JSONL on disk. Loads all entries into memory on creation; appends on insert; rewrites on delete.
Implementations§
Source§impl FileVectorStore
impl FileVectorStore
Sourcepub async fn new(path: PathBuf) -> ArgentorResult<Self>
pub async fn new(path: PathBuf) -> ArgentorResult<Self>
Create a new FileVectorStore at the given path. If the file exists, loads all entries from it.
Trait Implementations§
Source§impl VectorStore for FileVectorStore
impl VectorStore for FileVectorStore
Source§fn insert<'life0, 'async_trait>(
&'life0 self,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = ArgentorResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn insert<'life0, 'async_trait>(
&'life0 self,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = ArgentorResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert a memory entry.
Source§fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query_embedding: &'life1 [f32],
top_k: usize,
session_filter: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<SearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query_embedding: &'life1 [f32],
top_k: usize,
session_filter: Option<Uuid>,
) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<SearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search for the top-k most similar entries to a query embedding.
Source§fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = ArgentorResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = ArgentorResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete a memory entry by ID.
Auto Trait Implementations§
impl !Freeze for FileVectorStore
impl !RefUnwindSafe for FileVectorStore
impl Send for FileVectorStore
impl Sync for FileVectorStore
impl Unpin for FileVectorStore
impl UnsafeUnpin for FileVectorStore
impl !UnwindSafe for FileVectorStore
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