Skip to main content

GraphStore

Trait GraphStore 

Source
pub trait GraphStore {
    // Required methods
    fn write_node(&self, node: &AinlMemoryNode) -> Result<(), String>;
    fn read_node(&self, id: Uuid) -> Result<Option<AinlMemoryNode>, String>;
    fn query_episodes_since(
        &self,
        since_timestamp: i64,
        limit: usize,
    ) -> Result<Vec<AinlMemoryNode>, String>;
    fn find_by_type(
        &self,
        type_name: &str,
    ) -> Result<Vec<AinlMemoryNode>, String>;
    fn walk_edges(
        &self,
        from_id: Uuid,
        label: &str,
    ) -> Result<Vec<AinlMemoryNode>, String>;
}
Expand description

Graph memory storage trait - swappable backends

Required Methods§

Source

fn write_node(&self, node: &AinlMemoryNode) -> Result<(), String>

Write a node to storage

Source

fn read_node(&self, id: Uuid) -> Result<Option<AinlMemoryNode>, String>

Read a node by ID

Source

fn query_episodes_since( &self, since_timestamp: i64, limit: usize, ) -> Result<Vec<AinlMemoryNode>, String>

Query episodes since a given timestamp

Source

fn find_by_type(&self, type_name: &str) -> Result<Vec<AinlMemoryNode>, String>

Find nodes by type

Source

fn walk_edges( &self, from_id: Uuid, label: &str, ) -> Result<Vec<AinlMemoryNode>, String>

Walk edges from a node with a given label

Implementors§