pub struct NaiveMemCube<G, V, E> {
pub graph: G,
pub vec_store: V,
pub embedder: E,
pub default_scope: String,
}Expand description
MemCube that composes a graph store, vector store, and embedder for add/search.
Fields§
§graph: G§vec_store: V§embedder: E§default_scope: StringDefault scope for new memories (e.g. LongTermMemory).
Implementations§
Trait Implementations§
Source§impl<G, V, E> MemCube for NaiveMemCube<G, V, E>
impl<G, V, E> MemCube for NaiveMemCube<G, V, E>
Source§fn add_memories<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ApiAddRequest,
) -> Pin<Box<dyn Future<Output = Result<MemoryResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_memories<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ApiAddRequest,
) -> Pin<Box<dyn Future<Output = Result<MemoryResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add memories from request; returns MemoryResponse.
Source§fn search_memories<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ApiSearchRequest,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_memories<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ApiSearchRequest,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search memories from request; returns SearchResponse.
Source§fn update_memory<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 UpdateMemoryRequest,
) -> Pin<Box<dyn Future<Output = Result<UpdateMemoryResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_memory<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 UpdateMemoryRequest,
) -> Pin<Box<dyn Future<Output = Result<UpdateMemoryResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update an existing memory (partial fields); re-embeds if memory text changed.
Source§fn forget_memory<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ForgetMemoryRequest,
) -> Pin<Box<dyn Future<Output = Result<ForgetMemoryResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn forget_memory<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 ForgetMemoryRequest,
) -> Pin<Box<dyn Future<Output = Result<ForgetMemoryResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Forget (soft or hard delete) a memory.
Source§fn get_memory<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 GetMemoryRequest,
) -> Pin<Box<dyn Future<Output = Result<GetMemoryResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_memory<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 GetMemoryRequest,
) -> Pin<Box<dyn Future<Output = Result<GetMemoryResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a single memory by id (within user/cube scope).
Source§fn graph_neighbors<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 GraphNeighborsRequest,
) -> Pin<Box<dyn Future<Output = Result<GraphNeighborsResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn graph_neighbors<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 GraphNeighborsRequest,
) -> Pin<Box<dyn Future<Output = Result<GraphNeighborsResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query graph neighbors for one memory id.
Source§fn graph_path<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 GraphPathRequest,
) -> Pin<Box<dyn Future<Output = Result<GraphPathResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn graph_path<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 GraphPathRequest,
) -> Pin<Box<dyn Future<Output = Result<GraphPathResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query shortest path between two memory nodes.
Source§fn graph_paths<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 GraphPathsRequest,
) -> Pin<Box<dyn Future<Output = Result<GraphPathsResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn graph_paths<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 GraphPathsRequest,
) -> Pin<Box<dyn Future<Output = Result<GraphPathsResponse, MemCubeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query top-k shortest paths between two memory nodes.
Auto Trait Implementations§
impl<G, V, E> Freeze for NaiveMemCube<G, V, E>
impl<G, V, E> RefUnwindSafe for NaiveMemCube<G, V, E>
impl<G, V, E> Send for NaiveMemCube<G, V, E>
impl<G, V, E> Sync for NaiveMemCube<G, V, E>
impl<G, V, E> Unpin for NaiveMemCube<G, V, E>
impl<G, V, E> UnsafeUnpin for NaiveMemCube<G, V, E>
impl<G, V, E> UnwindSafe for NaiveMemCube<G, V, E>
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