nima-phi-model / README.md
TheNormsOfIntelligence's picture
Add proper model card with architecture docs
6397c49 verified
|
Raw
History Blame Contribute Delete
6.23 kB
---
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*