dspy-gepa-reflective

Optimize DSPy agentic systems via GEPA reflective evolutionary search.

120|13|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/OmidZamani/dspy-skills --skill dspy-gepa-reflective
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dspy-gepa-reflective
Source: https://github.com/OmidZamani/dspy-skills/tree/main/skills/dspy-gepa-reflective
Command: npx skills add https://github.com/OmidZamani/dspy-skills --skill dspy-gepa-reflective

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill introduces GEPA, the newest DSPy optimizer that uses LLM reflection on full execution traces to search for Pareto-optimal improvements in agentic systems.

Core Features & Use Cases

  • Feedback-driven optimization: Metrics return (score, feedback) to guide improvements.
  • Phase-based workflow: Define a metric, configure a reflection LM, and compile an optimized program.
  • Production-ready: Apply GEPA to complex agents with tool use to improve reliability and performance.

Quick Start

Define a metric that returns a (score, feedback) pair, configure the reflection LM, set the auto mode, and compile the agent with GEPA.

Frequently Asked Questions about dspy-gepa-reflective

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize agentic DSPy workflows using LLM reflection?

GEPA optimizes agentic DSPy workflows by reflecting on full execution traces to search for Pareto-optimal improvements. Define a metric returning (score, feedback), configure a reflection LM, set the auto mode, and compile your agent to apply reflective optimization across multi-step processes with tool use.

Can I use DSPy optimization with tool-using agents and rich textual feedback?

Yes. GEPA is designed for complex agentic systems with tool use and textual feedback on failures. It processes full execution traces to identify improvement opportunities, making it suitable for agents requiring instruction-only optimization without labeled training data.

What does GEPA do differently from other DSPy optimizers?

GEPA uses LLM reflection on complete execution traces combined with Pareto-based evolutionary search. Unlike instruction-only approaches, it leverages rich failure feedback and multi-step workflow context to optimize agent behavior across competing objectives simultaneously.

How do I set up the metric and reflection LM for GEPA optimization?

Define a metric callable that returns (score, feedback) pairs—the feedback guides reflection. Configure a reflection_lm (dspy.LM object) and select an auto mode ('light', 'medium', or 'heavy'). Pass these with your dspy.Module program and trainset to compile an optimized agent.

What are the inputs and outputs of GEPA optimization?

Inputs are a dspy.Module program, trainset (list of dspy.Example), metric (callable), reflection_lm, and auto mode. Output is a compiled_program (dspy.Module) optimized through reflective phases: defining feedback metrics, configuring the agent, and performing evolutionary search.

Is GEPA suitable for production agentic systems?

Yes. GEPA is production-ready for complex agents with tool use, improving reliability and performance through systematic reflective optimization. It requires no labeled data and works with instruction-only setups, making it practical for deployed workflows.