Skip to main content

Module persistence

Module persistence 

Source
Expand description

Agent Persistence and State Management

This module provides comprehensive persistence capabilities for AI agents:

  • State Snapshots: Serialize and restore complete agent state
  • Conversation History: Store and retrieve conversation threads
  • Checkpointing: Automatic and manual checkpoints for recovery
  • State Versioning: Track state changes over time
  • Storage Backends: SQLite, file-based, and in-memory options
  • Migration Support: Handle schema changes between versions

Structs§

AgentState
Agent state that can be persisted
Attachment
An attachment to a message
Checkpoint
A checkpoint for recovery
CheckpointConfig
Configuration for automatic checkpointing
Conversation
A conversation thread
FileBackend
File-based persistence backend
MemoryBackend
In-memory persistence backend (for testing)
Message
A message in a conversation
PersistenceManager
Main persistence manager
StorageStats
Storage statistics
ToolCall
A tool call made by the agent

Enums§

AttachmentType
CheckpointType
MessageRole
ToolCallStatus

Traits§

PersistenceBackend
Storage backend for persistence

Functions§

persistence_builtins
Create builtin functions for persistence

Type Aliases§

AgentId
Unique identifier for agent instances
CheckpointId
Unique identifier for checkpoints
ConversationId
Unique identifier for conversations