Spaces:
Sleeping
Sleeping
Initial README with project documentation
Browse files
README.md
CHANGED
|
@@ -1,12 +1,78 @@
|
|
| 1 |
---
|
| 2 |
-
title: Limbic Reasoning Agent
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: "π§ Limbic-Modulated Reasoning Agent"
|
| 3 |
+
emoji: π§
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: "5.33.0"
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
short_description: "LLM with real-time neuro-behavioral state modulation"
|
| 12 |
+
tags:
|
| 13 |
+
- psychology
|
| 14 |
+
- neuroscience
|
| 15 |
+
- reasoning
|
| 16 |
+
- limbic-system
|
| 17 |
+
- emotion
|
| 18 |
+
- agents
|
| 19 |
---
|
| 20 |
|
| 21 |
+
# π§ Limbic-Modulated Reasoning Agent
|
| 22 |
+
|
| 23 |
+
An LLM whose **reasoning behavior adapts in real-time** based on a simulated neuro-behavioral state engine.
|
| 24 |
+
|
| 25 |
+
## How It Works
|
| 26 |
+
|
| 27 |
+
```
|
| 28 |
+
User Message β Limbic Engine β Modulate LLM Parameters β Generate Response
|
| 29 |
+
β β
|
| 30 |
+
ββ Arousal/Valence ββ Temperature (fearβ seekingβ)
|
| 31 |
+
ββ 4 Affective ββ Top-p (fear=tight, seek=wide)
|
| 32 |
+
β Engines ββ Behavioral Directive
|
| 33 |
+
ββ Hormones ββ Active Instincts
|
| 34 |
+
ββ Psychological ββ Self-Debug Protocol
|
| 35 |
+
Lattice
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
### Core Formulas (from [LIMBIC-system-PACKGE](https://github.com/Xover-Official/LIMBIC-system-PACKGE))
|
| 39 |
+
|
| 40 |
+
| Formula | Source | Effect |
|
| 41 |
+
|---------|--------|--------|
|
| 42 |
+
| `temp = 1.0 - fearΓ0.9 + seekingΓ2.0` | `amygdala.py` | Fear β deterministic, Seeking β creative |
|
| 43 |
+
| `hormone[t+1] = h[t] + (baseline - h[t]) Γ 0.05` | `endocrine.py` | Hormones decay toward homeostasis |
|
| 44 |
+
| `fear_mod = 1.0 + cortisol - oxytocinΓ0.5` | `fear.py` | Cortisol amplifies fear, oxytocin dampens |
|
| 45 |
+
| `shadow += 0.1 Γ suppressed_count` | `lattice.py` | Suppressed drives build up, may "outburst" |
|
| 46 |
+
|
| 47 |
+
### Agentic Patterns (from [everything-claude-code](https://github.com/affaan-m/everything-claude-code))
|
| 48 |
+
|
| 49 |
+
- **4-Tier Memory**: Session β Observations β Instincts β State Store
|
| 50 |
+
- **Learned Instincts**: Behavioral patterns activated by limbic state
|
| 51 |
+
- **4-Phase Self-Debug**: Capture β Diagnose β Fix β Report
|
| 52 |
+
|
| 53 |
+
## Architecture
|
| 54 |
+
|
| 55 |
+
| Module | Lines | Purpose |
|
| 56 |
+
|--------|-------|---------|
|
| 57 |
+
| `limbic_engine.py` | 480 | Full limbic state machine with 14 formulas |
|
| 58 |
+
| `memory.py` | 332 | 4-tier memory + instincts + self-debugger |
|
| 59 |
+
| `training_plan.py` | 468 | GRPO training recipe + dataset generation |
|
| 60 |
+
| `app.py` | 436 | ZeroGPU Gradio interface |
|
| 61 |
+
|
| 62 |
+
## Try It
|
| 63 |
+
|
| 64 |
+
Type messages with different emotional tones and watch the Limbic Dashboard react:
|
| 65 |
+
|
| 66 |
+
- π° **Fear**: "I'm terrified of losing my job" β Low temperature, structured response
|
| 67 |
+
- π **Seeking**: "Tell me something fascinating about the brain" β High temperature, creative response
|
| 68 |
+
- π **Care**: "How can I help my friend with depression?" β Empathetic, supportive response
|
| 69 |
+
- π’ **Panic**: "My best friend is moving away forever" β Warm, validating response
|
| 70 |
+
|
| 71 |
+
## Training Plan
|
| 72 |
+
|
| 73 |
+
3-stage pipeline to fine-tune a base model:
|
| 74 |
+
1. **SFT Warm-Up**: 5K synthetic conversations (limbic state β response style)
|
| 75 |
+
2. **GRPO Loop Learning**: 2K psychology prompts Γ 4 reward functions
|
| 76 |
+
3. **Active Learning**: Uncertain predictions β human labels β retrain
|
| 77 |
+
|
| 78 |
+
See `training_plan.py` for the complete recipe and runnable script.
|