Goose Evolve is an open-source MCP extension for Goose that enables autonomous self-improvement. Agents evolve by rewriting prompts, MCP configs, and code via evolutionary algorithms and sandboxed testing. Inspired by Darwin Gödel Machine and AlphaEvolve, it focuses on openness, modularity, and user control.
- Evolution Engine - Full genetic algorithm orchestration with state persistence, error recovery, and convergence detection
- Variant Generator - Deterministic mode, mutation lineage tracking, A/B testing, and 5 mutation strategies
- Metrics Collector - Data persistence, multi-agent support, anomaly detection, and real-time streaming
- Fitness Evaluator - Pareto optimization, fitness explanations, parallel evaluation, and statistical analysis
- Safety Validator - Pre-test validation and injection detection
- Sandbox Manager - Docker-based isolated testing
- MCP Integration - No Goose connection yet
- Deployment Manager - User approval workflow
- CLI Interface - Command-line control
- Logging & Telemetry - Observability infrastructure
- Documentation - Complete architecture and API docs
- Hot-Reload - Dynamic prompt updates
- Python 3.9 or higher
- Docker (for future sandbox functionality)
git clone https://github.com/kwsantiago/goose-evolve.git
cd goose-evolve
pip install -e .Note: This example demonstrates core functionality with mocked components for missing features.
import asyncio
from datetime import datetime
from evolution import EvolutionEngine, FitnessEvaluator, VariantGenerator
from evolution.interfaces import EvolutionTriggerEvent, TestResults, ValidationResult
async def main():
# These components need production hardening
variant_generator = VariantGenerator()
fitness_evaluator = FitnessEvaluator()
# Mocked components (not yet implemented)
class MockSafetyValidator:
async def validate(self, variant):
return ValidationResult(is_valid=True, errors=[])
class MockSandboxManager:
async def test_variant(self, variant):
return TestResults(
variant_id=variant.id,
success_rate=0.9,
avg_response_time=1.2,
error_count=0,
resource_usage={'memory': 100.0, 'cpu': 50.0}
)
# Create evolution engine
engine = EvolutionEngine(
variant_generator=variant_generator,
safety_validator=MockSafetyValidator(),
sandbox_manager=MockSandboxManager(),
fitness_evaluator=fitness_evaluator
)
# Create a trigger event
trigger = EvolutionTriggerEvent(
trigger_type="threshold",
metrics_snapshot={'success_rate': 0.75, 'avg_response_time': 1.5},
timestamp=datetime.now()
)
# Run evolution cycle (no state persistence yet)
result = await engine.start_evolution_cycle(trigger)
print(f"Evolution completed: {result['best_fitness']}")
if __name__ == "__main__":
asyncio.run(main())The evolution process follows these steps:
- Monitor - MetricsCollector tracks performance (needs persistence)
- Trigger - Threshold detection generates evolution events
- Generate - VariantGenerator creates mutations (needs determinism)
- Validate - SafetyValidator not implemented
- Test - SandboxManager not implemented
- Evaluate - FitnessEvaluator scores variants (needs Pareto optimization)
- Deploy - No deployment mechanism or MCP integration yet
- Integration testing suite
- State persistence across components
- Error recovery mechanisms
- Performance optimization
- Resource management
- Safety Validator implementation
- Docker Sandbox Manager
- Comprehensive test suites
- Goose MCP bridge
- Prompt hot-reload
- Deployment manager
- User approval workflows
- CLI interface
- Logging and telemetry
- Complete documentation
- Community templates
- Multi-modal evolution
- Background optimization
- Community sharing platform
- 173 tests passing (161 unit tests + 12 integration tests)
- 12 integration tests covering all critical scenarios
- Coverage: ~95% for all components
- Includes: End-to-end, stress tests (5000+ variants), and failure recovery tests
- No Safety Validator - Pre-test validation not implemented
- No Sandbox Manager - Docker isolation not implemented
- No MCP Integration - Not connected to Goose yet
- No Deployment Manager - User approval workflow missing
- No CLI Interface - Command-line control not implemented
We need help with:
- Integration test suite development
- State persistence implementation
- Error recovery mechanisms
- Production configuration system
- Safety Validator implementation
- Docker Sandbox setup
- MCP Integration for Goose agents
- CLI Development
- Custom fitness functions
- Evolution strategies
- Documentation improvements
- Bug reports and fixes
See CONTRIBUTING.md for detailed guidelines.
See architecture.md for detailed system design, component interactions, and extension points.
MIT License. See LICENSE for details.
- GitHub Issues: Report bugs or suggest features
- Discussions: Architecture and design decisions
- Discord: Join the Goose community for real-time chat
If you use Goose Evolve in your research, please cite:
@software{goose-evolve,
title = {Goose Evolve: Self-Improving AI Agents via Evolutionary Algorithms},
author = {[Your Name]},
year = {2025},
url = {https://github.com/kwsantiago/goose-evolve}
}