r/foojay • u/FrankCodeWriter • 4d ago
Evaluating Java AI Agents with Harness Evals
On Foojay, Geertjan Wielenga explains how to use harness-evals, an Apache 2.0 licensed evaluation framework from Harness, to test agents built with Spring AI or LangChain4j. The tool is written in Python, but it can target a Java agent through an HTTP endpoint.
The article covers:
- Metrics scored from 0.0 to 1.0 across five dimensions: correctness, groundedness, safety, trajectory and performance
- Goldens, EvalCases, Metrics and Targets
- A Spring AI controller, a goldens.jsonl file and a YAML eval config using an LLM judge
- OpenTelemetry in both directions, including turning production traces into eval cases and exporting scores with OtlpSink
- Privacy notes on capturing prompt and response content in traces
https://foojay.io/today/evaluating-java-ai-agents-with-harness-evals/
2
Upvotes