Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/agent / evaluator-optimizer

evaluator-optimizer

evaluatorOptimizer({...}) — Generator → Evaluator iteration loop with three rubric kinds and a REQUIRED iteration cap.

Iteration boundary discipline: each iteration is a fresh agent.run-equivalent boundary. Intra-loop reasoning per RB-42 / suggested DEC-158 applies WITHIN one iteration, not ACROSS iterations. The Generator's iteration-N input is the original user input + the Evaluator's iteration-(N-1) critique (NOT the Generator's iteration-(N-1) internal message history).

Interfaces

InterfaceDescription
EvaluatorOptimizerOptionsOptions accepted by evaluatorOptimizer. maxIterations is REQUIRED — the helper asserts >= 1 at construction time.
EvaluatorOptimizerOutcomeAggregate outcome of an evaluatorOptimizer({...}) run.
EvaluatorOutcomePer-iteration evaluation outcome returned by the Evaluator.

Type Aliases

Type AliasDescription
EvaluatorCallableEvaluator callable shape. Receives the original user input + the candidate output and returns the structured outcome.
GeneratorCallableGenerator callable shape. Receives the original user input plus the previous iteration's critique (or undefined on the first iteration) and returns the new candidate output.
RubricRubric discriminator. Pick the variant that matches your Evaluator's contract.

Functions

FunctionDescription
evaluatorOptimizerRun the Generator → Evaluator iteration loop.