Build and demo Java AI agent systems with langchain4j-agentic: workflow patterns, supervisor, custom Planner strategies (incl. the flagship typed-verdict / CriticResult-style critic pattern), plus MCP tools, A2A remote agents, build setup, and conference-demo storylines. Pinned to 1.15.0 / 1.15.0-beta25.
84
89%
Does it follow best practices?
Impact
100%
4.76xAverage score across 2 eval scenarios
Passed
No known issues
A travel-booking startup wants to turn free-text customer trip requests (e.g. "5 days in Lisbon for under €1200, I love food markets and live music") into concrete, bookable itineraries — automatically. A one-shot answer isn't good enough: after drafting an itinerary the system has to check it against the customer's stated constraints (budget, trip length, stated preferences) and, when the check fails, revise the draft and check it again, repeating until the itinerary clears the constraints or a retry limit is hit.
The hard part is the hand-off between the checking step and the revision step. The reviewer can't just say "no" — the revision step needs to know why the draft fell short in order to fix it, and when the itinerary finally passes, the caller wants the actual itinerary object back (so it can be priced and booked), not a chat-style string summary. The team has chosen the LangChain4j agentic framework for this in Java, and they want the routing between the steps to be explicit, debuggable Java rather than left to an LLM to decide.
Produce a self-contained Java project with the following files:
build.gradle.kts — Gradle build configuration for the projectsrc/main/java/demo/ — Java source files including:
Main.java wiring class that assembles the system, runs it against one sample trip request, and writes an execution report file to the project directory for later reviewThe project must compile and the main class must be runnable (assuming ANTHROPIC_API_KEY is set in the environment).