What is gepa?
gepa is an open-source framework for optimizing systems whose parameters can be expressed as text and assessed with an evaluation metric. gepa targets work such as prompt engineering, code improvement, and agent architecture discovery. The project describes its approach as Genetic-Pareto optimization and distributes its Python implementation under the MIT license.
gepa uses language models to examine execution traces rather than reducing all feedback to a scalar reward. Error messages, profiling output, and reasoning logs can help explain why a candidate failed. That diagnostic information guides proposed changes, while evolutionary selection maintains candidates that perform well on different task subsets.
What gepa can do
gepa supports optimization beyond individual prompts through its optimize_anything API and adapter interfaces. Developers can supply a text artifact and an evaluator, then use diagnostic feedback to guide the search. Built-in adapters cover several AI development workflows, including single-turn language model tasks, retrieval systems, classification, and tool-using agents.
- gepa optimizes system prompts for single-turn language model tasks.
- gepa searches over code, configurations, agent architectures, and SVGs.
- gepa evolves DSPy programs, including signatures, modules, and control flow.
- gepa supports vector store-agnostic retrieval-augmented generation optimization.
- gepa optimizes MCP tool descriptions and system prompts.
- gepa supports LangChain pipelines, tool-using agents, and LangGraph.
How gepa works
gepa selects a candidate from the Pareto frontier and executes it on a minibatch while capturing traces. A language model reflects on the results, diagnoses failures, and generates a modified candidate using accumulated lessons. Improved candidates enter the pool, and the Pareto frontier is updated. System-aware merging can combine strengths from different candidates.
gepa connects to custom systems through an evaluator or the GEPAAdapter interface. The optimize_anything workflow accepts a seed candidate, an evaluator, an objective, and search configuration. Evaluators can log Actionable Side Information for reflection. Developers implementing an adapter provide evaluate and make_reflective_dataset, while DSPy users can access the optimizer through dspy.GEPA.
Who gepa is for
gepa is suited to developers working on systems with measurable outcomes and editable textual components. The repository provides examples for prompt optimization, coding agents, mathematical reasoning, and retrieval workflows. gepa also ships an Agent Skill that lets compatible coding agents drive optimize_anything, including agents that discover skills in the repository's .claude/skills/ directory.
- AI pipeline developers can optimize DSPy programs against task metrics.
- Agent developers can refine architectures, skills, and tool descriptions.
- Retrieval developers can improve prompts used in multi-hop question answering.
- Software developers can evaluate changes to code and configurations.
gepa pricing, licensing, and installation
gepa is available as an open-source project under the MIT license, with source code hosted on GitHub. The repository lists pip install gepa for installation and provides a Git-based pip command for the latest main branch. Documentation, quick-start examples, and executable DSPy tutorials provide starting points for implementing an optimization workflow.
gepa strengths and limitations
gepa combines diagnostic feedback with evolutionary search and supports several artifact types through a common optimization approach. Built-in adapters and integrations provide entry points for existing AI workflows. Custom use still requires a measurable objective and evaluation logic, and optional integrations introduce dependency constraints that differ from those of the core package.
- Custom systems need an evaluator or a GEPAAdapter implementation.
- Optional integrations have their own dependency requirements.
- gepa[full] and gepa[confidence] require Python 3.10–3.14 until their dependencies support Python 3.15.
gepa FAQ
What is gepa?
gepa is an open-source Python framework for optimizing textual parameters against an evaluation metric. gepa uses language models to inspect execution traces, propose targeted changes, and evolve candidates through Pareto-aware selection. Supported artifacts include prompts, code, agent architectures, and configurations.
Is gepa free and open source?
gepa is an open-source project distributed under the MIT license. gepa source code is available on GitHub, and the repository provides installation commands for the Python package and the latest main branch.
What can you optimize with gepa?
gepa can optimize prompts, code, agent architectures, configurations, scheduling policies, and vector graphics. gepa's optimize_anything API accepts a text artifact and a user-provided evaluator, allowing diagnostic feedback and an evaluation score to guide the search.
Does gepa work with DSPy and LangChain?
gepa supports DSPy through dspy.GEPA and provides a LangChain adapter for prompts in chat models, tool-using agents, and LangGraph workflows. gepa also lists integrations with MLflow, Comet ML Opik, Pydantic AI, and Google ADK.
How do you install gepa?
gepa can be installed using pip install gepa, or directly from the GitHub main branch using the repository's Git-based pip command. gepa's optional integrations have separate dependency requirements, so Python compatibility depends on the extras used.
Can coding agents use gepa?
gepa ships an Agent Skill that lets coding agents drive optimize_anything. gepa's repository lists automatic skill discovery for Claude Code and other agents reading .claude/skills/, including Cursor, VS Code/Copilot, Codex, and Gemini CLI, plus plugin installation instructions for other projects.
From the community
No reviews yet
Be the first to review this tool. What you write helps the next person choose.




