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_by_type(
&self,
type_name: &str,
) -> Result<Vec<AinlMemoryNode>, String>;
fn query_recent_episodes(
&self,
agent_id: &str,
limit: usize,
) -> Result<Vec<AinlMemoryNode>, String>;
fn walk_edges(
&self,
from_id: Uuid,
label: &str,
) -> Result<Vec<AinlMemoryNode>, String>;
}Expand description
Graph memory storage - trait for swappable backends (Note: Send + Sync removed for spike - will use Arc<Mutex<>> in production)
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_by_type(&self, type_name: &str) -> Result<Vec<AinlMemoryNode>, String>
fn query_by_type(&self, type_name: &str) -> Result<Vec<AinlMemoryNode>, String>
Query nodes by type
Sourcefn query_recent_episodes(
&self,
agent_id: &str,
limit: usize,
) -> Result<Vec<AinlMemoryNode>, String>
fn query_recent_episodes( &self, agent_id: &str, limit: usize, ) -> Result<Vec<AinlMemoryNode>, String>
Query recent episodes for an agent
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 the graph from a starting node