# GEPA

> GEPA (Genetic-Pareto) is an open-source framework that optimizes prompts, code, agent architectures, and any text parameter using LLM-based reflection and Pareto-efficient evolutionary search.

GEPA (Genetic-Pareto) is an open-source Python framework for automatically optimizing any system with textual parameters — prompts, code, agent architectures, scheduling policies, and more — against any evaluation metric. It is developed by researchers from UC Berkeley, Stanford, MIT, and Databricks, and is available under the MIT License via PyPI (`pip install gepa`). The project was created in August 2025 and has accumulated over 4,700 GitHub stars as of its latest update.

## What It Is

GEPA stands for Genetic-Pareto and implements a novel optimization loop that differs from reinforcement learning and gradient-based methods. Instead of collapsing execution traces into a single scalar reward, GEPA uses LLMs to read full execution traces — error messages, profiling data, reasoning logs — to diagnose *why* a candidate failed and propose targeted fixes. Through iterative reflection, mutation, and Pareto-aware selection, GEPA evolves high-performing variants with minimal evaluations. The core concept is **Actionable Side Information (ASI)**: diagnostic feedback returned by evaluators that serves as the text-optimization analogue of a gradient.

## How the Optimization Loop Works

GEPA's five-step loop runs until convergence:

1. **Select** a candidate from the Pareto frontier (candidates excelling on different task subsets)
2. **Execute** on a minibatch, capturing full execution traces
3. **Reflect** — an LLM reads the traces and diagnoses failures in natural language
4. **Mutate** — generate an improved candidate informed by accumulated lessons from all ancestors
5. **Accept** — add to the pool if improved, update the Pareto front

GEPA also supports **system-aware merge**, combining strengths of two Pareto-optimal candidates that excel on different tasks. The paper (arXiv:2507.19457) reports that GEPA requires 100–500 evaluations compared to 5,000–25,000+ for GRPO, making it approximately 35x faster than RL-based approaches according to the authors.

## Integrations and Adapter Architecture

GEPA connects to external systems via the `GEPAAdapter` interface. Built-in adapters include:

- **DefaultAdapter** — system prompt optimization for single-turn LLM tasks
- **ConfidenceAdapter** — logprob-aware classification optimization
- **DSPy Full Program Adapter** — evolves entire DSPy programs including signatures, modules, and control flow
- **Generic RAG Adapter** — vector store-agnostic RAG optimization supporting ChromaDB, Weaviate, Qdrant, and Pinecone
- **MCP Adapter** — optimizes Model Context Protocol tool descriptions and system prompts
- **TerminalBench Adapter** — integrates with the Terminus terminal-use agent

GEPA is also integrated as a first-class optimizer in several major frameworks: DSPy (`dspy.GEPA`), MLflow (`mlflow.genai.optimize_prompts()`), Comet ML Opik, Pydantic AI, the OpenAI Cookbook, the HuggingFace Cookbook, and Google's Agent Development Kit (ADK).

## Adoption and Use Cases

The project homepage attributes usage to teams at Shopify, Databricks, Dropbox, OpenAI, Pydantic, Comet ML, Weaviate, MLflow, Uber, Meta, AWS, Cerebras, Nous Research, NuBank, and others. The Databricks team published a blog post claiming that open-source models combined with GEPA beat Claude Opus 4.1 at 90x lower cost. Shopify CEO Tobi Lutke is quoted on the project page calling GEPA "severely under hyped in the AI context engineering world." The project page lists over 50 production use cases across enterprise agents, coding agents, healthcare, and research domains.

## Update: v0.1.1

The latest release is v0.1.1, published on March 16, 2026. The repository was created in August 2025 and has seen active development, with the last push recorded in May 2026. The project direction includes the `optimize_anything` API, which extends optimization beyond prompts to arbitrary text artifacts such as code, agent architectures, configurations, and SVG graphics. The authors describe GEPA as complementary to RL and fine-tuning, recommending it for rapid initial optimization before applying gradient-based methods for additional gains.

## Features
- Optimize prompts, code, agent architectures, and any text parameter
- LLM-based reflection to diagnose why candidates fail
- Pareto-efficient evolutionary search
- Actionable Side Information (ASI) for gradient-like feedback
- System-aware merge of Pareto-optimal candidates
- Works with as few as 3 training examples
- API-only model support (no weights access needed)
- Human-readable optimization traces
- optimize_anything API for arbitrary text artifacts
- Built-in adapters for DSPy, RAG, MCP, and more
- Integration with DSPy, MLflow, Comet ML Opik, Pydantic AI, Google ADK
- 35x faster than RL (100–500 evals vs 5,000–25,000+)

## Integrations
DSPy, MLflow, Comet ML Opik, Pydantic AI, OpenAI, HuggingFace, Google ADK, ChromaDB, Weaviate, Qdrant, Pinecone, Model Context Protocol (MCP), LiteLLM

## Platforms
CLI, API, DEVELOPER_SDK

## Pricing
Open Source

## Version
v0.1.1

## Links
- Website: https://gepa-ai.github.io/gepa/
- Documentation: https://gepa-ai.github.io/gepa/guides/
- Repository: https://github.com/gepa-ai/gepa
- EveryDev.ai: https://www.everydev.ai/tools/gepa
