Skip to main content
A multi-agent flow that trains a solver-judge system on the countdown task using the AgentFlow protocol. The solver generates N candidate solutions in parallel; the judge evaluates them and selects the best. The trainer scores each role separately so GRPO can compute advantages within each trajectory group. This cookbook is the canonical example of returning multiple named trajectories from a single AgentFlow. It pairs with the longer solver-judge tutorial, which walks through the design step by step.

Pattern

Architecture

The evaluator scores each trajectory independently. GRPO then groups by name across rollouts: all solver trajectories for one task into one group; all judge trajectories into another.

Install

Dataset

The countdown task asks the model to combine numbers with arithmetic to reach a target — a clean reasoning testbed.

Eval

Training

Key code

The flow:
The evaluator scores each trajectory independently. Solver trajectories share the per-task ground truth; the judge gets its own reward depending on whether the selected solution was correct:

Files

On GitHub

cookbooks/solver_judge_flow

Full source, README, and runnable launch scripts

See also

Solver-judge tutorial

Step-by-step walkthrough of the design from scratch