pub struct AinlMemoryNode {
pub id: Uuid,
pub memory_category: MemoryCategory,
pub importance_score: f32,
pub agent_id: String,
pub project_id: Option<String>,
pub node_type: AinlNodeType,
pub edges: Vec<AinlEdge>,
pub plugin_data: Option<Value>,
}Expand description
A node in the AINL memory graph
Fields§
§id: Uuid§memory_category: MemoryCategory§importance_score: f32§agent_id: String§project_id: Option<String>Optional host workspace / repo key (when AINL_MEMORY_PROJECT_SCOPE is enabled).
node_type: AinlNodeType§edges: Vec<AinlEdge>§plugin_data: Option<Value>Freeform extension payload for host-specific metadata that doesn’t fit a typed variant. Stored alongside the node payload; ignored by the core runtime.
Implementations§
Source§impl AinlMemoryNode
impl AinlMemoryNode
Sourcepub fn new_episode(
turn_id: Uuid,
timestamp: i64,
tool_calls: Vec<String>,
delegation_to: Option<String>,
trace_event: Option<Value>,
) -> Self
pub fn new_episode( turn_id: Uuid, timestamp: i64, tool_calls: Vec<String>, delegation_to: Option<String>, trace_event: Option<Value>, ) -> Self
Create a new episode node
Sourcepub fn new_fact(fact: String, confidence: f32, source_turn_id: Uuid) -> Self
pub fn new_fact(fact: String, confidence: f32, source_turn_id: Uuid) -> Self
Create a new semantic fact node
Sourcepub fn new_pattern(pattern_name: String, compiled_graph: Vec<u8>) -> Self
pub fn new_pattern(pattern_name: String, compiled_graph: Vec<u8>) -> Self
Create a new procedural pattern node
Sourcepub fn new_procedural_tools(
pattern_name: String,
tool_sequence: Vec<String>,
confidence: f32,
) -> Self
pub fn new_procedural_tools( pattern_name: String, tool_sequence: Vec<String>, confidence: f32, ) -> Self
Procedural node from a detected tool workflow (no compiled IR).
Sourcepub fn new_persona(
trait_name: String,
strength: f32,
learned_from: Vec<Uuid>,
) -> Self
pub fn new_persona( trait_name: String, strength: f32, learned_from: Vec<Uuid>, ) -> Self
Create a new persona trait node
Sourcepub fn new_trajectory(
trajectory: TrajectoryNode,
agent_id: impl Into<String>,
) -> Self
pub fn new_trajectory( trajectory: TrajectoryNode, agent_id: impl Into<String>, ) -> Self
Create a trajectory node linked to an episode graph row (episode_id = episode node’s id).
Sourcepub fn new_loop_guard_failure(
verdict_label: &str,
tool_name: Option<&str>,
message: impl Into<String>,
session_id: Option<&str>,
) -> Self
pub fn new_loop_guard_failure( verdict_label: &str, tool_name: Option<&str>, message: impl Into<String>, session_id: Option<&str>, ) -> Self
Failure node from the agent loop loop-guard (verdict_label: block | circuit_break).
Sourcepub fn new_tool_execution_failure(
tool_name: &str,
message: impl Into<String>,
session_id: Option<&str>,
) -> Self
pub fn new_tool_execution_failure( tool_name: &str, message: impl Into<String>, session_id: Option<&str>, ) -> Self
Failure node from a host tool execution error (OpenFang tool_runner, MCP dispatch, etc.).
source is fixed to tool_runner:error for FTS recall alongside loop-guard failures.
Sourcepub fn new_tool_execution_failure_with_source(
tool_name: &str,
message: impl Into<String>,
session_id: Option<&str>,
source_namespace: Option<&str>,
source_tool: Option<&str>,
) -> Self
pub fn new_tool_execution_failure_with_source( tool_name: &str, message: impl Into<String>, session_id: Option<&str>, source_namespace: Option<&str>, source_tool: Option<&str>, ) -> Self
Like Self::new_tool_execution_failure, with optional MCP-style source metadata for analytics / recall.
Sourcepub fn new_agent_loop_precheck_failure(
kind: &str,
tool_name: &str,
message: impl Into<String>,
session_id: Option<&str>,
) -> Self
pub fn new_agent_loop_precheck_failure( kind: &str, tool_name: &str, message: impl Into<String>, session_id: Option<&str>, ) -> Self
Failure node for tool calls rejected in the agent loop before execute_tool (hooks,
required-parameter validation, etc.). kind becomes agent_loop:{kind} in FailureNode::source
(e.g. hook_blocked, param_validation) for FTS recall alongside tool_runner:error.
Sourcepub fn new_ainl_runtime_graph_validation_failure(
message: impl Into<String>,
session_id: Option<&str>,
) -> Self
pub fn new_ainl_runtime_graph_validation_failure( message: impl Into<String>, session_id: Option<&str>, ) -> Self
Failure node when ainl-runtime rejects a turn because the loaded graph fails validation
(dangling edges, etc.). Fixed source for FTS recall with other failure origins.
pub fn episodic(&self) -> Option<&EpisodicNode>
pub fn semantic(&self) -> Option<&SemanticNode>
pub fn procedural(&self) -> Option<&ProceduralNode>
pub fn persona(&self) -> Option<&PersonaNode>
pub fn trajectory(&self) -> Option<&TrajectoryNode>
pub fn failure(&self) -> Option<&FailureNode>
Trait Implementations§
Source§impl Clone for AinlMemoryNode
impl Clone for AinlMemoryNode
Source§fn clone(&self) -> AinlMemoryNode
fn clone(&self) -> AinlMemoryNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AinlMemoryNode
impl Debug for AinlMemoryNode
Source§impl<'de> Deserialize<'de> for AinlMemoryNode
impl<'de> Deserialize<'de> for AinlMemoryNode
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl PartialEq for AinlMemoryNode
impl PartialEq for AinlMemoryNode
Source§fn eq(&self, other: &AinlMemoryNode) -> bool
fn eq(&self, other: &AinlMemoryNode) -> bool
self and other values to be equal, and is used by ==.