Quick Start
Explicit criteria + constraints
Provide your own criteria and constraints to skip LLM decomposition:
How It Works
A statement is decomposed into criteria, the agent runs, and the output is scored by the sameJudge used across evaluation.
| Step | What happens |
|---|---|
| engineer | Builds a Goal from a statement. Uses supplied criteria, or the LLM proposes measurable ones when auto_decompose=True. |
| to_prompt | Renders the goal, criteria, and constraints as an instruction block for any agent. |
| verify | Reuses the unified Judge to score the output. A score at/above threshold marks the goal achieved. |
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
| Option | Type | Default | Description |
|---|---|---|---|
model | Optional[str] | os.getenv("OPENAI_MODEL_NAME", "gpt-4o-mini") | LLM model used for decomposition/verification |
max_criteria | int | 5 | Maximum success criteria auto-generated |
threshold | float | 8.0 | Score (0–10) at/above which the goal is achieved |
auto_decompose | bool | True | Auto-generate criteria via the LLM |
verbose | bool | False | Enable verbose logging |
GoalConfig follows the PraisonAI convention: False = disabled, True = defaults, GoalConfig(...) = custom.
Goal Module Reference
Full Python API for the goal package
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():
to_dict() and restore it with from_dict():
Best Practices
Prefer explicit criteria for tests
Prefer explicit criteria for tests
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.Tune the threshold deliberately
Tune the threshold deliberately
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.Use constraints for hard rules
Use constraints for hard rules
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.Treat pending as retry, not failure
Treat pending as retry, not failure
A
pending status in GoalVerificationResult means the judge was unavailable — retry the verification. It is not the same as an unmet criterion.Related
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.

