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§
Sourcefn write_node(&self, node: &AinlMemoryNode) -> Result<(), String>
fn write_node(&self, node: &AinlMemoryNode) -> Result<(), String>
Write a node to storage
Sourcefn query_episodes_since(
&self,
since_timestamp: i64,
limit: usize,
) -> Result<Vec<AinlMemoryNode>, String>
fn query_episodes_since( &self, since_timestamp: i64, limit: usize, ) -> Result<Vec<AinlMemoryNode>, String>
Query episodes since a given timestamp
Sourcefn find_by_type(&self, type_name: &str) -> Result<Vec<AinlMemoryNode>, String>
fn find_by_type(&self, type_name: &str) -> Result<Vec<AinlMemoryNode>, String>
Find nodes by type
Sourcefn walk_edges(
&self,
from_id: Uuid,
label: &str,
) -> Result<Vec<AinlMemoryNode>, String>
fn walk_edges( &self, from_id: Uuid, label: &str, ) -> Result<Vec<AinlMemoryNode>, String>
Walk edges from a node with a given label