Skip to main content
Goal Engineering turns a vague objective into a structured, measurable goal, then verifies agent output against it.

Quick Start

1

Engineer and verify a goal

Engineer a goal, run your agent against it, then verify the output:
2

Explicit criteria + constraints

Provide your own criteria and constraints to skip LLM decomposition:
3

Full control with GoalConfig

Tune the model, criteria count, and pass threshold:

How It Works

A statement is decomposed into criteria, the agent runs, and the output is scored by the same Judge used across evaluation. A judge failure is inconclusive — criteria stay pending and achieved=False, never a real unmet. The result carries an independent snapshot of criteria, so mutating it never corrupts the goal.

Configuration Options

GoalConfig follows the PraisonAI convention: False = disabled, True = defaults, GoalConfig(...) = custom.

Goal Module Reference

Full Python API for the praisonaiagents package, including the goal exports

Data Model

GoalEngineer works with three dataclasses, all importable from praisonaiagents.

SuccessCriterion

A single measurable condition that contributes to achieving a goal. Methods: to_dict(), from_dict(data) (classmethod).

Goal

A goal exposes two computed properties in addition to its fields.

GoalVerificationResult

The result returned by verify(). Method: to_dict().
A judge failure is inconclusive — criteria stay pending and achieved=False, never a real unmet.

Common Patterns

Weight criteria by importance and track weighted progress:
progress is the fraction of weighted criteria currently met, clamped to [0.0, 1.0]. Non-positive weights count as 0; when total weight is 0, criteria count equally. Reuse one engineered goal across multiple agents via to_prompt():
Persist a goal with to_dict() and restore it with from_dict():

Best Practices

Pass your own criteria (with auto_decompose=False) when you need deterministic, repeatable checks. Let auto_decompose propose criteria while you explore a new goal.
threshold defaults to 8.0, which is strict. Lower it in GoalConfig when a goal tolerates partial success, and review the value the same way you review test assertions.
Add constraints for safety and format rules that must never be violated. They render inside to_prompt(), so the agent sees them alongside the goal.
A pending status in GoalVerificationResult means the judge was unavailable — retry the verification. It is not the same as an unmet criterion.

CHL Engineering

Goal Engineering complements the Context / Harness / Loop rubric.

Judge

The LLM-as-judge that GoalEngineer.verify() reuses.

Evaluation Suite

Pair goal verification with a full eval suite.