pub struct PgVectorStore { /* private fields */ }Expand description
pgvector adapter for PostgreSQL with the vector extension.
Implementations§
Source§impl PgVectorStore
impl PgVectorStore
Sourcepub fn new(
connection_string: impl Into<String>,
table_name: impl Into<String>,
dimension: usize,
) -> Self
pub fn new( connection_string: impl Into<String>, table_name: impl Into<String>, dimension: usize, ) -> Self
Create a new pgvector adapter in stub mode.
The vector column defaults to "embedding". Use
Self::with_vector_column to override.
Sourcepub fn with_vector_column(self, column: impl Into<String>) -> Self
pub fn with_vector_column(self, column: impl Into<String>) -> Self
Override the vector column name (default "embedding").
Sourcepub fn table_name(&self) -> &str
pub fn table_name(&self) -> &str
Return the configured table name.
Sourcepub fn vector_column(&self) -> &str
pub fn vector_column(&self) -> &str
Return the configured vector column name.
Sourcepub fn connection_string(&self) -> &str
pub fn connection_string(&self) -> &str
Return the configured connection string.
Sourcepub fn render_insert_sql(&self) -> String
pub fn render_insert_sql(&self) -> String
Render a stub SQL INSERT statement for documentation / debug.
This does NOT execute anything — it is a helper that makes the underlying SQL shape visible for tests and for users planning a real driver integration.
Sourcepub fn render_search_sql(&self) -> String
pub fn render_search_sql(&self) -> String
Render a stub SQL SELECT statement for cosine similarity search.
Trait Implementations§
Source§impl VectorStore for PgVectorStore
impl VectorStore for PgVectorStore
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 PgVectorStore
impl !RefUnwindSafe for PgVectorStore
impl Send for PgVectorStore
impl Sync for PgVectorStore
impl Unpin for PgVectorStore
impl UnsafeUnpin for PgVectorStore
impl !UnwindSafe for PgVectorStore
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