2026-04-15 03:06:23 -04:00
|
|
|
// identity.rs — Identity context assembly
|
2026-03-25 00:52:41 -04:00
|
|
|
//
|
2026-04-15 03:06:23 -04:00
|
|
|
// Loads the agent's identity from memory nodes.
|
2026-03-25 00:52:41 -04:00
|
|
|
|
2026-04-13 14:55:41 -04:00
|
|
|
use crate::agent::tools::memory::memory_render;
|
2026-03-25 00:52:41 -04:00
|
|
|
|
2026-04-15 02:37:49 -04:00
|
|
|
/// Load memory nodes from the store.
|
2026-04-15 03:06:23 -04:00
|
|
|
pub async fn personality_nodes(keys: &[String]) -> Vec<(String, String)> {
|
2026-03-25 00:52:41 -04:00
|
|
|
let mut memories: Vec<(String, String)> = Vec::new();
|
|
|
|
|
|
2026-04-15 02:37:49 -04:00
|
|
|
for key in keys {
|
|
|
|
|
if let Ok(c) = memory_render(None, key, Some(true)).await {
|
|
|
|
|
if !c.trim().is_empty() {
|
|
|
|
|
memories.push((key.clone(), c));
|
2026-03-25 00:52:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
memories
|
|
|
|
|
}
|