DSPy Prompt Optimizer
When to Use
- User says optimize this prompt or task matches this capability
- User says dspy tune or task matches this capability
- User says improve prompt with reflection or task matches this capability
Workflow
- Capture baseline prompt and 2-3 example inputs with desired outputs.
- Run baseline; score outputs against criteria.
- Generate 3 prompt variants addressing failures.
- Test variants; pick best by score.
- Return optimized prompt with before/after metrics.
Integrations
self-refine-loopauto-testerhyper-skill-tester
Error Handling
| Failure | Response |
|---|---|
| No examples | Ask for 2 input/output pairs minimum. |
| Overfitting one example | Require 3+ diverse examples. |
Gotchas
- Keep prompt under 2000 tokens unless user needs longer.
Example
Input: User request matching triggers above. Output: Structured result per workflow with integrations invoked as needed.