Codepocalypse Now: LangChain4j vs. Koog

A presentation at IntelliJ IDEA Conf 2026 in September 2026 in Amsterdam, Netherlands by Viktor Gamov

Slide 1

Slide 1

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

Slide 2

Slide 2

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

Slide 3

Slide 3

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

Slide 4

Slide 4

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

Slide 5

Slide 5

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

Slide 6

Slide 6

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

Slide 7

Slide 7

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

Slide 8

Slide 8

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

Slide 9

Slide 9

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

Slide 10

Slide 10

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

Slide 11

Slide 11

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

Slide 12

Slide 12

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

Slide 13

Slide 13

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

Slide 14

Slide 14

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

Slide 15

Slide 15

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

Slide 16

Slide 16

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

Slide 17

Slide 17

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

Slide 18

Slide 18

The Pipeline X/Bluesky: @gamussa | @jbaruch

Slide 19

Slide 19

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

Slide 20

Slide 20

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

Slide 21

Slide 21

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

Slide 22

Slide 22

“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

Slide 23

Slide 23

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

Slide 24

Slide 24

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

Slide 25

Slide 25

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

Slide 26

Slide 26

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

Slide 27

Slide 27

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

Slide 28

Slide 28

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

Slide 29

Slide 29

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

Slide 30

Slide 30

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

Slide 31

Slide 31

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