pub trait AgentStore: Send + Sync {
// Required methods
fn prepare_recovery(&self) -> Result<(), RuntimeError>;
fn create_agent(
&self,
record: &PersistedAgentRecord,
memory: &AgentMemoryState,
) -> Result<(), RuntimeError>;
fn save_agent_record(
&self,
record: &PersistedAgentRecord,
) -> Result<(), RuntimeError>;
fn save_agent_memory(
&self,
agent_id: &str,
memory: &AgentMemoryState,
) -> Result<(), RuntimeError>;
fn load_agent(
&self,
agent_id: &str,
) -> Result<Option<LoadedAgentState>, RuntimeError>;
fn delete_agent(&self, agent_id: &str) -> Result<(), RuntimeError>;
fn list_agents(&self) -> Result<Vec<LoadedAgentState>, RuntimeError>;
fn list_agents_by_runtime(
&self,
runtime_identifier: &str,
) -> Result<Vec<LoadedAgentState>, RuntimeError>;
// Provided method
fn allows_disk_artifacts(&self) -> bool { ... }
}Expand description
Persistence backend for agent records and working-memory snapshots.
Custom runtime backends implement this trait to store durable agent identity, configuration, and transcript state.
Required Methods§
fn prepare_recovery(&self) -> Result<(), RuntimeError>
fn create_agent( &self, record: &PersistedAgentRecord, memory: &AgentMemoryState, ) -> Result<(), RuntimeError>
fn save_agent_record( &self, record: &PersistedAgentRecord, ) -> Result<(), RuntimeError>
fn save_agent_memory( &self, agent_id: &str, memory: &AgentMemoryState, ) -> Result<(), RuntimeError>
fn load_agent( &self, agent_id: &str, ) -> Result<Option<LoadedAgentState>, RuntimeError>
Sourcefn delete_agent(&self, agent_id: &str) -> Result<(), RuntimeError>
fn delete_agent(&self, agent_id: &str) -> Result<(), RuntimeError>
Removes an agent’s record, persisted memory, and session-scoped permission rules.
Removing the record without its memory leaves an unreachable row; retaining its session rules leaves private, unreachable decisions. Implementations must remove all three while preserving shared project- and global-scoped rules. Deleting an agent that is not there succeeds and still removes orphaned session rules: the caller’s goal is that all state owned by that agent be gone.
fn list_agents(&self) -> Result<Vec<LoadedAgentState>, RuntimeError>
fn list_agents_by_runtime( &self, runtime_identifier: &str, ) -> Result<Vec<LoadedAgentState>, RuntimeError>
Provided Methods§
Sourcefn allows_disk_artifacts(&self) -> bool
fn allows_disk_artifacts(&self) -> bool
Returns whether runtime-managed auxiliary artifacts may be written to disk for agents backed by this store.
Persistent stores allow artifacts by default. Volatile stores override this capability so features such as full tool-output spilling preserve their no-durable-trace contract.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".