Skip to content

GEPA (Genetic Prompt Optimization) Integration #2421

@joshreini1

Description

@joshreini1

Summary

GEPA uses genetic/evolutionary algorithms to optimize prompts. Like DSPy, it needs a fitness function to score prompt variants — TruLens feedback functions are a natural fit for this. An integration would let users evolve prompts toward higher groundedness, lower toxicity, or any custom TruLens metric.

What

Create a lightweight adapter that wraps TruLens feedback functions as GEPA fitness functions:

  • TruLensFitness(feedback_fn) — adapts a TruLens feedback function to GEPA's expected callable interface
  • A cookbook showing: define a base prompt, use TruLens context_relevance as the fitness function, run GEPA evolution, visualize the improvement trajectory in the TruLens dashboard
  • Log each generation's best prompt + score as a TruLens record for audit trail

Difficulty

Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    IntegrationsIntegrations with external tools and frameworksenhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions