pub struct GraphBuilder { /* private fields */ }Expand description
Fluent builder for constructing a MemoryGraph.
Implementations§
Source§impl GraphBuilder
impl GraphBuilder
Sourcepub fn with_dimension(dim: usize) -> Self
pub fn with_dimension(dim: usize) -> Self
Create a new builder with a specific dimension.
Sourcepub fn add_fact(
&mut self,
content: &str,
session_id: u32,
confidence: f32,
) -> u64
pub fn add_fact( &mut self, content: &str, session_id: u32, confidence: f32, ) -> u64
Add a fact.
Sourcepub fn add_decision(
&mut self,
content: &str,
session_id: u32,
confidence: f32,
) -> u64
pub fn add_decision( &mut self, content: &str, session_id: u32, confidence: f32, ) -> u64
Add a decision.
Sourcepub fn add_inference(
&mut self,
content: &str,
session_id: u32,
confidence: f32,
) -> u64
pub fn add_inference( &mut self, content: &str, session_id: u32, confidence: f32, ) -> u64
Add an inference.
Sourcepub fn add_correction(
&mut self,
content: &str,
session_id: u32,
old_node_id: u64,
) -> u64
pub fn add_correction( &mut self, content: &str, session_id: u32, old_node_id: u64, ) -> u64
Add a correction (automatically creates SUPERSEDES edge to old_node_id).
Sourcepub fn add_skill(
&mut self,
content: &str,
session_id: u32,
confidence: f32,
) -> u64
pub fn add_skill( &mut self, content: &str, session_id: u32, confidence: f32, ) -> u64
Add a skill.
Sourcepub fn add_episode(
&mut self,
content: &str,
session_id: u32,
member_node_ids: &[u64],
) -> u64
pub fn add_episode( &mut self, content: &str, session_id: u32, member_node_ids: &[u64], ) -> u64
Add an episode summary (automatically creates PART_OF edges).
Sourcepub fn link(
&mut self,
source_id: u64,
target_id: u64,
edge_type: EdgeType,
weight: f32,
) -> &mut Self
pub fn link( &mut self, source_id: u64, target_id: u64, edge_type: EdgeType, weight: f32, ) -> &mut Self
Add an edge between two nodes.
Sourcepub fn set_feature_vec(&mut self, node_id: u64, vec: Vec<f32>) -> &mut Self
pub fn set_feature_vec(&mut self, node_id: u64, vec: Vec<f32>) -> &mut Self
Set feature vector for a node.
Sourcepub fn build(self) -> AmemResult<MemoryGraph>
pub fn build(self) -> AmemResult<MemoryGraph>
Build the final MemoryGraph.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphBuilder
impl RefUnwindSafe for GraphBuilder
impl Send for GraphBuilder
impl Sync for GraphBuilder
impl Unpin for GraphBuilder
impl UnsafeUnpin for GraphBuilder
impl UnwindSafe for GraphBuilder
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