<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-llm-as-a-judge-using-recursive-advisors-in-spring-ai-ikqydk46l" -->

---
title: Building LLM-as-a-Judge Using Recursive Advisors in...
description: A step-by-step guide to implementing the LLM-as-a-Judge pattern in Spring AI using recursive advisors. The pattern uses a second LLM call to evaluate and score...
canonical: https://daily.dev/posts/building-llm-as-a-judge-using-recursive-advisors-in-spring-ai-ikqydk46l
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building LLM-as-a-Judge Using Recursive Advisors in Spring AI | daily.dev
og:description: A step-by-step guide to implementing the LLM-as-a-Judge pattern in Spring AI using recursive advisors. The pattern uses a second LLM call to evaluate and score...
og:url: https://daily.dev/posts/building-llm-as-a-judge-using-recursive-advisors-in-spring-ai-ikqydk46l
og:image: https://api.daily.dev/og/posts/iKQYdk46l.png
og:image:alt: Building LLM-as-a-Judge Using Recursive Advisors in Spring AI
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building LLM-as-a-Judge Using Recursive Advisors in Spring AI

**[Baeldung](https://daily.dev/sources/baeldung)** · 9 min read · 4 upvotes · 1 comments

## Summary

A step-by-step guide to implementing the LLM-as-a-Judge pattern in Spring AI using recursive advisors. The pattern uses a second LLM call to evaluate and score the generator's response against a rubric, then feeds critique back into the prompt for refinement — looping until a quality threshold is met or a max attempt limit is reached. The implementation covers a Verdict record for structured output, a judge system prompt with explicit rubric, a CallAdvisor class with configurable score threshold and max refinements, Spring Boot configuration wiring, and a MockitoBean-based test that simulates the full generate-evaluate-refine cycle without a real API key.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://feeds.feedblitz.com/~/959091593/0/baeldung~Building-LLMasaJudge-Using-Recursive-Advisors-in-Spring-AI>

## Community discussion

Top comments from developers on daily.dev.

**@kartiknvj** · 0 upvotes

> Good, concrete walkthrough of the generate-evaluate-refine loop. The one thing I'd stress for anyone shipping this: a single judge model scoring against its own rubric drifts without calibration, so it helps to check judge scores against a small human-labeled set before you trust the threshold and max-attempt cap. How did you land on the score threshold value, tuned against labeled examples or set by feel?

## Similar posts on daily.dev

- [LLM Response Evaluation with Spring AI: Building LLM-as-a-Judge Using Recursive Advisors](https://daily.dev/posts/llm-response-evaluation-with-spring-ai-building-llm-as-a-judge-using-recursive-advisors-d1ilbehmj) · Spring · 0 upvotes · 0 comments
- [A Guide to Spring AI Recursive Advisors](https://daily.dev/posts/a-guide-to-spring-ai-recursive-advisors-8h7t8k0jp) · Baeldung · 1 upvotes · 0 comments
- [Create Self-Improving AI Agents Using Spring AI Recursive Advisors](https://daily.dev/posts/create-self-improving-ai-agents-using-spring-ai-recursive-advisors-dribz0r4w) · Spring · 2 upvotes · 0 comments
- [Evals and Guardrails in Enterprise workflows \(Part 2\)](https://daily.dev/posts/evals-and-guardrails-in-enterprise-workflows-part-2--1iyrr86co) · Weaviate · 1 upvotes · 0 comments
- [LLM-as-a-Judge: What It Is, Why It Works, and How to Use It to Evaluate AI Models](https://daily.dev/posts/llm-as-a-judge-what-it-is-why-it-works-and-how-to-use-it-to-evaluate-ai-models-oxkip3mvc) · Towards Data Science · 1 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#llm](https://daily.dev/tags/llm), [#openai](https://daily.dev/tags/openai), [#spring-ai](https://daily.dev/tags/spring-ai)

[View this post on daily.dev](https://daily.dev/posts/building-llm-as-a-judge-using-recursive-advisors-in-spring-ai-ikqydk46l)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building LLM-as-a-Judge Using Recursive Advisors in Spring AI","url":"https://daily.dev/posts/building-llm-as-a-judge-using-recursive-advisors-in-spring-ai-ikqydk46l","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-llm-as-a-judge-using-recursive-advisors-in-spring-ai-ikqydk46l"},"datePublished":"2026-07-04T21:47:28.197Z","dateModified":"2026-07-04T21:48:02.791Z","description":"A step-by-step guide to implementing the LLM-as-a-Judge pattern in Spring AI using recursive advisors. The pattern uses a second LLM call to evaluate and score...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0aef58ddf52c2c440b51fefe6f0b7baa?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/0aef58ddf52c2c440b51fefe6f0b7baa?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Baeldung","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Baeldung","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/52cccfb454d946c4b7dfa5e816f9e576","url":"https://daily.dev/sources/baeldung"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/building-llm-as-a-judge-using-recursive-advisors-in-spring-ai-ikqydk46l","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"java,llm,openai,spring-ai","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Baeldung","item":"https://daily.dev/sources/baeldung"},{"@type":"ListItem","position":3,"name":"Building LLM-as-a-Judge Using Recursive Advisors in Spring AI"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/building-llm-as-a-judge-using-recursive-advisors-in-spring-ai-ikqydk46l","comment":[{"@type":"Comment","text":"Good, concrete walkthrough of the generate-evaluate-refine loop. The one thing I’d stress for anyone shipping this: a single judge model scoring against its own rubric drifts without calibration, so it helps to check judge scores against a small human-labeled set before you trust the threshold and max-attempt cap. How did you land on the score threshold value, tuned against labeled examples or set by feel?","datePublished":"2026-07-06T17:11:50.392Z","url":"https://daily.dev/posts/iKQYdk46l#c-RGZ0nj6Do","author":{"@type":"Person","name":"kartik-nvjk","url":"https://daily.dev/kartiknvj","image":"https://media.daily.dev/image/upload/s--3gGgsVCw--/f_auto/v1781456774/avatars/avatar_TvTVeiMdkRCqWUDullFmy?_a=BAMAMiWQ0"}}]}
```

