Packages
Core Types
Judge
The fundamental evaluation interface. A functional interface for lambda and method reference support.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. ProvidesJudgeWithMetadata 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:instanceof JudgeWithMetadata for discovery:
JudgeMetadata
Identity record:JudgeType
Context
JudgmentContext
All evaluation inputs in one immutable record:ExecutionStatus
Results
Judgment
Immutable evaluation result:JudgmentStatus
Check
Granular sub-assertion within a judgment: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 theagent-judge-ai-core module (zero external dependencies).
ModelBackedJudge
Composed AI-backed judge built via builder pattern. Pipeline: render prompt → invoke model → classify response → produceJudgment. 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:SimpleJudgeTemplateRenderer performs {{variable}} substitution.
JudgmentClassifier
Functional interface that maps a model response to aJudgment:
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
TierPolicy
TiePolicy
ErrorPolicy
Juries Utility
Framework Bridge Evaluators
Each framework bridge provides anEvaluator (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 AIChatResponse output to agent-judge evaluation.
Uses Supplier<ChatResponse> because Spring AI ChatClient calls don’t take the goal as an argument at call time.
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 LangChain4jResult<T> to agent-judge evaluation.
Uses Function<String, Result<T>> because LangChain4j AiServices are dynamic proxies — there’s no common agent interface.
Finish reason mapping:
STOP/TOOL_EXECUTION → SUCCESS, LENGTH → SUCCESS (indicates truncation; judges may choose to abstain), CONTENT_FILTER → REFUSED, OTHER → UNKNOWN
KoogEvaluator
Bridges JetBrains KoogAIAgent to agent-judge evaluation.
Calls agent.run(input) directly — Koog’s native Java API is synchronous from the caller’s perspective.
AgentClientEvaluator
Bridges CLI-delegated agents (Claude Code, Codex, Gemini CLI, Amazon Q, etc.) via AgentClient. UsesSupplier<AgentClientResponse> to keep process execution inside AgentClient.
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 theJudgmentContextBuilder directly:
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 aJudgmentContext:
The
context() method handles both String and List<?> values — lists are joined with newlines.
RAG Judges
All three RAG judges extendLLMJudge 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: