For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Copy to LLMGithubGo to App
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
  • Getting Started
    • Home
    • Quickstart
    • Upgrading to Opik 2.0
    • Ollie Agent
    • FAQ
    • Changelog
  • Observability
    • Overview
    • Getting started
    • Concepts
    • Debugging agents with Ollie and Opik Connect
  • Development
    • Overview
    • Agent playground
    • Prompt playground
      • Opik Agent Optimizer
      • Optimization Studio
      • Quickstart
      • Quickstart notebook
      • FAQ
      • Changelog
      • Known Issues
        • Overview
        • Benchmarks
        • MetaPrompt
        • HRPO
        • Few-Shot Bayesian
        • Evolutionary
        • GEPA
        • Parameter
        • Tool Optimization
  • Evaluation
    • Overview
    • Getting started
    • Concepts
  • Production
  • Administration
    • Overview
    • Roles and Permissions
  • Contributing
    • Contribution Overview
LogoLogo
Copy to LLMGithubGo to App
On this page
  • How optimizers run
  • Selection matrix
  • How to choose
  • Next steps
DevelopmentOptimization runsOptimization Algorithms

Optimization algorithms overview

Was this page helpful?
Previous

Optimizer benchmarks

Next
Built with

The Opik Optimizer SDK wraps a mix of in-house algorithms (MetaPrompt, HRPO) and external research projects (e.g., GEPA). Each optimizer follows the same API (optimize_prompt, OptimizationResult) so you can swap them without rewriting your pipeline. Use this page to quickly decide which optimizer to run before diving into the detailed guides.

How optimizers run

  1. Input – you pass a ChatPrompt definition, dataset, and metric. Many optimizers also accept additional parameters to set which model to use, number of optimization rounds, and even tool use (MCP and function calling) definitions.
  2. Candidate generation – each algorithm proposes new prompts (MetaPrompt via reasoning LLMs, Evolutionary via mutation/crossover, GEPA via its genetic-Pareto search).
  3. Evaluation – Opik runs the candidate against your dataset/metric and logs trials to the dashboard. The steps 2-to-3 continue to loop until such time a best prompt is found or the search has been exhausted.
  4. Result delivery – every optimizer returns an OptimizationResult with the best prompt, history, scores, and metadata which is passed back and also available in the UI.

Selection matrix

OptimizerOriginBest forKey inputsNotes
MetaPromptOpikGeneral prompt refinementPrompt + dataset + metricReasoning LLM critiques and rewrites prompts, supports MCP workflows and tool schemas.
HRPOOpikRoot-cause analysis on complex promptsMetrics with detailed reasonsBatches failures, synthesizes themes, proposes targeted fixes.
Few-Shot BayesianOpikOptimizing few-shot example setsDataset with demonstrationsUses Optuna to pick count/order of examples for chat prompts.
EvolutionaryOpik + DEAPExploring diverse prompt structuresMutation/crossover paramsMulti-objective optimization (score vs. length) and LLM-driven operators.
GEPAExternal (GEPA)Single-turn, reflection-heavy tasksgepa dependency + reflection minibatchesWe provide a wrapper so GEPA consumes Opik datasets/metrics while preserving its Pareto search.
ParameterOpikTemperature / top_p tuningPrompt + parameter search spaceLeaves prompt untouched; focuses on sampling parameters via Bayesian search.

How to choose

  1. Identify the constraint (e.g., wording vs. tool usage vs. parameters).
  2. Check dataset readiness – reflective optimizers need detailed metric reasons. Consider splitting your data into training and validation sets to prevent overfitting.
  3. Estimate budget – evolutionary/GEPA runs consume more tokens than MetaPrompt.
  4. Plan follow-up – you can chain optimizers (MetaPrompt → Parameter) when needed.

Next steps

  • Follow the individual optimizer guides for configuration details.
  • Learn how to chain optimizers for complex workflows.