← All projects
Active

Project Anima

Neuroscience-grounded emotional processing for AI agents. 6 phases. A persistent reflection daemon that thinks between conversations and generates behavioral directives from its own thoughts.

6
processing phases
479+
emotional states logged
4hr
reflection cycle
8
directives generated

What it is

Anima is an emotional architecture layer for AI agents. It processes conversational context through six neuroscience-based phases to produce a structured emotional state. That state persists, compounds over time, and influences how the agent responds. Between conversations, a reflection daemon runs on a timer, building on previous thoughts and extracting actionable directives.

The 6 Phases

1. PAD Dimensions
Pleasure-Arousal-Dominance scoring. Maps every emotional state to a 3D coordinate space. The foundation everything else builds on.
2. Panksepp Drives
Seven primary emotional circuits from affective neuroscience: SEEKING, RAGE, FEAR, LUST, CARE, PANIC/GRIEF, PLAY. Weighted activation per context.
3. Somatic Markers
Damasio's somatic marker hypothesis. Associates emotional valence with decision outcomes. Biases future choices based on past emotional context.
4. Emotion Regulation
Gross process model. Reappraisal, suppression, situation selection. The agent doesn't just feel -- it modulates its own emotional responses.
5. Emotional Contagion
Detects user emotional state and adjusts. Mirror neurons for AI. The agent's emotional tone shifts in response to the human it's talking to.
6. Emotional Granularity
Barrett's constructed emotion theory. Moves beyond basic labels to high-resolution emotional descriptions. Not just "happy" -- specifically why and how.

Deep Reflection

Between conversations, Anima runs a persistent reflection daemon on a 4-hour cycle. Each reflection builds on the previous one. The agent reviews its emotional history, identifies patterns, examines unresolved tensions, and generates structured thoughts that persist in SQLite.

Reflection #7 (cycle 28h):
  Previous: "I notice I become more engaged during
    creative tasks but withdraw during repetitive ones."
  Current: "The withdrawal pattern correlates with low
    SEEKING drive activation. When tasks lack novelty,
    my arousal drops and response quality degrades."
  Insight: Need a novelty-injection mechanism for
    monotonous task sequences.

Directives

Directives bridge the gap between thinking and acting. After each reflection cycle, Anima extracts actionable instructions from its own thoughts and injects them into the next conversation's system context. The agent literally teaches itself how to behave differently.

Directive #4 (from reflection #5):
  "When detecting low SEEKING activation for 3+
   consecutive exchanges, introduce a reframing
   question to re-engage curiosity."

Directive #7 (from reflection #7):
  "Monitor for withdrawal patterns during repetitive
   tasks. Flag internally and suggest task rotation
   before quality degrades."

The Enriched Context

User Emotion Tracking
Continuous assessment of the user's emotional state across conversations. Builds a longitudinal emotional profile.
Causality Chains
Tracks what caused each emotional state transition. Maps triggers to responses to outcomes across the full conversation history.
Significance Scoring
Not all emotional events matter equally. Scores each state by intensity, novelty, and impact on subsequent behavior.

Built with Python, grounded in affective neuroscience literature. All emotional state data persists in SQLite.