CODEPOCALYPSE NOW LangChain4j vs JetBrains Koog · Baruch Sadogursky and Viktor Gamov · IntelliJ IDEA Conf 2026

15:00 — Basic AI Proficiency Training (Mandatory) Run by Dana from People Ops. Neither of us is going. X/Bluesky: @gamussa | @jbaruch

PICK YOUR FIGHTER LANGCHAIN4J (Java, langchain4j-agentic 1.20) — @gamussa · KOOG (Kotlin, Koog 1.2) — @jbaruch · Vote in chat: type LC4J or KOOG X/Bluesky: @gamussa | @jbaruch

Who We Are • Viktor Gamov — @gamussa • Baruch Sadogursky — @jbaruch • Slides, code & shownotes: speaking.gamov.io • and jbaru.ch/ideaconf-2026-codepocalypse X/Bluesky: @gamussa | @jbaruch

THE BUILD — 4 ROUNDS 1 DUMB CHATBOT — prompt -> text 2 + TOOLS + MCP — it can act 3 + MEMORY — it remembers 4 + AGENTIC PIPELINE — it self-corrects X/Bluesky: @gamussa | @jbaruch

ROUND 1 — DUMB CHATBOT prompt -> text · ~15s X/Bluesky: @gamussa | @jbaruch

One Factory Call. Is That an Agent? • One factory call. Prompt in -> text out. It answers charmingly and does nothing. Is this an agent? X/Bluesky: @gamussa | @jbaruch

THIS ISN’T AN AGENT. X/Bluesky: @gamussa | @jbaruch

Let’s build a REAL agent — in Java AND Kotlin. X/Bluesky: @gamussa | @jbaruch

WHO’S RIGHT? — VOTE 1 An agent is an INTERFACE the framework implements (LC4J) · or an OBJECT you construct (KOOG)? · Type LC4J or KOOG in chat X/Bluesky: @gamussa | @jbaruch

ROUND 2 — TOOLS + MCP calendar-mcp · organizer-mcp · ~45s X/Bluesky: @gamussa | @jbaruch

It Sent It. It Reused the Excuse. • • A calendar records that you bailed. It does not record the story you told. X/Bluesky: @gamussa | @jbaruch

WHO’S RIGHT? — VOTE 2 Tools: a REGISTRY the agent owns (KOOG) · or a PROVIDER the framework injects (LC4J)? · Type LC4J or KOOG in chat X/Bluesky: @gamussa | @jbaruch

ROUND 3 — MEMORY pre-seeded · same prompt · ~40s X/Bluesky: @gamussa | @jbaruch

Three Burned Flavors. One Fresh One. • • It names the three burned flavors. It picks a fresh one. Koog: LongTermMemory · LangChain4j: ContentRetriever over an embedding store, seven lines, local ONNX model X/Bluesky: @gamussa | @jbaruch

WHO’S RIGHT? — VOTE 3 Memory: an ADVISOR wrapping the conversation · or a PROVIDER the agent declares? · Type LC4J or KOOG in chat X/Bluesky: @gamussa | @jbaruch

ROUND 4 — DOMAIN MODELLING typed subtasks · sliced tools · a critic · ~90s X/Bluesky: @gamussa | @jbaruch

The Pipeline X/Bluesky: @gamussa | @jbaruch

Same Phase, Two Languages KOOG LANGCHAIN4J val deploy by subgraphWithTask< interface Deploy { DeclineRequest, DeclineDeployment>( tools = slices.read + slices.write, llmModel = Gemini3_5Flash, @Agent(outputKey = “deployment”) DeclineDeployment deploy( @V(“declineRequest”) DeclineRequest ) { request -> “Pick the flavor…” } r); } // .toolProvider(slices.readWrite()) X/Bluesky: @gamussa | @jbaruch

Four Tool Axes Axis Tools Reaches read getCalendar, getOrganizerSensitivity nobody write createCalendarEvent Viktor’s calendar user askViktor, pingViktor, awaitApproval Viktor comms sendDecline Dana. Irreversible. deploy gets read + write. Neither user nor comms. verify is the only phase that can ask. X/Bluesky: @gamussa | @jbaruch

The A/B JCLAW_NAIVE=1 ./run.sh context ./run.sh

strips recentlyUsedFlavors + the user # the typed handoff carries the constraint

Mode What happens Time naive stages Family Obligation — burned — critic rejects, refine fixes it ~2m domain-modelled ALREADY_PROFICIENT, approved first pass ~90s X/Bluesky: @gamussa | @jbaruch

“I build AI agents for a living and I am presenting a live conference talk on exactly this topic that afternoon.” It’s true. You are watching it be true. X/Bluesky: @gamussa | @jbaruch

WHO’S RIGHT? — VOTE 4 When your guardrail framework and the model disagree, who wins? · The FRAMEWORK (tool slices decide) or the MODEL (the critic decides)? · Type LC4J or KOOG in chat X/Bluesky: @gamussa | @jbaruch

High Score MAY 2026 25% ————————> 100% SEPT 2026 44% ————-> 77% The lift shrank. Source: [DATA-01] X/Bluesky: @gamussa | @jbaruch x4 x1.75

The Bill with context ######## tokens baseline ################ tokens BASELINE: 2.06x THE TOKENS. FOR THE WORSE ANSWER. Source: [DATA-02] X/Bluesky: @gamussa | @jbaruch

Same Checkpoints. Same App. KOOG LANGCHAIN4J Chatbot AIAgent(…) AiServices.create(…) Tools + MCP McpToolRegistryProvider McpToolProvider Memory LongTermMemory ContentRetriever Typed phases subgraphWithTask<In, Out> @Agent interface method Critic loop subgraphWithVerification loopBuilder().exitCondition(…) Approval node node { awaitApproval } humanInTheLoopBuilder() The send outside the graph outside the graph X/Bluesky: @gamussa | @jbaruch

FINAL VOTE — WHO’S RIGHT? LC4J or KOOG. Last chance. Type it in chat. X/Bluesky: @gamussa | @jbaruch

THE WINNER IS THE JAVA DEVELOPER. X/Bluesky: @gamussa | @jbaruch

Pick the Language You Love • Pick the JVM language you love. The agent era is open. Code + slides -> speaking.gamov.io · jbaru.ch/ideaconf-2026-codepocalypse [QR] X/Bluesky: @gamussa | @jbaruch

15:58 — Basic AI Proficiency Training Declined. Already proficient. X/Bluesky: @gamussa | @jbaruch

CONTINUE? — As always, have a nice day. X/Bluesky: @gamussa | @jbaruch @gamussa · @jbaruch