Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Year of Agentic AI Evolution: Lessons Learned...

Avatar for Mario Fusco Mario Fusco
September 16, 2026

A Year of Agentic AI Evolution: Lessons Learned Building Production-grade Agentic Systems

Last year at Devoxx, we introduced the first version of LangChain4j's agentic framework and explored the core patterns behind agentic AI systems.

Since then, real-world usage, community feedback, and a lot of experimentation have taught us that production-ready agentic systems need more than a fixed set of predefined patterns. Different use cases need different trade-offs, and a predefined list can only take you so far.

In this session, we'll show how LangChain4j's agentic support has evolved. We have moved toward a more flexible orchestration model that lets developers compose their own strategies, while also allowing us to grow the library of built-in patterns. We will demonstrate in practice how these new patterns work discussing their respective pros and cons and fields of applicability.

We'll also cover the operational capabilities added to the framework to make these workloads production-ready. You'll see how to observe and trace agent execution, persist state, recover long-running workflows after failures, and handle human-in-the-loop pauses without losing control of the process.

Join us as we demonstrate these new features along with their trade-offs, and learn what it takes to build robust, production-ready agentic systems.

Avatar for Mario Fusco

Mario Fusco

September 16, 2026

More Decks by Mario Fusco

Other Decks in Programming

Transcript

  1. e w e r e h W Foundation Memory AI

    Services Function calling r a e y t left las Workflow & Patterns Chaining Parallelization Looping Goal-based Autonomy Autonomous Multi-agent Planning
  2. p e t s g n i s s i

    m e h T Foundation Memory AI Services Function calling Workflow & Patterns Chaining Parallelization Looping Goal-based Autonomy User-Defined Planning Autonomous Multi-agent Planning Pluggable Planning Strategy One size doesn’t fit all!
  3. Wha y t i l a e r n i

    d e n e p t hap Foundation Memory AI Services Function calling Workflow & Patterns Chaining Parallelization Looping Goal-based Autonomy User-Defined Planning Autonomous Multi-agent Planning Pluggable Planning Strategy
  4. g n i s s i m se was l

    e t a h W Foundation Memory AI Services Function calling Workflow & Patterns Chaining Parallelization Looping Tracing Faulttolerance Goal-based Autonomy User-Defined Planning Autonomous Multi-agent Planning Pluggable Planning Strategy Security Skills Persistence Observability
  5. It all starts with a single AI Service A Large

    Language Model is at the core of any AI-Infused Application … but this is not enough. LLM You also need: - Well crafted prompts guiding the LLM in the most precise and Guardrails least ambiguous possible ways - A chat memory to "remember" previous interactions and make the AI service conversational - External tools (function calling) expanding LLM capabilities and Application take responsibility for deterministic tasks where generative AI falls short - Data/Knowledge sources to provide contextual information (RAG) and persist the LLM state - Guardrails to prevent malicious input and block wrong or unacceptable responses Tools Prompts Memory Data Sources
  6. From a single AI service to Agentic Systems 1 AI

    Service, 1 Model Application x AI Services, y Models, z Agents
  7. The langchain4j-agentic module - Introduced in August 2025 From LangChain4j

    1.3.0 4 deterministic workflow patterns Full agentic supervisor pattern
  8. Agents programmatic orchestration The simplest way to glue agents together

    is programmatically orchestrating them in fixed and predetermined workflows 4 basic patterns that can be used as building blocks to create more complex interactions - Sequence / Prompt chaining Loop / Reflection Parallelization Conditional / Routing
  9. From AI Orchestration to Pure Agentic AI Workflow LLMs and

    tools are programmatically orchestrated through predefined code paths and workflows Agents LLMs dynamically direct their own processes and tool usage, maintaining control over how they execute tasks
  10. A Pure Agentic AI case study – Supervisor pattern -

    All agentic systems explored so far orchestrated agents programmatically in a fully deterministic way - In many cases agentic system have to be more flexible and adaptive - A pure agentic AI system ◦ Takes autonomous decisions ◦ Decides iteratively which agent has to be invoked next ◦ Uses the result of previous interactions to determine if it is done and achieved its final goal ◦ Uses the context and state to generate the arguments to be passed to the selected agent
  11. A Pure Agentic AI case study – Supervisor pattern Determine

    if done or next invocation Input Supervisor Done Response public record AgentInvocation( String agentName, Map<String, String> arguments) { } Agent result + State Agent A Agent C Agent B Pool of agents
  12. Custom Agentic Patterns - One size does NOT fit all

    Agentic Scope State Pluggable Planner Request Action Result Execution Layer Agent A Invoke Agent B Agent C Workflow Supervisor GOAP P2P … Customizable by the framework (Quarkus)
  13. The Planner interface Any agentic pattern is simply a different

    specification of an execution plan for the subagents that it coordinates. The Planner interface generalizes this concept. public interface Planner { default void init(InitPlanningContext initPlanningContext) { } default Action firstAction(PlanningContext planningContext) { return nextAction(planningContext); } Action nextAction(PlanningContext planningContext); }
  14. Sequential Workflow as Planner public class SequentialPlanner implements Planner {

    private List<AgentInstance> agents; private int agentCursor = 0; @Override public void init(InitPlanningContext initPlanningContext) { this.agents = initPlanningContext.subagents(); } @Override public Action nextAction (PlanningContext planningContext) { return agentCursor < agents.size() ? call(agents.get(agentCursor++)) : done(); } } Stores the subagents coordinated by this Planner Calls the next subagent in the sequence if any … … otherwise it’s done
  15. Using the Sequential Planner public class SequentialPlanner implements Planner {

    private List<AgentInstance> agents; private int agentCursor = 0; @Override public void init(InitPlanningContext initPlanningContext) { this.agents = initPlanningContext.subagents(); } Defines an agents coordinator based on a custom Planner @Override public Action nextAction (PlanningContext planningContext) { return agentCursor < agents.size() ? call(agents.get(agentCursor++)) : done(); } } Supplier var novelCreator = AgenticServices.plannerBuilder() .subAgents(creativeWriter,styleEditor) .outputKey("story") .planner(SequentialPlanner:: new) .build();
  16. Create your own agentic pattern - Goal Oriented Planner public

    class GoalOrientedPlanner implements Planner { private String goal; private GoalOrientedSearchGraph graph; private List<AgentInstance> path; private int agentCursor = 0; @Override public void init(InitPlanningContext initPlanningContext) { this.goal = initPlanningContext.plannerAgent().outputKey(); this.graph = new GoalOrientedSearchGraph(initPlanningContext.subagents()); } @Override public Action firstAction(PlanningContext planningContext) { path = graph.search(planningContext.agenticScope().state().keySet(), goal); if (path.isEmpty()) { throw new IllegalStateException("No path found for goal: " + goal); } return call(path.get(agentCursor++)); } @Override public Action nextAction(PlanningContext planningContext) { return agentCursor >= path.size() ? done() : call(path.get(agentCursor++)); } }
  17. Create your own agentic pattern - Goal Oriented Planner public

    class GoalOrientedPlanner implements Planner { private String goal; private GoalOrientedSearchGraph graph; private List<AgentInstance> path; private int agentCursor = 0; @Override public void init(InitPlanningContext initPlanningContext) { this.goal = initPlanningContext.plannerAgent().outputKey(); this.graph = new GoalOrientedSearchGraph(initPlanningContext.subagents()); } @Override public Action firstAction(PlanningContext planningContext) { path = graph.search(planningContext.agenticScope().state().keySet(), goal); if (path.isEmpty()) { throw new IllegalStateException("No path found for goal: " + goal); } return call(path.get(agentCursor++)); } @Override public Action nextAction(PlanningContext planningContext) { return agentCursor >= path.size() ? done() : call(path.get(agentCursor++)); } } Uses final output as goal Builds subagents graph based on their input/output Calculates path to goal using initial state as preconditions Invokes subagents in sequence
  18. Goal Oriented Planner at work person Horoscope Generator prompt Person

    Extractor person prompt Sign Extractor sign sign person horoscope story horoscope Writer writeup person horoscope Story Finder story
  19. Goal Oriented Planner at work person Horoscope Generator prompt Person

    Extractor person prompt Sign Extractor sign sign person horoscope story horoscope horoscope Story Finder Writer writeup person goal story var horoscopeAgent = AgenticServices.plannerBuilder().outputKey("writeup") .subAgents(horoscopeGenerator, personExtractor, signExtractor, writer, storyFinder) .planner(GoalOrientedPlanner:: new) .build();
  20. Goal Oriented Planner at work String writeup = horoscopeAgent.invoke( Map.of("prompt",

    "My name is Mario and my zodiac sign is pisces")); prompt Sign Extractor Person Extractor person horoscope story person sign Horoscope Generator Story Finder person horoscope Writer writeup
  21. Mixing Goal Oriented with other Agentic patterns String writeup =

    horoscopeAgent.invoke(Map.of( "prompt", "My name is Mario and my zodiac sign is pisces")); Person Extractor horoscope story person sign Horoscope Generator Story Finder Style Review Loop person horoscope Writer unedited writeup Style Editor Sign Extractor person Style Scorer prompt writeup
  22. One size does not fit all - Agentic patterns comparison

    Pattern How it works Pros Cons GOAP Builds dependency graph from agent I/O; searches shortest path to goal • • • Auto-ordering Zero LLM overhead Crash-resilient • • No loops Rigid once path is set DAG pipelines with derivable ordering P2P Agents self-activate when inputs appear in scope; changes retrigger dependents • • • Decentralized Support refinement cycles Parallel when possible • • Risk of infinite loops Hard to debug emergent order Iterative research with reactive convergence Like P2P but centralized, one agent per step picked by conflict resolver • • • Predictable 1-step exec Pluggable priority Support HITL • Blackboard Sequential even when parallelism is safe Diagnostic system with incremental data Voting All agents run on same input; results aggregated by pluggable strategy • • Maximum parallelism Ensemble reduces bias • • Redundant N×cost No agent interaction Classification, moderation, consensus decision Parallel rounds of critique until convergence, then judge synthesizes verdict • Adversarial scrutiny catches subtle errors • Debate Highest cost (rounds+agents) May not converge Code review, fact checking, ethics panels BDI Prioritized desires with achievable/satisfied predicates; higher-priority preempts intention • • Complex configuration Agents must be idempotent Dynamic environment with competing, shifting priorities • Reactive re-planning Resumes interrupted goals • • Best for
  23. Agentic pattern example: Blackboard - Activates agents based on data

    availability in the shared scope. Agents are knowledge sources that post partial results to the the blackboard. After each agent completes, the planner inspects the blackboard and activates whichever single agent can contribute next. When multiple agents are ready, a pluggable conflict resolution strategy determines which one fires. Blackboard (shared state) External systems DB & Tools Worker Agent #1 Worker Agent #2 Knowledge sources Worker Agent #3
  24. Blackboard - A use case: Medical diagnostic support Lab Analyzer

    patientInput labResults medications labResults labAnalysis 6 7 patientInput Symptom Extractor 1 4 Blackboard (shared state) 2 3 symptoms 10 diagnosis symptoms medications 5 Drug Interaction Checker drugInteractions drugInteractions 8 symptoms labAnalysis diagnosis 9 Diagnosis Generator
  25. Blackboard - A use case: Medical diagnostic support public interface

    MedicalDiagnostics { @Agent(outputKey = "diagnosis") String diagnose(String patientInput, String labResults, String medications); } MedicalDiagnostics diagnostics = AgenticServices .plannerBuilder(MedicalDiagnostics.class) .subAgents(symptomExtractor, labAnalyzer, drugInteraction, diagnosis) .planner(BlackboardPlanner::new) .build(); String result = diagnostics.diagnose( "Patient reports persistent headaches, dizziness, and blurred vision for the past week. " + "Blood pressure measured at 180/110 mmHg.", "CBC: normal. BMP: elevated creatinine (2.1 mg/dL), elevated BUN (35 mg/dL). " + "Urinalysis: proteinuria detected.", "Lisinopril 10mg daily, Metformin 500mg twice daily");
  26. Blackboard - A use case: Medical diagnostic support Diagnosis: Based

    on the symptoms and lab findings provided, the preliminary diagnosis appears to be **hypertensive crisis** potentially secondary to **chronic kidney disease (CKD)**. The key points leading to this diagnosis include: ### Key Symptoms: 1. **Persistent Headaches**: Often associated with high blood pressure. 2. **Dizziness**: Can be a result of hypertension or side effects of medications. 3. **Blurred Vision**: May indicate hypertensive retinopathy or other complications of uncontrolled hypertension. 4. **High Blood Pressure (180/110 mmHg)**: Significantly elevated, indicating poorly controlled hypertension. ### Lab Findings: 1. **Elevated Creatinine (2.1 mg/dL)**: Suggests impaired kidney function. 2. **Elevated BUN (35 mg/dL)**: Further supports renal impairment. 3. **Proteinuria**: Indicates possible kidney damage, consistent with CKD. ### Differential Diagnoses: 1. **Chronic Kidney Disease (CKD)**: The combination of elevated creatinine, BUN, and proteinuria suggests CKD, which can lead to secondary hypertension. 2. **Acute Kidney Injury (AKI)**: While less likely given the chronic nature of the symptoms, it should be considered if there are acute changes in renal function. 3. **Hypertensive Encephalopathy**: Severe hypertension can lead to neurological symptoms such as headaches, dizziness, and blurred vision. 4. **Diabetic Nephropathy**: Given the patient's use of Metformin, underlying diabetic nephropathy should be considered as a potential cause of renal impairment. ### Recommendations for Further Evaluation: 1. **Renal Imaging**: Ultrasound or CT scan to assess kidney structure and rule out obstructive causes. 2. **Urine Studies**: 24-hour urine collection for protein quantification and further evaluation of kidney function. 3. **Blood Pressure Monitoring**: Frequent monitoring to assess the effectiveness of antihypertensive therapy. 4. **Endocrine Evaluation**: Consider evaluation for secondary causes of hypertension, such as hyperaldosteronism or pheochromocytoma, especially if there is a family history or other suggestive symptoms. ### Management Considerations: 1. **Adjust Antihypertensive Therapy**: The current dose of Lisinopril may need to be increased, or additional antihypertensive agents may be required to achieve better blood pressure control. 2. **Monitor Renal Function**: Regular monitoring of renal function is crucial, especially given the patient's use of Metformin. 3. **Lifestyle Modifications**: Encourage dietary changes, weight management, and regular physical activity to help control blood pressure and improve overall health. In summary, the combination of symptoms and lab findings suggests a significant renal issue contributing to poorly controlled hypertension. A comprehensive evaluation and management plan should be initiated to address both the hypertension and the underlying renal impairment.
  27. DEMO TIME !!! Voting Pattern + Dynamic chat model selection

    + Observability https://github.com/mariofusco/voting-agentic-pattern
  28. Why Java + Quarkus + LangChain4j ➢ Explicit contracts leveraging

    Java type system ◦ ➢ A battle-tested ecosystem ◦ ➢ data, messaging, identity and deployment Constraints for Code Assistants ◦ ➢ strong typing, interfaces, records, validation and schemas fewer ambiguous implementation choices Production controls ◦ OIDC, telemetry, observability, health and fault tolerance
  29. Enterprise-grade Agents - Fault Tolerance import org.eclipse.microprofile.faulttolerance.Fallback; import org.eclipse.microprofile.faulttolerance.Retry; public

    interface CategoryRouter { @UserMessage(""" Analyze the following user request and categorize it as 'legal', 'medical' or 'technical'. In case the request doesn't belong to any of those categories categorize it as 'unknown'. Reply with only one of those words and nothing else. The user request is: '{{request}}'. """) @Agent(description = "Categorize a user request", outputKey = "category") @Retry(maxRetries = 3, delay = 2000) @Fallback(fallbackMethod = "unknownCategory") RequestCategory classify(String request); } Use common fault-tolerance annotations with agents
  30. Enterprise-grade Agents - Security and Compliance ➢ ➢ ➢ Input

    Guardrails → invoked before the LLM is called ◦ Verify the user input is not out of scope ◦ Guard against a prompt injection attack Output guardrails → executed after the LLM has produced its output ◦ Ensure the output format is correct (i.e. a JSON document with the correct schema) ◦ Ensure the LLM output is coherent with business rules and constraints ◦ Detect hallucinations Also available on tools call
  31. Enterprise-grade Agents - Persistence and Durability ➢ Persist agentic systems

    execution via Quarkus Flow integration ◦ Lightweight, native-friendly workflow engine for Quarkus ◦ Seamless Agentic workflows integrating with LangChain4j ◦ Encode guardrails, critique/revise loops, compliance checks, Human-in-the-loop steps, as explicit workflow tasks and transitions
  32. Enterprise-grade Agents - MCP Integration ➢ Portability ◦ ➢ Security

    ◦ ➢ Expose business capabilities through a standard protocol Keep authn, authz and policy at the service boundary, e.g. with Keycloak Schemas ◦ Generate tool schemas from typed method signatures o le b a t r ls po MCP o t s e mak
  33. Enterprise-grade Agents - A2A Integration ➢ Agent Cards ◦ ➢

    Distributed ◦ ➢ Expose skills, endpoints and authentication requirements Delegate work across teams or frameworks Isolation ◦ Each agent keeps its internal implementation Agent card + skills ↕ A2A Remote delegation
  34. ➢ Idiomatic Java ◦ ➢ Stringly vs Strongly typing Flexible,

    powerful, composable, customizable agentic framework ◦ One size does not fit all
  35. ➢ Idiomatic Java ◦ ➢ Stringly vs Strongly typing Flexible,

    powerful, composable, customizable agentic framework ◦ One size does not fit all ➢ Battle-proof enterprise-grade features ◦ ➢ Fault-tolerance, observability, security … Remote integration protocols ◦ MCP connects tools and context ◦ A2A connects remote agents
  36. References ➢ LangChain4j ◦ ➢ LangChain4j Agentic Framework Docs ◦

    ➢ https://github.com/langchain4j/langchain4j https://docs.langchain4j.dev/tutorials/agents/ Quarkus LangChain4j Workshop ◦ https://quarkus.io/quarkus-workshop-langchain4j/ SLIDES