The Self-Modulating Knowledge Graph system for the EDEN humanoid robot, featuring real-time personality adjustment, intelligent event processing, and 3D visualization.
EDEN is a humanoid robotics project at the Texas A&M TURTLE Lab. This cognitive layer implements a sophisticated "Ego Engine" that processes events through multiple cognitive layers (heuristic, semantic, and LLM-powered analysis) to determine what should be remembered, filtered through the lens of personality and memory context.
- Backend: Python FastAPI server with NetworkX graph engine
- Frontend: 3D visualization using 3d-force-graph
- Memory: Supermemory (cloud) with ChromaDB fallback for local dev
- LLM: Ollama integration for cognitive event analysis
- Personality: Big 5 Personality Traits (OCEAN model)
# Copy environment template
cp .env.example .env
# Edit configuration (add your Supermemory API key)
nano .envRequired: Set SUPERMEMORY_API_KEY in .env for cloud memory storage.
Get your API key from: https://supermemory.ai
pip install -r requirements.txt --userOption A: Production Mode (Recommended)
# Start with clean state, cloud memory
python3 brain_server.pyOption B: Demo Mode (Testing)
# Start with test data for demonstration
DEMO_MODE=true python3 brain_server.pyOption C: Full System
# Terminal 1: Ollama
ollama serve
### 5. Open the Web Interface
Open your browser to: `http://localhost:8000`
You'll see:
- 3D graph visualization with the central SELF node
- God Mode control panel with personality sliders
- Real-time graph updates
## βοΈ Supermemory Setup
**π Full Guide**: See **[SUPERMEMORY_SETUP_GUIDE.md](SUPERMEMORY_SETUP_GUIDE.md)** for complete instructions on:
- How to create and structure your memory dataset
- Where to write prompts and content
- How to load memories into Supermemory
- Container design and metadata schemas
**Quick Start**:
1. **Export your API key** (get one from [Supermemory Developer Platform](https://supermemory.ai)):
```bash
export SUPERMEMORY_API_KEY=sk-your-key- Create your memory dataset (see
memory_dataset_template.jsonfor structure) - Load memories:
python3 scripts/load_supermemory_dataset.py --dataset your_dataset.json # Use --dry-run to preview first - Restart
brain_server.pyto use the new memories. If no API key is set, the system falls back to ChromaDB for local development.
ShowcaseSoftware/
βββ cognitive_layer/ # Core cognitive processing system
β βββ __init__.py # Package exports
β βββ config.py # Configuration (Ollama, thresholds)
β βββ ego_core.py # Ego Graph engine & event processing
β βββ llm_analyzer.py # LLM cognitive analyzer (Ollama)
β βββ scenario_manager.py # Demo scenarios
β βββ templates/
β β βββ index.html # 3D visualization frontend
β βββ README.md # Cognitive layer docs
β
βββ brain_server.py # FastAPI server (main entry point)
βββ test_event_processing.py # Test script
βββ requirements.txt # Python dependencies
β
βββ README.md # This file
βββ QUICK_START.md # Quick start guide
βββ STARTUP_COMMANDS.md # Complete startup commands
βββ EVENT_PROCESSING_GUIDE.md # Event processing documentation
βββ PROJECT_STRUCTURE.md # Detailed structure overview
- Real-time personality trait adjustment via sliders
- Visual feedback: SELF node color changes based on personality
- Event injection buttons for trauma/kindness scenarios
- 3-Layer Analysis: Heuristic β Semantic β LLM cognitive reasoning
- Personality-Aware: Importance modulated by Big 5 traits
- Memory Context: Considers relevant past memories
- Dynamic Thresholds: Adjusts based on event type and context
- Central SELF node (the "Ego")
- Memory nodes orbiting around SELF
- Color-coded nodes: Red (threat/trauma), Green (joy), Blue (memory)
- Dynamic edge weights based on personality
GET /- Web interfaceGET /api/graph/state- Get current graph stateWS /ws- WebSocket for real-time updates
POST /api/god_mode/set_personality- Update personality trait{"trait": "Agreeableness", "value": 0.9}
POST /api/interact- Process user interaction{"user": "Ian", "action": "Waves hello"}
-
POST /api/events/process- Process single event frame{ "description": "Ian just finished building the robot", "user_name": "Ian", "detected_actions": ["completed", "finished"] } -
POST /api/events/batch- Process batch of events{ "events": [ {"description": "Event 1", "user_name": "Ian"}, {"description": "Event 2", "user_name": "Student"} ] } -
GET /api/events/config- Get configuration -
POST /api/events/config- Update configuration
POST /api/event/inject- Inject trauma/kindness event{"event_type": "trauma", "description": "John throws can"}
python3 test_event_processing.py# Test single event
curl -X POST http://localhost:8000/api/events/process \
-H "Content-Type: application/json" \
-d '{
"description": "Ian just finished building the robot",
"user_name": "Ian",
"detected_actions": ["completed"]
}'
# Get graph state
curl http://localhost:8000/api/graph/state | python3 -m json.tool- QUICK_START.md - Quick setup guide
- STARTUP_COMMANDS.md - Complete startup commands
- EVENT_PROCESSING_GUIDE.md - Event processing documentation
- PROJECT_STRUCTURE.md - Detailed structure overview
- cognitive_layer/README.md - Cognitive layer documentation
Edit cognitive_layer/config.py to customize:
- Ollama URL and model
- Importance thresholds by event type
- Personality modulation weights
- Memory processing parameters
# Kill existing server
lsof -ti :8000 | xargs kill -9# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Verify it's running
curl http://localhost:11434/api/tags# Reinstall dependencies
pip3 install --upgrade -r requirements.txt --userSee STARTUP_COMMANDS.md for more troubleshooting.
- Event Arrives: JSON event with description, user info, actions
- Retrieve Memories: Semantic search for relevant past memories
- 3-Layer Analysis:
- Heuristic: Keyword-based quick scoring
- Semantic: Similarity to important memories
- LLM: Deep cognitive reasoning via Ollama
- Personality Modulation: Adjust importance based on Big 5 traits
- Dynamic Threshold: Determine if event should be remembered
- Graph Update: Add to graph if important, or store as episodic memory
- Openness: Receptiveness to novel events
- Conscientiousness: Values achievements and completions
- Extroversion: Amplifies social interactions
- Agreeableness: Amplifies positive social events
- Neuroticism: Amplifies threats and negative events
This is a research project for the Texas A&M TURTLE Lab. For contributions, please follow the project's contribution guidelines.
[Add your license here]
- Texas A&M TURTLE Lab
- Ollama for LLM capabilities
- NetworkX for graph operations
- ChromaDB for semantic memory storage
[Add contact information]
Note: This system is designed for the EDEN humanoid robot showcase. The cognitive layer processes events intelligently, deciding what's important enough to remember based on personality and memory context - mimicking human cognitive processing.