Skip to main content

AgentStore

Trait AgentStore 

Source
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 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§

Source

fn prepare_recovery(&self) -> Result<(), RuntimeError>

Source

fn create_agent( &self, record: &PersistedAgentRecord, memory: &AgentMemoryState, ) -> Result<(), RuntimeError>

Source

fn save_agent_record( &self, record: &PersistedAgentRecord, ) -> Result<(), RuntimeError>

Source

fn save_agent_memory( &self, agent_id: &str, memory: &AgentMemoryState, ) -> Result<(), RuntimeError>

Source

fn load_agent( &self, agent_id: &str, ) -> Result<Option<LoadedAgentState>, RuntimeError>

Source

fn list_agents(&self) -> Result<Vec<LoadedAgentState>, RuntimeError>

Source

fn list_agents_by_runtime( &self, runtime_identifier: &str, ) -> Result<Vec<LoadedAgentState>, RuntimeError>

Provided Methods§

Source

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".

Implementors§