https://github.com/bootcamptoprod/spring-ai-evaluator-optimizer-workflow
A simple spring boot app demonstrating how to implement Evaluator Optimizer Workflow pattern using Spring AI
https://github.com/bootcamptoprod/spring-ai-evaluator-optimizer-workflow
agentic-pattern agentic-patterns ai-agentic-patterns ai-workflows ai-workflows-pattern evaluator-optimizer-pattern evaluator-optimizer-workflow evaluator-optimizer-workflow-pattern spring-ai spring-ai-evaluator-optimizer-pattern spring-ai-evaluator-optimizer-workflow spring-ai-evaluator-optimizer-workflow-pattern
Last synced: 4 months ago
JSON representation
A simple spring boot app demonstrating how to implement Evaluator Optimizer Workflow pattern using Spring AI
- Host: GitHub
- URL: https://github.com/bootcamptoprod/spring-ai-evaluator-optimizer-workflow
- Owner: BootcampToProd
- Created: 2025-06-19T18:40:37.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-06-22T11:04:16.000Z (6 months ago)
- Last Synced: 2025-06-22T12:19:24.944Z (6 months ago)
- Topics: agentic-pattern, agentic-patterns, ai-agentic-patterns, ai-workflows, ai-workflows-pattern, evaluator-optimizer-pattern, evaluator-optimizer-workflow, evaluator-optimizer-workflow-pattern, spring-ai, spring-ai-evaluator-optimizer-pattern, spring-ai-evaluator-optimizer-workflow, spring-ai-evaluator-optimizer-workflow-pattern
- Language: Java
- Homepage: https://bootcamptoprod.com/spring-ai-evaluator-optimizer-pattern-guide/
- Size: 7.81 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring AI - Evaluator Optimizer Workflow Pattern
This repository demonstrates the **Spring AI Evaluator Optimizer Workflow Pattern**, a powerful self-improving AI system that creates high-quality output through iterative refinement. The pattern uses two specialized LLM roles - a "Generator" (Writer) to create initial content and an "Evaluator" (Editor) to critique and guide improvements until the output meets predefined quality standards.
📖 **Dive Deeper**: For a complete walkthrough, detailed explanations of the Evaluator Optimizer Workflow pattern, and step-by-step instructions for building the example application, read our comprehensive blog post.
👉 [Spring AI Evaluator Optimizer Pattern: Building Smarter AI That Gets Better With Each Try](https://bootcamptoprod.com/spring-ai-evaluator-optimizer-pattern-guide/)
🎥 **Visual Learning**: Prefer video tutorials? Watch our step-by-step implementation guide on YouTube.
👉 [Spring AI Evaluator Optimizer Pattern: Building Smarter AI That Gets Better With Each Try](https://youtu.be/ztwDbOQXlTA)
---
## 📦 Environment Variables
Make sure to provide these Java environment variables when running the application:
- `GEMINI_API_KEY`: Your Google Gemini API key.
---
## About This Project
This project implements a **Smart Email Generator** as a real-world example of the Spring AI Evaluator Optimizer Workflow. It showcases how to:
* Set up a Spring Boot application with Spring AI and Google Gemini integration.
* Implement the `EmailEvaluatorOptimizer` workflow with recursive improvement loops.
* Create specialized AI personas through carefully crafted system prompts for Writer and Editor roles.
* Build a complete REST API for professional email generation with quality assurance.
* Handle iterative refinement with safety limits and comprehensive error handling.
The application generates professional emails (job follow-ups, raise requests, etc.) that are automatically refined through multiple rounds of AI-powered editing until they meet strict quality criteria, including a 80-word limit for conciseness.
---
**Learn More**: This is part of our Spring AI Agentic Workflow series. Check out our other workflow patterns:
- [Chain Workflow Pattern](https://bootcamptoprod.com/spring-ai-chain-workflow-guide/)
- [Parallelization Workflow Pattern](https://bootcamptoprod.com/spring-ai-parallelization-workflow-guide/)
- [Routing Workflow Pattern](https://bootcamptoprod.com/spring-ai-routing-workflow-guide/)
- [Orchestrator-Workers Workflow Pattern](https://bootcamptoprod.com/spring-ai-orchestrator-workers-workflow-guide/)