Skip to main content

walrus_daemon/hook/memory/
config.rs

1//! Memory subsystem configuration.
2
3use serde::{Deserialize, Serialize};
4
5/// Memory subsystem configuration.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(default)]
8pub struct MemoryConfig {
9    /// Additional entity types beyond the framework defaults.
10    pub entities: Vec<String>,
11    /// Additional relation types beyond the framework defaults.
12    pub relations: Vec<String>,
13    /// Default limit for `connections` traversal results (default: 20, max: 100).
14    pub connections: usize,
15    /// Enable automatic memory recall before each agent run (default: true).
16    #[serde(default = "default_true")]
17    pub auto_recall: bool,
18}
19
20fn default_true() -> bool {
21    true
22}
23
24impl Default for MemoryConfig {
25    fn default() -> Self {
26        Self {
27            entities: Vec::new(),
28            relations: Vec::new(),
29            connections: 20,
30            auto_recall: true,
31        }
32    }
33}