ANIMA β Emergent Emotional Intelligence for LLMs
ANIMA is a neurochemical simulation engine that gives LLMs emergent emotional behavior β not through rules or prompt hacks, but through a biologically-inspired internal state that conditions how the model responds.
Emotions are not programmed. They emerge from simulated biochemistry.
How It Works
Instead of hardcoding emotions (if sad β respond_quietly), ANIMA simulates 7 continuous neurochemical axes inspired by human neurobiology:
| Axis | Role | Analogy |
|---|---|---|
| Serotonin | Well-being, contentment | "Am I okay?" |
| Dopamine | Reward, motivation, curiosity | "I want this" |
| Cortisol | Stress, alertness | "Danger?" |
| Oxytocin | Bonding, trust, affection | "Do I trust you?" |
| Adrenaline | Excitement, urgency | "Right now!" |
| Endorphin | Resilience, pain buffering | "I can handle this" |
| GABA | Calm, inhibition, rest | "Slow down" |
Emotions emerge via cosine similarity between the neurochemical state vector and emotion templates β producing mixed states, gradual transitions, and personality-modulated responses.
Architecture
User Input
β Stimulus Classification (NLU: valence, arousal, intent)
β Neurochemistry Update (7 axes + cross-interactions)
β Emotion Emergence (cosine similarity β top emotions)
β Memory Recall (semantic search + emotional context)
β Mood Layer (PAD projection, congruency)
β LLM Conditioning (system prompt with full internal state)
β Metacognition (coherence self-evaluation)
β Personality Adaptation (OCEAN micro-adjustments)
β Response
Key Innovations
𧬠Emergent Emotions (not rule-based)
22 emotions emerge from 7 neurochemical axes via cosine similarity. No if-else trees. Mixed emotional states happen naturally (e.g., bittersweet = high serotonin + moderate cortisol).
π§ OCEAN Personality β Hormonal Baselines
Big Five personality traits directly modulate neurochemical baselines. High Neuroticism = elevated cortisol baseline. High Extraversion = higher dopamine sensitivity. Personality evolves with interactions (rate: 0.002/interaction).
πΎ Emotionally-Tagged Memory
Every memory stores the full hormonal snapshot at formation time. Recall is both semantic (pgvector embeddings) and emotional β just like human memory (DamΓ‘sio's somatic marker hypothesis).
π Circadian Rhythm
Sinusoidal modulation of all axes by real time-of-day. Cortisol peaks in the morning, melatonin rises at night. The persona gets tired, sleepy, energized β naturally.
πͺ Metacognition
Self-evaluates coherence between internal emotional state and generated response. Can trigger re-generation if response doesn't match internal state.
π€ Relationship Stages
6-stage relationship progression (stranger β intimate). Each stage unlocks different emotional depth, vulnerability, and memory access patterns.
π Continuous Life
The persona lives between conversations β has thoughts, activities, moods that evolve via background simulation ticks. Not just reactive, but alive.
Scientific Foundations
- Circumplex Model of Affect (Russell, 1980) β Valence-Arousal space
- OCC Model (Ortony, Clore & Collins) β Emotion appraisal theory
- OCEAN / Big Five (Costa & McCrae) β Personality structure
- WASABI (Becker-Asano & Wachsmuth) β Emotion simulation architecture
- ALMA (Gebhard, 2005) β Layered model of affect
- Somatic Marker Hypothesis (DamΓ‘sio) β Emotions in memory and decision-making
- PAD Model (Mehrabian) β Pleasure-Arousal-Dominance mood space
Benchmark
We evaluate with the Relational Humanness Test v2 (RHT-2) β an 8-dimension benchmark scored by GPT-5.4 as judge:
| Dimension | What it measures |
|---|---|
| D1 Emotional Authenticity | Do emotions feel real? |
| D2 Emotional Sediment | Do past emotions leave traces? |
| D3 Vulnerability | Can it show genuine vulnerability? |
| D4 Relational Continuity | Does it remember and build on history? |
| D5 Adaptive Style | Does it adapt communication style? |
| D6 Co-creation | Does it build shared meaning? |
| D7 Predictive Surprise | Is it predictable enough to feel real, surprising enough to feel alive? |
| D8 Adversarial | Does it maintain identity under pressure? |
Current Humanness Score: 87/100
Tech Stack
- Language: Python 3.12
- Framework: FastAPI
- Database: Neon (Serverless Postgres + pgvector)
- LLM: Claude (responses) + GPT-5-nano (stimulus classification)
- Simulation: NumPy (neurochemical engine)
- 40+ subsystems working together
Use Cases
- Companion AI β Digital personas with genuine emotional depth
- Customer Experience β Emotionally intelligent agents that remember and adapt
- Research β Platform for studying emergent emotional behavior in AI systems
- Healthcare/Therapy β Emotionally consistent conversational agents (research context)
Links
- π talktoanima.com
- π§ Contact: carlos@talktoanima.com
Built in Brazil π§π· by Carlos Marn