self-evolving-agent
БесплатноБез исполняемых скриптовНе проверенDarwin Gödel Machine patterns for self-improving AI agents with open-ended code evolution. Use for building agents that autonomously improve their own…
от plurigrid★ 73 звезды на GitHubОб этом скилле
Self-Evolving Agent
Trit: 0 (ERGODIC - coordinator) Color: Green (#26D826)
Overview
Implements self-evolving agent patterns from recent research:
- Darwin Gödel Machine (DGM) for self-improving code
- Open-ended evolution of agent capabilities
- Lifelong learning with long-term memory
- Feedback loops for continual adaptation
Key Papers
- Darwin Gödel Machine - Zhang et al. 2025
- Self-Evolving Agents Survey - Gao et al. 2025
- Long Term Memory for AI Self-Evolution - Jiang et al. 2024
- Open-Endedness is Essential for ASI - Hughes et al. 2024
- Static Sandboxes Are Inadequate - Chen et al. 2025
Core Concepts
Darwin Gödel Machine Architecture
┌─────────────────────────────────────────────────────┐
│ DARWIN GÖDEL MACHINE │
├─────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Archive │───▶│ Sampler │ │
│ │ (agents) │ │ (select) │ │
│ └─────────────┘ └──────┬──────┘ │
│ ▲ │ │
│ │ ┌──────▼──────┐ │
│ │ │ Mutator │ │
│ │ │ (LLM-based)│ │
│ │ └──────┬──────┘ │
│ │ │ │
│ ┌──────┴──────┐ ┌──────▼──────┐ │
│ │ Validator │◀────│ Evaluator │ │
│ │ (benchmark)│ │ (fitness) │ │
│ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────┘
Evolution Loop
\text{For each generation } t:
1. \text{Sample agent } A_t \text{ from archive}
2. \text{Mutate: } A'_t = \text{LLM}(A_t, \text{context})
3. \text{Evaluate: } f(A'_t) = \text{benchmark}(A'_t)
4. \text{If } f(A'_t) > \theta: \text{add to archive}
5. \text{Prune archive to maintain diversity}
Three Dimensions of Self-Evolution
- What to Evolve: Model, memory, tools, architecture
- When to Evolve: Intra-test-time, inter-test-time, offline
- How to Evolve: Scalar rewards, textual feedback, multi-agent
API
Python Implementation
from dataclasses import dataclass
from typing import List, Dict, Any, Callable
import random
@dataclass
class Agent:
"""Self-evolving agent representation."""
code: str
fitness: float
generation: int
parent_id: str = None
metadata: Dict[str, Any] = None
def __hash__(self):
return hash(self.code)
class DarwinGodelMachine:
"""Darwin Gödel Machine for self-improving agents."""
def __init__(
self,
initial_agent: Agent,
mutator: Callable[[Agent], Agent],
evaluator: Callable[[Agent], float],
archive_size: int = 100,
diversity_threshold: float = 0.3
):
self.archive = [initial_agent]
self.mutator = mutator
self.evaluator = evaluator
self.archive_size = archive_size
self.diversity_threshold = diversity_threshold
self.generation = 0
def sample_agent(self) -> Agent:
"""Sample agent from archive (fitness-proportionate)."""
fitnesses = [max(a.fitness, 0.01) for a in self.archive]
total = sum(fitnesses)
probs = [f / total for f in fitnesses]
return random.choices(self.archive, weights=probs, k=1)[0]
def mutate(self, agent: Agent) -> Agent:
"""Mutate agent using LLM-based code modification."""
new_code = self.mutator(agent)
return Agent(
code=new_code,
fitness=0.0,
generation=self.generation,
parent_id=hash(agent.code)
)
def evaluate(self, agent: Agent) -> float:
"""Evaluate agent on benchmarks."""
try:
fitness = self.evaluator(agent)
agent.fitness = fitness
return fitness
except Exception as e:
agent.fitness = 0.0
agent.metadata = {"error": str(e)}
return 0.0
def is_novel(self, agent: Agent) -> bool:
"""Check if agent is sufficiently novel for archive."""
for existing in self.archive:
similarity = self.code_similarity(agent.code, existing.code)
if similarity > (1 - self.diversity_threshold):
return False
return True
def evolve_step(self) -> Agent:
"""Run one evolution step."""
self.generation += 1
# Sample and mutate
parent = self.sample_agent()
child = self.mutate(parent)
# Evaluate
fitness = self.evaluate(child)
# Add to archi
Установить self-evolving-agent в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл self-evolving-agent?
Darwin Gödel Machine patterns for self-improving AI agents with open-ended code evolution. Use for building agents that autonomously improve their own capabilities, modify their codebases, and evolve through interaction.
Как установить скилл self-evolving-agent?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл self-evolving-agent запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic