CtrlK
BlogDocsLog inGet started
Tessl Logo

gamussa/langchain4j-agentic

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

4.76x
Quality

89%

Does it follow best practices?

Impact

100%

4.76x

Average score across 2 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-2/

Travel Itinerary Builder with Verification

Problem Description

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.

Output Specification

Produce a self-contained Java project with the following files:

  • build.gradle.kts — Gradle build configuration for the project
  • src/main/java/demo/ — Java source files including:
    • A type representing the structured itinerary the system ultimately returns (think along the lines of destination, number of days, total estimated cost, and the planned activities)
    • The result the reviewer hands back — designed so the routing logic can branch on it, the revision step can act on it, and a successful run yields the typed itinerary itself
    • Agent interfaces for the steps in the workflow: extracting the trip request, drafting an itinerary, reviewing it against the constraints, and revising it
    • A custom routing/strategy class that decides which step runs next and loops the review-then-revise cycle until the itinerary passes or a bounded number of attempts is reached
    • A 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 review

The project must compile and the main class must be runnable (assuming ANTHROPIC_API_KEY is set in the environment).

README.md

tile.json