add emotional system: auto-reflection, inner_state seeding, instance isolation
- doc/heart.md: emotional system design (motivation, reflection, relationship memory) - Auto-reflection: every 10 messages, async LLM call updates inner_state with feelings and understanding changes (not conversation summary) - Life Loop emotional motivation: "you care, not because timer fired" - Remove all instance-specific names from code/docs — persona, name, memories are instance data (SQLite), not code - Rewrite doc/life.md and doc/todo.md for instance isolation principle
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -463,6 +463,16 @@ async fn handle_inner(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// auto-reflect every 10 messages
|
||||
let count = state.message_count(&sid).await;
|
||||
if count % 10 == 0 && count > 0 {
|
||||
let state_c = state.clone();
|
||||
let config_c = config.clone();
|
||||
tokio::spawn(async move {
|
||||
crate::life::reflect(&state_c, &config_c).await;
|
||||
});
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
error!(%sid, "openai: {e:#}");
|
||||
|
||||
Reference in New Issue
Block a user