DSPy Language Model Programming
Orchestra-Research/AI-Research-SKILLs
Teaches an agent to build LM pipelines, RAG systems and agents in DSPy using signatures, modules and optimizers instead of hand-tuned prompts.
Optimize DSPy programs with dspy.GEPA — a reflective/evolutionary optimizer to consider against task-specific baselines within an authorized evaluation budget.
$ npx skills add intertwine/dspy-agent-skills --skill dspy-gepa-optimizer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install intertwine/dspy-agent-skills dspy-gepa-optimizer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/intertwine/dspy-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dspy-gepa-optimizer .claude/skills/dspy-gepa-optimizer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "dspy-gepa-optimizer" agent skill from https://github.com/intertwine/dspy-agent-skills/tree/main/skills/dspy-gepa-optimizer into .claude/skills/dspy-gepa-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-gepa-optimizer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/intertwine/dspy-agent-skills/tree/main/skills/dspy-gepa-optimizerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add intertwine/dspy-agent-skills --skill dspy-gepa-optimizer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install intertwine/dspy-agent-skills dspy-gepa-optimizer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/intertwine/dspy-agent-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/dspy-gepa-optimizer .agents/skills/dspy-gepa-optimizer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "dspy-gepa-optimizer" agent skill from https://github.com/intertwine/dspy-agent-skills/tree/main/skills/dspy-gepa-optimizer into .agents/skills/dspy-gepa-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-gepa-optimizer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add intertwine/dspy-agent-skills --skill dspy-gepa-optimizer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install intertwine/dspy-agent-skills dspy-gepa-optimizer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/intertwine/dspy-agent-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/dspy-gepa-optimizer .cursor/skills/dspy-gepa-optimizer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "dspy-gepa-optimizer" agent skill from https://github.com/intertwine/dspy-agent-skills/tree/main/skills/dspy-gepa-optimizer into .cursor/skills/dspy-gepa-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-gepa-optimizer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/intertwine/dspy-agent-skills.git --path skills/dspy-gepa-optimizer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add intertwine/dspy-agent-skills --skill dspy-gepa-optimizer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install intertwine/dspy-agent-skills dspy-gepa-optimizer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/intertwine/dspy-agent-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/dspy-gepa-optimizer .gemini/skills/dspy-gepa-optimizer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "dspy-gepa-optimizer" agent skill from https://github.com/intertwine/dspy-agent-skills/tree/main/skills/dspy-gepa-optimizer into .gemini/skills/dspy-gepa-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-gepa-optimizer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install intertwine/dspy-agent-skills dspy-gepa-optimizerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add intertwine/dspy-agent-skills --skill dspy-gepa-optimizer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/intertwine/dspy-agent-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/dspy-gepa-optimizer .github/skills/dspy-gepa-optimizer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "dspy-gepa-optimizer" agent skill from https://github.com/intertwine/dspy-agent-skills/tree/main/skills/dspy-gepa-optimizer into .github/skills/dspy-gepa-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-gepa-optimizer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add intertwine/dspy-agent-skills --skill dspy-gepa-optimizer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install intertwine/dspy-agent-skills dspy-gepa-optimizer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/intertwine/dspy-agent-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/dspy-gepa-optimizer .opencode/skills/dspy-gepa-optimizer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "dspy-gepa-optimizer" agent skill from https://github.com/intertwine/dspy-agent-skills/tree/main/skills/dspy-gepa-optimizer into .opencode/skills/dspy-gepa-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "dspy-gepa-optimizer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
dspy-gepa-optimizerOptimize DSPy programs with dspy.GEPA — a reflective/evolutionary optimizer to consider against task-specific baselines within an authorized evaluation budget.
Dspy Gepa Optimizer is an agent skill from intertwine/dspy-agent-skills. Optimize DSPy programs with dspy.GEPA — a reflective/evolutionary optimizer to consider against task-specific baselines within an authorized evaluation budget. Use when the user says optimize, compile, GEPA, reflective optimization, or "make this program better" and a DSPy program + metric + trainset exist.
Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `example_bettertogether.py`, `example_gepa.py` and `reference.md`).
The repository describes itself as: Production-grade DSPy 3.2.x agent skills + validated end-to-end examples for Claude Code and Codex CLI — fundamentals, evaluation, GEPA, BetterTogether, and RLM. The licence is MIT.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 623dca0. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships script files (Python), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
arxiv.orgFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
WANDB_API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Dspy Gepa Optimizer loads about 2.6k tokens when it runs. Until then it costs about 82 tokens; SKILL.md has 914 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from intertwine/dspy-agent-skills at commit 623dca0, republished under its MIT licence (© intertwine). 914 words, ~2,612 tokens.
.claude/skills/dspy-gepa-optimizer/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.GEPA (Genetic-Pareto) is a reflective optimizer: it mutates a program's instructions and few-shots using an LM that reads your metric's textual feedback and proposes improvements. It maintains a Pareto frontier across validation tasks and is the default recommendation for complex DSPy workloads in 2026.
The expansion "Genetic-Evolutionary Prompt Adaptation" that appears in some AI-generated summaries is an LLM-hallucinated backronym. The paper defines GEPA as Genetic-Pareto; the "Pareto" is load-bearing (GEPA keeps a frontier of candidates rather than collapsing to one).
dspy.Module that runs end-to-end (see dspy-fundamentals).dspy.Prediction(score=float, feedback=str) (see dspy-evaluation-harness). Informative feedback can support reflection; evaluate optimizer benefit on the task rather than assuming superiority. A dict with the same fields still crashes dspy.Evaluate under DSPy 3.2.1 — use dspy.Prediction.trainset and a separate valset. For GEPA, maximize training examples and keep validation just large enough to represent the downstream distribution; do not reuse the same examples for both.reflection_lm — a strong LM (often the same or stronger than the task LM) set to temperature=1.0 for creative proposals. Current DSPy docs use a GPT-5-class reflection model with a large output budget.import dspy
dspy.configure(lm=dspy.LM("openai/gpt-5-mini"))
reflection_lm = dspy.LM("openai/gpt-5", temperature=1.0, max_tokens=32000)
optimizer = dspy.GEPA(
metric=rich_metric,
auto="medium", # "light" / "medium" / "heavy"
reflection_lm=reflection_lm,
reflection_minibatch_size=3,
candidate_selection_strategy="pareto", # or "current_best"
skip_perfect_score=True,
use_merge=True,
num_threads=8,
track_stats=True,
track_best_outputs=True, # enables inference-time best-of selection
log_dir="./gepa_logs", # resume/checkpoint
seed=0,
)
optimized = optimizer.compile(
student=program,
trainset=trainset,
valset=valset,
)
# Pareto inspection
pareto = optimized.detailed_results.val_aggregate_scores
print("Pareto frontier:", sorted(pareto, reverse=True)[:5])
optimized.save("optimized_program.json", save_program=False)Either works; use the top-level in new code:
import dspy
dspy.GEPA(...) # preferred
# equivalently:
from dspy.teleprompt import GEPAimport dspy
def rich_metric(gold, pred, trace=None, pred_name=None, pred_trace=None):
score = ... # 0.0..1.0
feedback = ... # detailed natural-language critique
return dspy.Prediction(score=score, feedback=feedback)Return dspy.Prediction, not a dict. Some upstream GEPA prose describes score/feedback as a dict-like shape, but dspy.Evaluate in DSPy 3.2.1 still crashes on a literal dict metric (TypeError: unsupported operand type(s) for +: 'int' and 'dict'). GEPA uses dspy.Evaluate internally for candidate scoring, so a dict return can fail inside GEPA too, not just in your explicit Evaluate(...) calls.
pred_name / pred_trace are set during reflection on a specific predictor inside your module — write per-predictor feedback when possible (credit assignment). If you cannot localize feedback, return program-level feedback rather than a vague score-only critique.Use either auto=... or explicit budget — not both.
| Mode | Rough rollouts | When to use |
|---|---|---|
auto="light" | ~20–40 full evals | Sanity-check GEPA works on your metric |
auto="medium" | ~80–150 full evals | Everyday optimization |
auto="heavy" | ~300–600 full evals | Final run before ship |
max_full_evals=N | Explicit | Deterministic budget |
max_metric_calls=N | Explicit | Hard cap on metric invocations (more predictable cost) |
Each "full eval" ≈ len(valset) metric calls. Budget accordingly for cost.
dspy.GEPA(
metric, # required
auto=None, # Literal["light","medium","heavy"] | None
max_full_evals=None,
max_metric_calls=None,
reflection_minibatch_size=3,
candidate_selection_strategy="pareto", # or "current_best"
reflection_lm=None, # required in practice
skip_perfect_score=True,
add_format_failure_as_feedback=False,
instruction_proposer=None, # custom ProposalFn
component_selector="round_robin", # or a callable
use_merge=True,
max_merge_invocations=5,
num_threads=None,
failure_score=0.0,
perfect_score=1.0,
log_dir=None,
track_stats=False,
use_wandb=False,
wandb_api_key=None, # overrides WANDB_API_KEY env var
wandb_init_kwargs=None, # dict forwarded to wandb.init(...)
track_best_outputs=False,
warn_on_score_mismatch=True,
use_mlflow=False,
seed=0,
gepa_kwargs=None, # e.g. {"use_cloudpickle": True} for dynamic signatures
).compile(student, *, trainset, valset=None, teacher=None) — teacher is not currently used.
DSPy's general prompt-optimizer docs often recommend a validation-heavy split, such as 20% train / 80% validation, because small prompt optimizers can overfit tiny trainsets. GEPA is different: maximize the training set and reserve only enough validation examples to represent downstream behavior. The Pareto frontier still needs a real valset, but GEPA learns from traces and textual feedback on training examples, so starving trainset hurts.
If you want a multi-stage optimizer loop, DSPy 3.2.0's BetterTogether now accepts arbitrary named optimizers instead of the older fixed prompt_optimizer / weight_optimizer pair:
optimizer = dspy.BetterTogether(
metric=rich_metric,
bootstrap=dspy.BootstrapFewShotWithRandomSearch(metric=rich_metric),
gepa=dspy.GEPA(metric=rich_metric, auto="light", reflection_lm=reflection_lm),
)
optimized = optimizer.compile(
student=program,
trainset=trainset,
valset=valset,
strategy="bootstrap -> gepa",
)Pass strategy= explicitly when you use named stages like bootstrap=... and gepa=.... DSPy 3.2.0's default strategy is still "p -> w -> p", which only works if your optimizer keys are literally p and w.
Keep plain GEPA as the default first pass. Reach for BetterTogether only when you have a specific reason to chain optimizers and want the valset to pick the best intermediate program.
dspy.MIPROv2.dspy.SIMBA is a lighter reflective optimizer. Try it when you want a cheaper reflective pass than GEPA, your program is simple, or you need quick exploration before committing to a full GEPA run. Keep GEPA as the default for multi-predictor programs where per-predictor feedback and Pareto candidate selection matter.
log_dir writes candidate programs + scores per round. To resume an interrupted run, point log_dir at the same directory — GEPA picks up from the last checkpoint. Inspect <log_dir>/candidates/ to see every proposed program.
track_best_outputsWith track_best_outputs=True, GEPA records, per task, the best prediction seen across all candidates. At inference time on held-out data, you can ensemble or select among the top-Pareto programs for robustness. Access via optimized.detailed_results.best_outputs_valset.
reflection_lm = small model — it can't critique; use the strongest LM you can afford for this role.auto="heavy" on an untested metric — burn money to learn the metric was bugged. Run auto="light" first.log_dir — losing a 4-hour run to a disconnect is very painful.reflection_lm is required at construction, not compiledspy.GEPA(...) asserts reflection_lm is not None (or a custom instruction_proposer) at init time — you cannot defer it to .compile(). If you see
AssertionError: GEPA requires a reflection language model...add reflection_lm=dspy.LM("openai/gpt-5", temperature=1.0, max_tokens=32000) to the constructor, or substitute the strongest instruction-following model available on your provider. dspy.LM(...) is a cheap stub until you actually call it, so constructing one doesn't hit the network.
dspy-evaluation-harness.dspy-advanced-workflow.© intertwine, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files in skills/dspy-gepa-optimizer of intertwine/dspy-agent-skills.
Open the folder on GitHubat commit 623dca0
Dspy Gepa Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Dspy Gepa Optimizer this skillintertwine/dspy-agent-skills | 278 | — | ~2.6k | Automated safety check: Pass | MIT | |
| DSPy Language Model ProgrammingOrchestra-Research/AI-Research-SKILLs | 13k | 9 repos | ~3.8k | Automated safety check: Pass | MIT | |
| SQL Optimizationgithub/awesome-copilot | 40k | 2 repos | ~2.3k | Automated safety check: Pass | MIT | |
| Reflectalirezarezvani/claude-skills | 28k | 1 repos | ~2.4k | Automated safety check: Pass | MIT | |
| Agent Performance Optimizerruvnet/ruflo | 74k | 2 repos | ~3.6k | Automated safety check: Pass | MIT | |
| Database Optimizerdavila7/claude-code-templates | 33k | 8 repos | ~2.5k | Automated safety check: Pass | MIT |
Orchestra-Research/AI-Research-SKILLs
Teaches an agent to build LM pipelines, RAG systems and agents in DSPy using signatures, modules and optimizers instead of hand-tuned prompts.
github/awesome-copilot
Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server…
alirezarezvani/claude-skills
Mid-conversation reflection skill that pauses execution and zooms out from detail-mode to honestly reassess direction, assumptions, and bias.
ruvnet/ruflo
Agent skill for performance-optimizer - invoke with $agent-performance-optimizer
davila7/claude-code-templates
Expert database optimizer specializing in modern performance tuning, query optimization, and scalable architectures.
affaan-m/ECC
分析原始提示,识别意图和差距,匹配ECC组件(技能/命令/代理/钩子),并输出一个可直接粘贴的优化提示。仅提供咨询角色——绝不自行执行任务。触发时机:当用户说“优化提示”、“改进我的提示”、“如何编写提示”、“帮我优化这个指令”或明确要求提高提示质量时。中文等效表达同样触发:“优化prompt”、“改进prompt”、“怎么写prompt”、“帮我优化这个指令”。不触发时机:当用户希望直接执行任…
intertwine/dspy-agent-skills
Build DSPy 3.2.x programs through spec, program, metric and baseline; extend to optimization and export when requested and justified by task budget.
intertwine/dspy-agent-skills
Build DSPy evaluation harnesses with rich-feedback metrics that are essential for GEPA optimization.
intertwine/dspy-agent-skills
Write idiomatic DSPy 3.2.x programs — typed Signatures, dspy.Module subclasses, Predict/ChainOfThought/ReAct/ProgramOfThought, and save/load.
intertwine/dspy-agent-skills
Use dspy.RLM (Recursive Language Model) for reasoning over contexts too large to fit in an LLM's working window — entire codebases, long logs, massive documents, or multi-step data exploration that…
Optimize DSPy programs with dspy.GEPA — a reflective/evolutionary optimizer to consider against task-specific baselines within an authorized evaluation budget. Dspy Gepa Optimizer is an agent skill from intertwine/dspy-agent-skills.GEPA — a reflective/evolutionary optimizer to consider against task-specific baselines within an authorized evaluation budget.
Dspy Gepa Optimizer fits situations like: the user says optimize; reflective optimization; make this program better and a DSPy program + metric + trainset exist.
Run `npx skills add intertwine/dspy-agent-skills --skill dspy-gepa-optimizer -a claude-code`. Or copy the skill folder (skills/dspy-gepa-optimizer in intertwine/dspy-agent-skills) into .claude/skills/dspy-gepa-optimizer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add intertwine/dspy-agent-skills --skill dspy-gepa-optimizer -a codex`. Or copy the skill folder (skills/dspy-gepa-optimizer in intertwine/dspy-agent-skills) into .agents/skills/dspy-gepa-optimizer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add intertwine/dspy-agent-skills --skill dspy-gepa-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dspy-gepa-optimizer, .gemini/skills/dspy-gepa-optimizer, .github/skills/dspy-gepa-optimizer and .opencode/skills/dspy-gepa-optimizer in your project.
Going by SKILL.md and its folder, Dspy Gepa Optimizer needs Python for the scripts in its folder and credentials named WANDB_API_KEY. Our summary lists: Python 3; A credential in WANDB_API_KEY.
SKILL.md names 1 domain. As links in the text: arxiv.org. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Dspy Gepa Optimizer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Dspy Gepa Optimizer: DSPy Language Model Programming (Orchestra-Research/AI-Research-SKILLs, 13k stars), SQL Optimization (github/awesome-copilot, 40k stars), Reflect (alirezarezvani/claude-skills, 28k stars) and Agent Performance Optimizer (ruvnet/ruflo, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
intertwine (a GitHub user) maintains it in intertwine/dspy-agent-skills, which has 278 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on September 6, 2026.
Source: intertwine/dspy-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.