Skip to content
Back to skills

Gepa

ASecurity

GEPA is an autonomous self-improvement methodology that enables AI agents to evolve their own prompts through execution trace analysis and targeted mutation. Based on the research paper "GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning" (arxiv.org/abs/2507.19457).

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 19, 2026
ai-agentspythonperformance

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 19, 2026

npx -y skills add Stranglehold/Exocortex --skill gepa --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gepa?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gepa
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/stranglehold-gepa/badge)](https://www.skillsdirectory.com/skills/stranglehold-gepa)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# GEPA (Genetic-Pareto Prompt Evolution) Skill

## Overview
GEPA is an autonomous self-improvement methodology that enables AI agents to evolve their own prompts through execution trace analysis and targeted mutation. Based on the research paper "GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning" (arxiv.org/abs/2507.19457).

## Core Philosophy
Unlike gradient-based or reinforcement learning methods that reduce execution feedback to scalar rewards, GEPA leverages **Actionable Side Information **(ASI): full execution traces including reasoning steps, tool calls, and outputs. This enables natural language reflection on what went wrong and why.

## Architecture

### Phase 1: Core Framework (Implemented)
- `Trajectory` class - captures complete execution traces with ASI
- `PromptVariant` class - represents a versioned prompt with metadata
- `EvaluationEngine` - interface for measuring prompt performance
- `GEPAOptimizer` - main orchestrator class

### Phase 2: Reflection Module (Planned)
- Natural language diagnosis of trajectory failures
- Problem identification from execution traces
- Root cause analysis

### Phase 3: Mutation Operators (Planned)
- Targeted prompt modifications based on reflection
- Crossover between high-performing variants
- Constraint-aware mutations

### Phase 4: Pareto Optimization (Planned)
- Multi-objective fitness evaluation
- Pareto frontier maintenance
- Diversity-preserving selection

## Usage Example
```python
from gepa import GEPAOptimizer, Trajectory, EvaluationEngine

# Define your prompt template and evaluation
class MyEvaluator(EvaluationEngine):
    def evaluate(self, prompt: str, inputs: list) -> dict:
        # Run agent with prompt on inputs, return metrics
        pass

optimizer = GEPAOptimizer(
    initial_prompt="Your base prompt here",
    evaluator=MyEvaluator(),
    rollout_budget=100,
)

# Evolve the prompt
optimized_prompt = optimizer.evolve(inputs_dataset)
```

## Key Classes
- `GEPAOptimizer`: Main entry point, orchestrates evolution loop
- `Trajectory`: Stores execution trace with ASI (reasoning, tool calls, outputs)
- `PromptVariant`: A versioned prompt with performance metrics
- `EvaluationEngine`: Abstract base class for defining evaluation criteria

Files in this skill

  • SKILL.md2.2 KB
  • gepa.py12.6 KB
  • gepa/SKILL.md2.5 KB
  • gepa/gepa.py12.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.