Overview
Dria’s GEPA (Genetic-Pareto) Prompt Evolution Service automatically improves your prompts through iterative optimization. It accepts a seed prompt and evaluation dataset, then evolves better-performing prompts without manual tuning. Key benefits:- Automatic prompt improvement through reflective learning
- Sample-efficient optimization (up to 35x fewer iterations than traditional methods)
- Transparent evolution history with scores and ancestry tracking
- No fine-tuning required - works with existing models
- High performance - achieves 0.99+ scores on pedagogical tasks
- Optimizing support response templates
- Refining instruction prompts
- Improving task-specific outputs
- Evolving domain-aware technical documentation
- Security code review templates
Getting Started
1. Prepare Your Dataset
Create a JSON payload with:- Seed prompt: Your initial prompt template
- Dataset: Examples with inputs and expected outputs (size must equal minibatchSize + paretoSize)
- Evaluator: Must use available models
- Budget: Number of inference calls (minimum 10, recommended 25-50)
- Model: Must use available models
input: Object with variables matching yourdatasetColumnsexpectedOutput: The desired response (minimum 1 character)
minibatchSize + paretoSize. The first minibatchSize items are used for training (feedback), and the next paretoSize items are used for validation (pareto). For example, if minibatchSize: 3 and paretoSize: 4, you need exactly 7 dataset items in order.
2. Submit Execution
POST your payload to start evolution. The API returns anevolutionId immediately.
3. Monitor Progress
Poll the execution status every 10-30 seconds until completion. Status values:pending: Job queuedin_progress: Actively evolvingcompleted: Finished successfullyfailed: Encountered an error
4. Retrieve Results
Once completed, fetch the prompt evolution history to see how your prompt improved across generations.API Reference
Base URL:https://mainnet.dkn.dria.co/api/v0
All endpoints require x-api-key header.
POST /gepa/start_execution
Start a new prompt evolution. Returns {"evolutionId": "uuid"}.
Required fields:
customId: Your identifier for this runstrategy:"RPM"(Reflective Prompt Mutation) - currently the only available strategymodel: Model name - must be one from the available models (e.g.,gpt-4o,gpt-4o-mini)datasetColumns: Array of variable namesbudget: Inference budget (minimum 10, recommended 25-50)minibatchSize: Number of feedback examples per generationparetoSize: Number of pareto (validation) examplesevaluator: JSON string withmodelfield and metric config (e.g.,{"model": "gpt-4o-mini", "metric": "accuracy", "threshold": 0.9})dataset: Array of examples (see Getting Started Step 1 for size/order rules). Each item needsinput(object) andexpectedOutput(string, min length 1)prompt: Your seed prompt template
GET /gepa/get_all_executions
List your executions. Supports ?page=1&limit=10 pagination.
GET /gepa/get_single_execution/{evolutionId}
Get detailed status, current score, generation, and prompt.
GET /gepa/get_execution_prompts
Get evolution history. Requires ?evolutionId=.... Supports pagination.
Supported Models
GEPA supports the following models:- gpt-5-mini - Latest GPT-5 Mini (fast and cost-effective)
- gpt-5 - Latest GPT-5 (highest quality)
- gpt-4.1 - GPT-4.1
- gpt-4o - GPT-4o
- gpt-4o-mini - GPT-4o Mini (balanced performance and cost)
Example Payloads
Example 1: Math Tutoring
Example 2: Support Response
Real-World Evolution Example
Here’s an actual GEPA execution using the Support Response payload from Example 2:- Generation 0 (score 0.38): identical to the Example 2 prompt—polite acknowledgement plus closing offer to help.
- Generation 1 (score 0.69, +82%): GEPA rewrote the prompt into a numbered template that called out mesh rollout achievements, 120 ms roaming latency targets, and live-session trace evidence directly pulled from the dataset context.
- Structured approach with numbered sections
- Domain-specific knowledge extracted from dataset (QoS, mesh rollout, 120ms handoff latency)
- Concrete examples for different scenario types
- Professional formatting requirements
- Technical credibility elements (live session traces)
Python Example
This script reuses the Support Response payload from Example 2 to keep the dataset definition in one place. Save that JSON assupport_payload.json (or load it however you prefer) and then run:
Additional Resources
- GEPA Research Paper - Original technique by Agrawal et al.
- Dria Batch Inference - Model availability and pricing
- Support: For questions or issues, mail inference@dria.co (include
customIdandevolutionIdfor faster assistance)