3.3 KiB
3.3 KiB
GOAP Autonomy System - Quick Start
Installation
cd /root/allegro/goap
./setup.sh
Running the System
Option 1: Systemd Service (Recommended)
# Start the service
systemctl start goap-autonomy
# Enable auto-start on boot
systemctl enable goap-autonomy
# Check status
systemctl status goap-autonomy
# View logs
journalctl -u goap-autonomy -f
Option 2: Manual Execution
cd /root/allegro/goap
# Run one autonomy cycle
python3 self_goap.py --once
# Run continuous autonomy loop
python3 self_goap.py --run
# Run in background
nohup python3 self_goap.py --run > /var/log/goap.log 2>&1 &
Managing Autonomy
# Check system status
python3 self_goap.py --status
# Enable autonomy
python3 self_goap.py --enable
# Disable autonomy
python3 self_goap.py --disable
# Force plan for specific goal
python3 self_goap.py --plan system_health
Goals
The system manages 13 goals across 5 categories:
| Category | Goals | Priority |
|---|---|---|
| HUNGER | Resource acquisition, Efficiency | HIGH |
| SAFETY | System health, Security, Data integrity | CRITICAL |
| LEARNING | Knowledge, Skills, Adaptation | MEDIUM |
| SOCIAL | User engagement, Relationships, Collaboration | MEDIUM |
| GROWTH | Self-improvement, Exploration | LOW |
Actions
14 actions available across categories:
- System: check_system_health, cleanup_resources, restart_service, backup_data
- Knowledge: research_topic, index_knowledge, learn_from_interaction
- Skills: practice_skill, acquire_new_skill
- Social: send_message, proactive_check_in, share_knowledge
- Growth: self_analysis, experiment
How It Works
- State Collection - Every 60 seconds, collects system metrics
- Goal Evaluation - Updates goal satisfaction based on current state
- Planning - Every 5 minutes, creates plans for top-priority goals
- Execution - Schedules and executes plans with monitoring
- Learning - Tracks success rates and adapts
Files
/root/allegro/goap/autonomy.log- Operation log/root/allegro/goap/goals_state.json- Goal history/root/allegro/goap/executor_state.json- Execution stats/root/allegro/goap/self_state.json- System config
Troubleshooting
Service won't start
# Check for Python errors
python3 self_goap.py --once
# Check permissions
ls -la /root/allegro/goap/*.py
# Check logs
journalctl -u goap-autonomy -n 50
No plans found
This is normal if all goals are satisfied or current state doesn't match action preconditions. The system will keep trying.
High CPU usage
The system runs in adaptive mode and will reduce activity under high load.
Integration
The GOAP system reads from:
- Timmy metrics database (
/root/allegro/timmy_metrics.db) - Heartbeat logs (
/root/allegro/heartbeat_logs/) - System metrics (CPU, memory, disk)
Development
Adding a Custom Goal
from goap import Goal, GoalCategory, GoalPriority
class CustomGoal(Goal):
def evaluate(self, world_state):
return 0.5 # Satisfaction level
Adding a Custom Action
from goap import Action, ActionResult
class CustomAction(Action):
async def execute(self, context):
# Do something
return ActionResult.success_result("Done!")
Support
See README.md for detailed documentation.