Skip to main content

Crate agentstategraph

Crate agentstategraph 

Source
Expand description

stategraph — AI-native versioned state store for intent-based systems.

This is the high-level API crate that ties together agentstategraph-core (types, algorithms) and agentstategraph-storage (pluggable backends) into a usable Repository interface.

§Quick Start

ⓘ
use agentstategraph::Repository;
use agentstategraph_storage::SqliteStorage;
use agentstategraph_core::{IntentCategory, Intent};

let storage = SqliteStorage::in_memory().expect("in-memory sqlite");
let mut repo = Repository::new(Box::new(storage));

Re-exports§

pub use repo::CommitOptions;
pub use repo::HistoryExtractReport;
pub use repo::META_PATH_PREFIX;
pub use repo::META_SCHEMA_VERSION_PATH;
pub use repo::RepoError;
pub use repo::Repository;
pub use repo::RetentionPolicy;
pub use repo::SCHEMA_VERSION;
pub use session::CreateSessionParams;
pub use session::SessionError;
pub use session::SessionManager;
pub use speculation::SpecComparison;
pub use speculation::SpecHandle;
pub use speculation::SpeculationManager;
pub use watch::PathPattern;
pub use watch::SubscriptionId;
pub use watch::WatchEvent;
pub use watch::WatchManager;
pub use agentstategraph_core as core;
pub use agentstategraph_storage as storage;

Modules§

repo
Repository — the high-level API for AgentStateGraph.
session
Agent sessions — working contexts for sub-agent orchestration.
speculation
Speculative execution — first-class primitive for exploring alternatives.
taint
Repository-level taint / quarantine / watch methods (0.7.75 §4).
tree
State tree operations — get, set, delete values by path.
watch
Watch / subscribe system — reactive agents get notified of state changes.

Structs§

CommitTrace
The trace a commit was made in (DESIGN.md Plan H t-009), as W3C trace context ids in lowercase hex. It’s kept beside the commit, never in it, so commit ids and sync bundles don’t depend on telemetry.
Session
A durable agent session record.

Functions§

emit_commit_events
Emit each commit that lands on a ref as an asg.commit event (DESIGN.md Plan H t-010), so a log backend or SIEM can index state changes beside traces. Off until turned on.
link_commits_to_traces
Link every commit this process makes to the trace it’s made in (DESIGN.md Plan H t-009). source returns the current trace, or None outside one; the server passes oxtel’s current span context. Each commit’s trace and span ids are kept beside it in the store, never in it, and Repository::commit_trace reads them back. Without a source, nothing is recorded.