Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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

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

  1. What to Evolve: Model, memory, tools, architecture
  2. When to Evolve: Intra-test-time, inter-test-time, offline
  3. 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
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить self-evolving-agent с