📚 Documentation

🚀 Setup & Installation

🧬 Agent Evolution

⚙️ Configuration

🧬 SIA-1 Documentation

SIA-1 is an advanced self-evolving AI agent system featuring automated testing, error correction, LLM-guided evolution, and comprehensive monitoring capabilities.

🚀 Quick Start

Prerequisites

Installation

# Clone the repository
git clone <repository-url>
cd SIA-1

# Install Python dependencies
pip install -r requirements.txt

# Verify Docker is running
docker --version
docker ps

Configuration

# Configure your local LLM (interactive setup)
python configure_llm.py

# This will:
# - Test connection to LM Studio
# - Detect available models
# - Update configuration automatically

Running the System

# Option 1: Standard Evolution
python main.py

# Option 2: Automated Testing with Error Fixing
python automated_test_runner.py

What Happens Next

The system will:

  • 🌐 Start monitoring dashboard at http://localhost:8080
  • 🧬 Begin evolution with generation 0
  • 🔍 Detect and auto-fix errors using AI (up to 3 attempts per issue)
  • 📈 Continuously evolve agents with never-ending improvement
  • 🔄 Handle graceful shutdown with cleanup on Ctrl+C

🏢 System Architecture

Evolution Pipeline

  1. Intent Generation - AI analyzes research content and previous generation feedback
  2. Code Evolution - LLM generates improved agent code with full validation
  3. Automated Testing - Docker-based execution with comprehensive error detection
  4. Error Correction - AI automatically fixes detected issues (up to 3 attempts)
  5. Performance Evaluation - Multi-criteria benchmarking and scoring
  6. Continuous Improvement - Never-ending evolution with robust fallbacks

Key Components

Component Description
main.py Main evolution orchestrator with graceful shutdown
llm_interface.py LM Studio integration with configurable models
automated_test_runner.py AI-powered testing and error fixing
configure_llm.py Easy LLM model configuration utility
monitoring_dashboard.py Real-time web dashboard with container metrics

🧬 Base Agent Evolution

SIA-1 can evolve any base agent placed in the /DNA folder. The system will continuously improve and evolve your agent's functionality through AI-guided modifications.

How It Works

  1. Place Your Agent: Put your base agent code in the /DNA folder as agent.py
  2. Start Evolution: Run SIA-1 and it will analyze your agent's structure and functionality
  3. AI-Guided Improvement: The LLM generates evolved versions with enhanced capabilities
  4. Automatic Testing: Each evolved version is tested in isolated Docker containers
  5. Performance Selection: The best-performing agents survive to the next generation
  6. Continuous Evolution: The process repeats indefinitely, creating better agents

Basic Agent Template

Your base agent should follow this basic structure to ensure proper evolution. Save this as agent.py in your /DNA folder:

# Minimal agent implementation that meets SIA-1 evolution requirements.

# REQUIRED METHODS for evolution system:
# 1. __init__() - Initialize the agent
# 2. run() - Main execution method that returns True/False for success
# 3. get_status() - Return agent status information

# OPTIONAL METHODS that enhance evolution:
# 4. get_performance_metrics() - Detailed performance data
# 5. _monitor_performance() - Performance monitoring

Agent Requirements

For successful evolution, your base agent should include:

Evolution Possibilities

The AI can evolve your agent in many ways:

Evolution Tracking

Monitor your agent's evolution progress:

🎯 LLM Configuration Guide

Optimal Settings for LM Studio

Since LM Studio supports up to 8000 tokens max length, here are the recommended settings:

Current Configuration (in config.py):

# LLM settings
LLM_MAX_TOKENS_INTENT = 500      # For intent generation
LLM_MAX_TOKENS_CODE = 4000       # For code generation  
LLM_TIMEOUT_SECONDS = 180        # 3 minutes timeout

Recommended Optimizations:

# Increase these values in config.py for better results
LLM_MAX_TOKENS_INTENT = 800      # More detailed intents
LLM_MAX_TOKENS_CODE = 6000       # More complete code (use ~75% of your 8000 limit)
LLM_TIMEOUT_SECONDS = 240        # 4 minutes for complex generation

LM Studio Server Settings

Supported LLM Models

Tested and optimized for:

🔍 Troubleshooting FAQ

Q: LM Studio connection failed - how do I fix this?

A: Follow these steps to resolve LM Studio connection issues:

  1. Open the LM Studio application on your computer
  2. Load a code-generation model (e.g., Qwen Coder, CodeLlama, or DeepSeek)
  3. Click the "Start Server" button (green play button) in LM Studio
  4. Verify the endpoint in your config matches (usually http://localhost:1234)
  5. Test the connection by running: python configure_llm.py

Q: Docker is not running - what should I do?

A: Docker must be running for SIA-1 to work properly:

Q: Port 8080 is already in use - how can I change it?

A: You can change the dashboard port in the configuration:

  1. Open config.py in your SIA-1 directory
  2. Find the SYSTEM_CONFIG section
  3. Change the dashboard port to an available one (e.g., 8081, 8082)
  4. Example: "port": 8081 instead of "port": 8080
  5. Restart SIA-1 and access the dashboard at the new port

Q: Getting "Model Context Overflow" errors - what does this mean?

A: This happens when your LLM model has a smaller context window than expected:

Q: Container builds are failing - how do I debug this?

A: Container build failures are usually due to resource or syntax issues:

  1. Check available disk space: docker system df
  2. Clean up old containers: docker system prune -f
  3. Check the generated agent code in /DNA_evolved/ for syntax errors
  4. View specific container logs: docker logs [container_name]
  5. Try running the cleanup utility: python cleanup_containers.py

Q: The system stops evolving after a few generations - why?

A: This is usually due to accumulated errors or resource constraints:

Q: Dashboard shows "No data" or won't load - what's wrong?

A: Dashboard issues are typically network or database related:

  1. Confirm the dashboard is running on the correct port (check terminal output)
  2. Try accessing http://localhost:8080 directly in your browser
  3. Check if the SQLite database file exists: agents.db
  4. Restart SIA-1 to reinitialize the dashboard
  5. Check browser console for JavaScript errors

Q: Evolution is too slow - how can I speed it up?

A: Several factors affect evolution speed:

Q: Getting Unicode/encoding errors in generated code - how to fix?

A: Unicode errors have been largely fixed, but if they occur:

Q: How do I view logs and debug information?

A: SIA-1 provides several logging options:

Q: Installation fails with permission errors - what should I do?

A: Permission issues are common during setup:

  1. Windows: Run terminal as Administrator
  2. Linux/Mac: Use sudo for system-level installations
  3. Python packages: Try pip install --user -r requirements.txt
  4. Docker: Ensure your user is in the docker group (Linux)
  5. File permissions: Check that the SIA-1 directory is writable

Q: The system uses too much memory/CPU - how can I limit resources?

A: Resource usage can be controlled through configuration: