pub struct SqliteStoreRef<'a> { /* private fields */ }Expand description
Borrowed view of the backing SQLite store (see crate::AinlRuntime::sqlite_store).
Methods from Deref<Target = SqliteGraphStore>§
pub fn query<'a>(&'a self, agent_id: &str) -> GraphQuery<'a>
Sourcepub fn insert_graph_edge(
&self,
from_id: Uuid,
to_id: Uuid,
label: &str,
) -> Result<(), String>
pub fn insert_graph_edge( &self, from_id: Uuid, to_id: Uuid, label: &str, ) -> Result<(), String>
Insert a directed edge between two node IDs (separate from per-node edge payloads).
Sourcepub fn insert_graph_edge_checked(
&self,
from_id: Uuid,
to_id: Uuid,
label: &str,
) -> Result<(), String>
pub fn insert_graph_edge_checked( &self, from_id: Uuid, to_id: Uuid, label: &str, ) -> Result<(), String>
Like Self::insert_graph_edge, but verifies both endpoints exist first (clear errors for strict runtime wiring).
Sourcepub fn insert_graph_edge_with_meta(
&self,
from_id: Uuid,
to_id: Uuid,
label: &str,
weight: f32,
metadata: Option<&Value>,
) -> Result<(), String>
pub fn insert_graph_edge_with_meta( &self, from_id: Uuid, to_id: Uuid, label: &str, weight: f32, metadata: Option<&Value>, ) -> Result<(), String>
Same as Self::insert_graph_edge, with optional edge weight and JSON metadata.
Sourcepub fn query_nodes_by_type_since(
&self,
node_type: &str,
since_timestamp: i64,
limit: usize,
) -> Result<Vec<AinlMemoryNode>, String>
pub fn query_nodes_by_type_since( &self, node_type: &str, since_timestamp: i64, limit: usize, ) -> Result<Vec<AinlMemoryNode>, String>
Nodes of a given node_type with timestamp >= since_timestamp, most recent first.
Sourcepub fn read_runtime_state(
&self,
agent_id: &str,
) -> Result<Option<RuntimeStateNode>, String>
pub fn read_runtime_state( &self, agent_id: &str, ) -> Result<Option<RuntimeStateNode>, String>
Read the most recent persisted RuntimeStateNode for agent_id, if any.
Rows are stored with node_type = 'runtime_state' and JSON $.node_type.runtime_state.agent_id matching the agent.
Sourcepub fn write_runtime_state(
&self,
state: &RuntimeStateNode,
) -> Result<(), String>
pub fn write_runtime_state( &self, state: &RuntimeStateNode, ) -> Result<(), String>
Upsert one RuntimeStateNode row per agent (stable id via Uuid::new_v5).
Sourcepub fn validate_graph(
&self,
agent_id: &str,
) -> Result<GraphValidationReport, String>
pub fn validate_graph( &self, agent_id: &str, ) -> Result<GraphValidationReport, String>
Validate structural integrity for one agent’s induced subgraph.
Sourcepub fn validate_graph_checked(
&self,
agent_id: &str,
) -> Result<GraphValidationReport, GraphValidationError>
pub fn validate_graph_checked( &self, agent_id: &str, ) -> Result<GraphValidationReport, GraphValidationError>
Typed validation variant for callers that need structured error handling.
Sourcepub fn agent_subgraph_edges(
&self,
agent_id: &str,
) -> Result<Vec<SnapshotEdge>, String>
pub fn agent_subgraph_edges( &self, agent_id: &str, ) -> Result<Vec<SnapshotEdge>, String>
Directed edges where both endpoints are nodes owned by agent_id (aligned with Self::export_graph edge set).
Sourcepub fn export_graph(&self, agent_id: &str) -> Result<AgentGraphSnapshot, String>
pub fn export_graph(&self, agent_id: &str) -> Result<AgentGraphSnapshot, String>
Export all nodes and interconnecting edges for agent_id.
Sourcepub fn insert_trajectory_detail(
&self,
row: &TrajectoryDetailRecord,
) -> Result<(), String>
pub fn insert_trajectory_detail( &self, row: &TrajectoryDetailRecord, ) -> Result<(), String>
Large-step trajectory row (sibling table); episode row must exist first.
Sourcepub fn list_trajectories_for_agent(
&self,
agent_id: &str,
limit: usize,
since_timestamp: Option<i64>,
) -> Result<Vec<TrajectoryDetailRecord>, String>
pub fn list_trajectories_for_agent( &self, agent_id: &str, limit: usize, since_timestamp: Option<i64>, ) -> Result<Vec<TrajectoryDetailRecord>, String>
Recent trajectory detail rows for an agent (newest first).
Sourcepub fn count_trajectory_details_before(
&self,
agent_id: &str,
before_unix: i64,
) -> Result<usize, String>
pub fn count_trajectory_details_before( &self, agent_id: &str, before_unix: i64, ) -> Result<usize, String>
Count ainl_trajectories rows for agent_id with recorded_at strictly before before_unix (seconds).
Sourcepub fn delete_trajectory_details_before(
&self,
agent_id: &str,
before_unix: i64,
) -> Result<usize, String>
pub fn delete_trajectory_details_before( &self, agent_id: &str, before_unix: i64, ) -> Result<usize, String>
Delete ainl_trajectories detail rows for agent_id with recorded_at strictly before
before_unix (seconds). Returns the number of rows removed.
This does not delete Trajectory nodes from ainl_graph_nodes or any edges; use graph
export / repair paths if you need a fully consistent graph after bulk pruning.
Sourcepub fn search_failures_fts_for_agent(
&self,
agent_id: &str,
query: &str,
limit: usize,
) -> Result<Vec<AinlMemoryNode>, String>
pub fn search_failures_fts_for_agent( &self, agent_id: &str, query: &str, limit: usize, ) -> Result<Vec<AinlMemoryNode>, String>
Full-text search over persisted failure nodes for one agent (node_type = failure).
Returns matching AinlMemoryNode rows (newest first). Invalid FTS syntax yields an empty list.
Sourcepub fn search_all_nodes_fts_for_agent(
&self,
agent_id: &str,
query: &str,
project_id: Option<&str>,
limit: usize,
) -> Result<Vec<AinlMemoryNode>, String>
pub fn search_all_nodes_fts_for_agent( &self, agent_id: &str, query: &str, project_id: Option<&str>, limit: usize, ) -> Result<Vec<AinlMemoryNode>, String>
Full-text search over all graph node JSON payloads (see ainl_nodes_fts), scoped by agent.
project_id: when Some (non-empty), return matches whose stored project is empty/NULL
or equal to that id (so legacy unscoped rows remain visible in a project workspace).
When None, do not filter by project.