Skip to main content

Packages


Core Types

Judge

The fundamental evaluation interface. A functional interface for lambda and method reference support.
Use directly as a lambda, or extend DeterministicJudge / LLMJudge for metadata support.

AsyncJudge

Asynchronous variant for non-blocking evaluation:

ReactiveJudge

Reactive variant for Spring WebFlux / Project Reactor:

DeterministicJudge

Abstract base class for rule-based judges. Provides JudgeWithMetadata support:
JudgeWithMetadata extends Judge, so DeterministicJudge is also a Judge.

NamedJudge

Composition wrapper that attaches metadata to any judge (including lambdas):

JudgeWithMetadata

Marker interface for judges that expose identity:
Infrastructure code can use instanceof JudgeWithMetadata for discovery:

JudgeMetadata

Identity record:

JudgeType


Context

JudgmentContext

All evaluation inputs in one immutable record:
Builder methods:

ExecutionStatus


Results

Judgment

Immutable evaluation result:
Static factory methods:
Builder:
Utility methods:

JudgmentStatus

Check

Granular sub-assertion within a judgment:
Factory methods:

Score Types

Score is a sealed interface with three permitted implementations:

BooleanScore

Simple pass/fail:

NumericalScore

Continuous scoring with bounds:

CategoricalScore

Discrete categories from a fixed set:

Scores Utility

Convert between score types for heterogeneous aggregation:

Composition

Judges Utility

Static methods for creating and composing judges:

AI-Core Types

Framework-neutral infrastructure for AI-backed judges. Located in the agent-judge-ai-core module (zero external dependencies).

ModelBackedJudge

Composed AI-backed judge built via builder pattern. Pipeline: render prompt → invoke model → classify response → produce Judgment. No subclassing needed.

JudgeModel

Functional interface for AI model invocation. Framework-specific implementations live in bridge modules.

JudgePromptTemplate

Loads, validates, and renders prompt templates with {{variable}} placeholders extracted from JudgmentContext.
Available variables from JudgmentContext: {{goal}}, {{output}}, {{workspace}}, {{status}}, {{metadata.*}}.

JudgeTemplateRenderer

Pluggable template engine interface:
Default implementation SimpleJudgeTemplateRenderer performs {{variable}} substitution.

JudgmentClassifier

Functional interface that maps a model response to a Judgment:

LabelJudgmentClassifier

Exact normalized label matching with builder pattern:

Supporting Records


Jury System

Jury Interface

SimpleJury

Flat multi-judge aggregation. See Jury System for full usage. Builder:

CascadedJury

Sequential tiered evaluation. See Jury System for full usage. Builder:

Verdict

VotingStrategy

Implementations:

TierPolicy

TiePolicy

ErrorPolicy

Juries Utility


Framework Bridge Evaluators

Each framework bridge provides an Evaluator (one-liner convenience) and a JudgmentContextBuilder (full control). All evaluators follow the same 4-method pattern: Judge/Jury x with/without extra metadata.
Bridge modules declare framework dependencies with provided scope. Your application must already include the corresponding framework/runtime dependency.

SpringAiEvaluator

Bridges Spring AI ChatResponse output to agent-judge evaluation. Uses Supplier<ChatResponse> because Spring AI ChatClient calls don’t take the goal as an argument at call time.
Metadata extracted (constants in SpringAiMetadataKeys): Finish reason mapping: stop → SUCCESS, tool_calls → SUCCESS, length → SUCCESS (indicates truncation; judges may choose to abstain), content_filter → REFUSED, null → UNKNOWN

LangChain4jEvaluator

Bridges LangChain4j Result<T> to agent-judge evaluation. Uses Function<String, Result<T>> because LangChain4j AiServices are dynamic proxies — there’s no common agent interface.
Metadata extracted: Finish reason mapping: STOP/TOOL_EXECUTION → SUCCESS, LENGTH → SUCCESS (indicates truncation; judges may choose to abstain), CONTENT_FILTER → REFUSED, OTHER → UNKNOWN

KoogEvaluator

Bridges JetBrains Koog AIAgent to agent-judge evaluation. Calls agent.run(input) directly — Koog’s native Java API is synchronous from the caller’s perspective.
Metadata extracted:

AgentClientEvaluator

Bridges CLI-delegated agents (Claude Code, Codex, Gemini CLI, Amazon Q, etc.) via AgentClient. Uses Supplier<AgentClientResponse> to keep process execution inside AgentClient.
Metadata extracted (constants in AgentClientMetadataKeys): AgentClientJudgmentContextBuilder also maps result text to agentOutput, success/failure to ExecutionStatus, workspace to JudgmentContext.workspace, and metadata duration to executionTime.

JudgmentContextBuilder (All Bridges)

For full control, use the JudgmentContextBuilder directly:
Each bridge’s builder follows the same two-entry-point pattern: from() for pre-existing responses, execute() for wrapping the call. Both have overloads accepting Map<String, Object> extraMetadata for attaching run IDs, experiment tags, etc.

RAG Evaluation

RagContext

Static helper for extracting RAG metadata from a JudgmentContext:
Metadata key constants: The context() method handles both String and List<?> values — lists are joined with newlines.

RAG Judges

All three RAG judges extend LLMJudge and return ABSTAIN when required metadata is missing: See Built-in Judges for usage examples.

Module Coordinates

Judge families: Framework bridges: Add modules with explicit versions: