1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! Memory and persistence module for Acton-AI.
//!
//! This module provides persistent storage capabilities using libSQL (Turso's SQLite fork).
//! It enables agents to save and restore conversation history, state, and memories with
//! optional vector embeddings for semantic search.
//!
//! ## Architecture
//!
//! - [`MemoryStore`]: Actor that manages all database operations asynchronously
//! - [`PersistenceConfig`]: Configuration for database connections
//! - [`AgentStateSnapshot`]: Serializable agent state for persistence
//! - [`Embedding`]: Vector embeddings for semantic memory search
//! - [`EmbeddingProvider`]: Trait for embedding generation services
//! - [`Memory`]: A memory entry with optional embedding
//! - [`ContextWindow`]: Context window management for LLM interactions
//!
//! ## Example
//!
//! ```rust,ignore
//! use acton_ai::prelude::*;
//! use acton_ai::memory::{
//! MemoryStore, InitMemoryStore, PersistenceConfig,
//! StoreMemory, SearchMemories, StubEmbeddingProvider, EmbeddingProvider,
//! };
//!
//! #[tokio::main]
//! async fn main() {
//! let mut runtime = ActonApp::launch_async().await;
//!
//! // Spawn memory store
//! let store = MemoryStore::spawn(&mut runtime).await;
//!
//! // Initialize with in-memory database for testing
//! store.send(InitMemoryStore {
//! config: PersistenceConfig::in_memory(),
//! }).await;
//!
//! // Store a memory with embedding
//! let provider = StubEmbeddingProvider::default();
//! let embedding = provider.embed("User prefers dark mode").await.unwrap();
//!
//! let agent_id = AgentId::new();
//! store.send(StoreMemory {
//! agent_id: agent_id.clone(),
//! content: "User prefers dark mode".to_string(),
//! embedding: Some(embedding),
//! }).await;
//!
//! runtime.shutdown_all().await.unwrap();
//! }
//! ```
// Re-export context window types
pub use ;
// Re-export embedding types
pub use ;
// Re-export error types
pub use ;
// Re-export persistence types
pub use ;
// Re-export store types and messages
pub use ;