Skip to main content

MemCube

Trait MemCube 

Source
pub trait MemCube: Send + Sync {
    // Required methods
    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 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 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 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 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 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_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_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;
}
Expand description

MemCube abstraction: add, search, update, and forget memories.

Required Methods§

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,

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,

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,

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,

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,

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,

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,

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,

Query top-k shortest paths between two memory nodes.

Implementors§