dspy-gepa-reflective

Solid

This skill should be used when the user asks to "optimize an agent with GEPA", "use reflective optimization", "optimize ReAct agents", "provide feedback metrics", mentions "GEPA optimizer", "LLM reflection", "execution trajectories", "agentic systems optimization", or needs to optimize complex multi-step agents using textual feedback on execution traces.

AI & Automation 78 stars 10 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 90/100

Stars 20%
63
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# DSPy GEPA Optimizer ## Goal Optimize complex agentic systems using LLM reflection on full execution traces with Pareto-based evolutionary search. ## When to Use - **Agentic systems** with tool use - When you have **rich textual feedback** on failures - Complex multi-step workflows - Instruction-only optimization needed ## Related Skills - For non-agentic programs: [dspy-miprov2-optimizer](../dspy-miprov2-optimizer/SKILL.md), [dspy-bootstrap-fewshot](../dspy-bootstrap-fewshot/SKILL.md) - Measure improvements: [dspy-evaluation-suite](../dspy-evaluation-suite/SKILL.md) ## Inputs | Input | Type | Description | |-------|------|-------------| | `program` | `dspy.Module` | Agent or complex program | | `trainset` | `list[dspy.Example]` | Training examples | | `metric` | `callable` | Accepts five arguments and returns `dspy.Prediction(score=..., feedback=...)` | | `reflection_lm` | `dspy.LM` | Strong LM for reflection (GPT-4) | | `auto` | `str` | "light", "medium", "heavy" | ## Outputs | Output | Type | Description | |--------|------|-------------| | `compiled_program` | `dspy.Module` | Reflectively optimized program | ## Workflow ### Phase 1: Define Feedback Metric GEPA requires metrics that return *textual feedback*: ```python def gepa_metric(example, pred, trace=None, pred_name=None, pred_trace=None): """Return score and actionable feedback for GEPA reflection.""" is_correct = example.answer.lower() in pred.answer.lower() if is_correct: feed...

Details

Author
OmidZamani
Repository
OmidZamani/dspy-skills
Created
5 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category