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

[JCON SLOVENIA] From AI to Agent with Langchain4J

[JCON SLOVENIA] From AI to Agent with Langchain4J

You’ve built AI features into your application. Models are wrapped in services, RAG is in place, tools are wired, and calls are flowing. Then requirements evolve. A single response is no longer enough. You need steps that follow each other, branches based on decisions, retries when things fail, and sometimes multiple actions happening at the same time. At that point, it becomes unclear how to structure the logic without losing control or readability.

In this talk, we move from AI calls to agentic systems using LangChain4j. We’ll explore common workflow patterns such as sequential, loop, parallel, and conditional flows, along with error handling as a first-class concern. From there, we’ll zoom out to agentic concepts like shared state with an AgenticScope, goal-oriented agents, and pure agentic setups. We’ll also look beyond AI-only approaches, mixing in non-AI agents and human-in-the-loop interactions. All of this will be built live, step by step, to show how these ideas work in practice.

You’ll leave with a concrete understanding of when to use workflows and when to rely on agents, how to combine both without confusion, and how to keep state, goals, and responsibilities explicit. The goal is not to build smarter prompts, but systems that are easier to reason about, easier to evolve, and better aligned with real-world application needs.

Avatar for Loïc

Loïc

May 28, 2026

More Decks by Loïc

Other Decks in Technology

Transcript

  1. public interface SithNameGenerator { @UserMessage(""" You are a Sith naming

    council. Transform this boring name into something properly villainous. Return ONLY the Sith name, nothing else: {{jediName}}""") String darken(@V("jediName") String jediName); } Ai Service @LoMagnette
  2. AGENT An agent is a service that talk to an

    AI model to perform a goal- based operation using the tools and context it has. @LoMagnette
  3. public interface SithNameGenerator { @UserMessage(""" You are a Sith naming

    council. Transform this boring name into something properly villainous. Return ONLY the Sith name, nothing else: {{jediName}}""") @Agent("Transforms a Jedi name into a suitably menacing Sith identity") String darken(@V("jediName") String jediName); } AGENT @LoMagnette
  4. Typed key public static class InterceptedTransmission implements TypedKey<String> { @Override

    public String defaultValue() { return "No transmission intercepted"; } } @LoMagnette
  5. WORKFLOW GOAL-ORIENTED SUPERVISOR Control High Medium Low (LLM) Flexibility Low

    Medium-High High Cost Low Medium High Auditability Excellent Good Difficult Best for Stable pipeline Variable deps Adaptive systems Deterministic Autonomous Where to start Start here @LoMagnette