Carlosmarn commited on
Commit
b825d51
Β·
verified Β·
1 Parent(s): 72b4a53

Add model card: ANIMA neurochemical emotional engine

Browse files
Files changed (1) hide show
  1. README.md +132 -0
README.md ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Anima AI
3
+ emoji: 🧠
4
+ colorFrom: purple
5
+ colorTo: indigo
6
+ pinned: true
7
+ tags:
8
+ - affective-computing
9
+ - emotional-ai
10
+ - neurochemical-simulation
11
+ - personality-modeling
12
+ - ocean-big-five
13
+ - emergent-emotions
14
+ - conversational-ai
15
+ - cognitive-architecture
16
+ - companion-ai
17
+ - digital-persona
18
+ - computational-psychology
19
+ - embodied-cognition
20
+ ---
21
+
22
+ # ANIMA β€” Emergent Emotional Intelligence for LLMs
23
+
24
+ **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.
25
+
26
+ > Emotions are not programmed. They **emerge** from simulated biochemistry.
27
+
28
+ ## How It Works
29
+
30
+ Instead of hardcoding emotions (`if sad β†’ respond_quietly`), ANIMA simulates **7 continuous neurochemical axes** inspired by human neurobiology:
31
+
32
+ | Axis | Role | Analogy |
33
+ |------|------|---------|
34
+ | **Serotonin** | Well-being, contentment | "Am I okay?" |
35
+ | **Dopamine** | Reward, motivation, curiosity | "I want this" |
36
+ | **Cortisol** | Stress, alertness | "Danger?" |
37
+ | **Oxytocin** | Bonding, trust, affection | "Do I trust you?" |
38
+ | **Adrenaline** | Excitement, urgency | "Right now!" |
39
+ | **Endorphin** | Resilience, pain buffering | "I can handle this" |
40
+ | **GABA** | Calm, inhibition, rest | "Slow down" |
41
+
42
+ Emotions emerge via **cosine similarity** between the neurochemical state vector and emotion templates β€” producing mixed states, gradual transitions, and personality-modulated responses.
43
+
44
+ ## Architecture
45
+
46
+ ```
47
+ User Input
48
+ β†’ Stimulus Classification (NLU: valence, arousal, intent)
49
+ β†’ Neurochemistry Update (7 axes + cross-interactions)
50
+ β†’ Emotion Emergence (cosine similarity β†’ top emotions)
51
+ β†’ Memory Recall (semantic search + emotional context)
52
+ β†’ Mood Layer (PAD projection, congruency)
53
+ β†’ LLM Conditioning (system prompt with full internal state)
54
+ β†’ Metacognition (coherence self-evaluation)
55
+ β†’ Personality Adaptation (OCEAN micro-adjustments)
56
+ β†’ Response
57
+ ```
58
+
59
+ ## Key Innovations
60
+
61
+ ### 🧬 Emergent Emotions (not rule-based)
62
+ 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).
63
+
64
+ ### 🧠 OCEAN Personality β†’ Hormonal Baselines
65
+ 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).
66
+
67
+ ### πŸ’Ύ Emotionally-Tagged Memory
68
+ 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).
69
+
70
+ ### πŸŒ™ Circadian Rhythm
71
+ 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.
72
+
73
+ ### πŸͺž Metacognition
74
+ Self-evaluates coherence between internal emotional state and generated response. Can trigger re-generation if response doesn't match internal state.
75
+
76
+ ### 🀝 Relationship Stages
77
+ 6-stage relationship progression (stranger β†’ intimate). Each stage unlocks different emotional depth, vulnerability, and memory access patterns.
78
+
79
+ ### 🎭 Continuous Life
80
+ The persona lives between conversations β€” has thoughts, activities, moods that evolve via background simulation ticks. Not just reactive, but alive.
81
+
82
+ ## Scientific Foundations
83
+
84
+ - **Circumplex Model of Affect** (Russell, 1980) β€” Valence-Arousal space
85
+ - **OCC Model** (Ortony, Clore & Collins) β€” Emotion appraisal theory
86
+ - **OCEAN / Big Five** (Costa & McCrae) β€” Personality structure
87
+ - **WASABI** (Becker-Asano & Wachsmuth) β€” Emotion simulation architecture
88
+ - **ALMA** (Gebhard, 2005) β€” Layered model of affect
89
+ - **Somatic Marker Hypothesis** (DamΓ‘sio) β€” Emotions in memory and decision-making
90
+ - **PAD Model** (Mehrabian) β€” Pleasure-Arousal-Dominance mood space
91
+
92
+ ## Benchmark
93
+
94
+ We evaluate with the **Relational Humanness Test v2 (RHT-2)** β€” an 8-dimension benchmark scored by GPT-5.4 as judge:
95
+
96
+ | Dimension | What it measures |
97
+ |-----------|-----------------|
98
+ | D1 Emotional Authenticity | Do emotions feel real? |
99
+ | D2 Emotional Sediment | Do past emotions leave traces? |
100
+ | D3 Vulnerability | Can it show genuine vulnerability? |
101
+ | D4 Relational Continuity | Does it remember and build on history? |
102
+ | D5 Adaptive Style | Does it adapt communication style? |
103
+ | D6 Co-creation | Does it build shared meaning? |
104
+ | D7 Predictive Surprise | Is it predictable enough to feel real, surprising enough to feel alive? |
105
+ | D8 Adversarial | Does it maintain identity under pressure? |
106
+
107
+ **Current Humanness Score: 87/100**
108
+
109
+ ## Tech Stack
110
+
111
+ - **Language:** Python 3.12
112
+ - **Framework:** FastAPI
113
+ - **Database:** Neon (Serverless Postgres + pgvector)
114
+ - **LLM:** Claude (responses) + GPT-5-nano (stimulus classification)
115
+ - **Simulation:** NumPy (neurochemical engine)
116
+ - **40+ subsystems** working together
117
+
118
+ ## Use Cases
119
+
120
+ - **Companion AI** β€” Digital personas with genuine emotional depth
121
+ - **Customer Experience** β€” Emotionally intelligent agents that remember and adapt
122
+ - **Research** β€” Platform for studying emergent emotional behavior in AI systems
123
+ - **Healthcare/Therapy** β€” Emotionally consistent conversational agents (research context)
124
+
125
+ ## Links
126
+
127
+ - 🌐 [talktoanima.com](https://www.talktoanima.com)
128
+ - πŸ“§ Contact: carlos@talktoanima.com
129
+
130
+ ---
131
+
132
+ *Built in Brazil πŸ‡§πŸ‡· by Carlos Marn*