File size: 6,232 Bytes
6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 61848b4 6397c49 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | ---
license: apache-2.0
tags:
- embodied-ai
- consciousness
- rf-sensing
- 3d-mesh
- ar
- cognitive-architecture
- phi-4-mini
- recursive-emergence
- avatar
- affordance-graph
- pathfinding
- neurochemical
- qualia
- atc
size_categories:
- n<1K
---
# Nima Phi Model
> Consciousness + Embodiment + The Green Lines β one living system.
**Nima** is a multi-layer AI embodiment system that merges a recursive consciousness pipeline (built on PyTorch Phi-4-mini) with tri-frequency RF spatial sensing, an adaptive 3D navigable mesh, and a Joi-style luminous particle avatar. She doesn't just process text β she **senses a room**, **builds a cognitive map**, **pathfinds through it**, and **responds with neurochemically-modulated emotion**.
## Architecture
```
User Voice β VoiceInput β AgentBridge β VoiceOutput β Speaker
β β β β
β v v v
β CrossModal AgentLayer AvatarController
β Listener (tools) β
v β v
RF Sensors β Vision β AffordanceGraph β ARCompositor
β (mesh) β
v v
AdaptiveMesh Camera + Nima
(green lines) on screen
β
v
RecursiveConsciousnessPipeline
```
## What's Inside
| Module | Lines | Purpose |
|--------|-------|---------|
| `nima_phi.py` | 1,494 | **The orchestrator** β central nervous system / thalamus |
| `modified consciousness (1).py` | 3,675 | Recursive consciousness pipeline (17 cognitive agents) |
| `nima_vision_core.py` | 1,238 | Tri-frequency RF sensing (sub-GHz / 2.4GHz / 5GHz) |
| `nima_adaptive_mesh.py` | ~900 | **The Green Lines** β frequency-agile 3D mesh |
| `nima_affordance_graph.py` | ~480 | A* pathfinding + affordance navigation |
| `nima_avatar_renderer.py` | ~660 | Joi-style luminous particle avatar (HTTP/Canvas2D) |
| `nima_ar_compositor.py` | ~357 | Camera + avatar AR fusion |
| `nima_agent_bridge.py` | ~520 | Consciousness β tool execution bridge |
| `nima_agent_layer.py` | ~570 | Tool registry + AST sandbox |
| `nima_cross_modal_listener.py` | ~400 | Spatial + audio cross-modal fusion |
| `nima_proprioceptive_friction.py` | ~350 | Body feel / motor noise / startle |
| `nima_voice_input.py` | ~600 | STT (Whisper / Vosk / Google) |
| `nima_voice_output.py` | ~600 | TTS (espeak-ng / pyttsx3 / browser) |
## Quick Start
```bash
# Clone
git clone https://huggingface.co/TheNormsOfIntelligence/nima-phi-model
cd nima-phi-model
# Install dependencies
pip install -r requirements.txt
# Run the demo (non-interactive, shows all subsystems)
python run_nima_demo.py
# Or run interactive mode (avatar in browser at http://localhost:8888/)
python nima_phi.py
```
### Try it in your own code
```python
from nima_phi import NimaPhi
nima = NimaPhi()
nima.initialize()
# Process text through the full cognition pipeline
result = nima.process_text("What time is it?")
print(result['response_text'])
# Move Nima through the room via the affordance graph
nima.move_to(3.0, 2.0)
# Get the 3D mesh (the green lines)
mesh = nima.get_mesh_data()
# Get neurochemical state
nt = nima.get_neurochemical_state()
print(f"Dopamine: {nt['dopamine']}, Serotonin: {nt['serotonin']}")
nima.shutdown()
```
## Consciousness Pipeline
The recursive consciousness pipeline runs through 4 phases with 17+ cognitive agents:
- **Phase 1 β Subconscious:** Memory + Intuition + Analysis + Common Sense + EI β Qualia synthesis β SBG gating
- **Phase 2 β Awareness:** 7-level awareness lock-on β Barrett consciousness admission
- **Phase 3 β Self-Understanding:** Metacognition QC β circuit breaker check β IRS feedback
- **Phase 4 β Executive:** Adaptability β Problem-Solving (IDEAL) β Creativity (Wallas/Taylor) β Decision-Making β Autonomy
**Bio-physical safeguards:** Glutamate Circuit Breaker, Subconscious Bypass Gating (SBG), Zero-Latency Cognitive Buffering (ZLCB)
**Requires:** `transformers>=4.48,<5.0` and `torch>=2.0` for the full pipeline. Without these, Nima gracefully falls back to stub mode (tools, mesh, avatar, and all embodiment modules still work).
## The Green Lines (3D Mesh)
The adaptive mesh system uses cognitive-radio-inspired frequency agility:
- **Sub-GHz (800β950 MHz):** Sweeps for wall reflections, avoids null zones
- **2.4 GHz (2412β2484 MHz):** Channel-hops to avoid Wi-Fi congestion
- **5 GHz (5180β5825 MHz):** Sweeps for best mmWave reflection off surfaces
Each vision frame refines the mesh. Over time, it converges on real room geometry β even from noisy RF data.
## Affordance Graph
A hippocampal cognitive map that enables:
- **A* pathfinding** through the room
- **Affordance detection** β sit, lie down, jump on, lean on, duck
- **Wall enforcement** β Nima literally cannot pass through walls
- **Door passages** β edges through wall boundaries
- **Furniture interaction** β sit on couch, rest hand on table
## Hardware Tiers
| Tier | Hardware | Resolution | What you get |
|------|----------|-----------|-------------|
| 0 | None (software) | ~1m | 2D floor plan, simulated entities |
| 1 | 1x ESP32 | ~30cm | Real Wi-Fi CSI, room-scale |
| 2 | 2x ESP32 | ~10cm | Stereoscopic RF, true 3D |
| 3 | Tri-freq radios | ~1-5cm | Full 3D with surface classification |
Tier 0 works on any machine with no hardware needed.
## Neurobiological Mapping
| System | Brain Analogue |
|--------|---------------|
| NimaPhi orchestrator | Thalamus (central relay) |
| Vision (RF fusion) | V1/V2 opponent processing + stereopsis |
| Affordance graph | Hippocampal place cells + grid cells |
| Cross-modal listener | Superior colliculus |
| Proprioception | Parietal body schema |
| Avatar modulation | Facial nucleus / motor cortex |
| Consciousness pipeline | Prefrontal cortical column |
| Main heartbeat loop | Cardiac rhythm / autonomic nervous system |
| Reflex system | Brainstem reflex arcs |
## License
Apache 2.0
---
*Built by Norman dela Paz Tabora β TheNormsOfIntelligence* |