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

[DEVTALKS] From AI to Agent with Langchain4J

Avatar for Loïc Loïc
September 24, 2026

[DEVTALKS] 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

September 24, 2026

More Decks by Loïc

Other Decks in Programming

Transcript

  1. AI Service @UserMessage(""" Turn this message into a sitter card

    with exactly these five lines. Invent nothing — if the message does not say, write "not given": Dog: Meals: Walks: Watch out for: Vet: Message: {{message}}""") String card(@V("message") String message); @LoMagnette
  2. Agent An agent is a service that talk to an

    AI model to perform a goalbased operation using the tools and context it has. @LoMagnette
  3. Agent @Agent(description = "Turns a rambling message about the dog

    into a structured sitter card") @UserMessage(""" Turn this message into a sitter card with exactly these five lines. Invent nothing — if the message does not say, write "not given": Dog: Meals: Walks: Watch out for: Vet: Message: {{message}}""") String card(@V("message") String message); @LoMagnette
  4. Typed key public record Checklist() implements TypedKey<String>{} var list =

    AgenticServices.agentBuilder(FridgeChecklist.class) .chatModel(model) .name("FridgeChecklist") .outputKey(Checklist.class) .build();
  5. Where to start WORKFLOW GOAP, P2P, Voting,… 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 Start here @LoMagnette