Skip to content

GEPA on agents: full-trace reflection and tool descriptions #200

Open

Description

@deepfates

0.5.0 makes GEPA's reflection on an Imp.react agent match DSPy's: the reflecting model sees the whole run (tool calls, results, final answer) and the agent's tools, and GEPA rewrites the agent's instruction. Two directions go further, and both are open questions upstream:

  • Full-trace reflection: DSPy PR Full program trace reflection modes for GEPA stanfordnlp/dspy#9244 (open, by GEPA's author) adds modes where the reflection model sees the whole program trace and may update all components together, with reported gains on HotpotQA.
  • Tool descriptions as GEPA components: DSPy shipped enable_tool_optimization in 3.1.1-3.1.2 (PR #8928) and removed it (PR #9223), reasoning that optimizing the agent's instructions is general enough. GEPA's own package keeps the option in its DSPy adapter. Imp's Imp.ProgramParameters already exposes tool/<name>/description and tool/<name>/schema, and Imp.Optimize.Anything can rewrite them (research/RESULTS.md R6).

Also: in ReActV2 the agent guidance and tool roster live in adapter/provider config rather than in the signature instruction (for prompt caching), so Imp's GEPA component for an agent is only the user's instruction, where DSPy's react instruction includes the guidance. Decide whether that's the right parameter boundary.

Activity

  1. added
    enhancement
    on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions