Codepocalypse Now: LangChain4j vs. Spring AI

A presentation at Arc Of AI in April 2026 in Austin, TX, USA by Viktor Gamov

Slide 1

Slide 1

Codepocalypse Now LangChain4j vs Spring AI Baruch Sadogursky Viktor Gamov

Slide 2

Slide 2

@jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 3

Slide 3

Smart Home Demo ————————————————————————————————————————————— Ask my house anything: • • • • • • @jbaruch “What was the last thing that happened?” “What’s the most active room today?” “What’s using the most power right now?” “Any water leaks detected?” “How many devices do you have?” “What time did everyone leave this morning?” @gamussa #codepocalypse speaking.jbaru.ch

Slide 4

Slide 4

The Challenge ————————————————————————————————————————————— OpenClaw - 350,000+ GitHub stars A personal AI agent that manages your life. Written in TypeScript. Can Java do this? • • • • • • @jbaruch [ [ [ [ [ [ ] ] ] ] ] ] @gamussa Basic agent Memory Tools Agentic workflows Guardrails Observability #codepocalypse speaking.jbaru.ch

Slide 5

Slide 5

Pick a Side ————————————————————————————————————————————— ▓▓▓ Special Agent Johnson ▓▓▓ Special Agent Johnson Spring AI Division LangChain4j Division @jbaruch @gamussa No relation. @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 6

Slide 6

Rules of Engagement ————————————————————————————————————————————— • • • • • @jbaruch Same feature, same time limit Both build against the same LLM Audience votes at the end Failures count (they always happen) The real winner = Java developers @gamussa #codepocalypse speaking.jbaru.ch

Slide 7

Slide 7

██ ROUND 1 ▓▓▓ The Basic Agent @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 8

Slide 8

Round 1 - The Basic Agent ————————————————————————————————————————————— • • • • • • @jbaruch [x] [ ] [ ] [ ] [ ] [ ] @gamussa Basic agent Memory Tools Agentic workflows Guardrails Observability #codepocalypse speaking.jbaru.ch

Slide 9

Slide 9

Round 1 - Comparison ————————————————————————————————————————————— ▒▒▒▒ Spring AI ▒▒▒▒ LangChain4j @RestController class AgentController { @RegisterAiService interface Agent { private final ChatClient chat; String chat(String message); AgentController(ChatClient.Builder b) { this.chat = b.build(); } } // That’s it. No controller needed // with Quarkus REST integration. @PostMapping(“/chat”) String chat(@RequestBody String msg) { return chat.prompt(msg) .call() .content(); @jbaruch } } @gamussa #codepocalypse speaking.jbaru.ch

Slide 10

Slide 10

██ ROUND 2 ▓▓▓ Memory @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 11

Slide 11

Round 2 - Memory ————————————————————————————————————————————— • • • • • • @jbaruch [x] [x] [ ] [ ] [ ] [ ] @gamussa Basic agent Memory Tools Agentic workflows Guardrails Observability #codepocalypse speaking.jbaru.ch

Slide 12

Slide 12

Round 2 - Comparison ————————————————————————————————————————————— ▒▒▒▒ Spring AI ▒▒▒▒ LangChain4j ChatClient.builder(model) .defaultAdvisors( MessageChatMemoryAdvisor .builder(chatMemory) .build() ) .build(); @RegisterAiService interface Agent { // Memory is an Advisor. // It wraps the pipeline. // Every advisor can see it. // Memory is just… there. // Declare it, it works. // No wrapping ceremony. @MemoryId String chat(@MemoryId String id, String message); } Philosophy - Advisor middleware vs declarative injection @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 13

Slide 13

██ ROUND 3 ▓▓▓ Tools @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 14

Slide 14

Round 3 - Tools ————————————————————————————————————————————— • • • • • • @jbaruch [x] [x] [x] [ ] [ ] [ ] @gamussa Basic agent Memory Tools Agentic workflows Guardrails Observability #codepocalypse speaking.jbaru.ch

Slide 15

Slide 15

Round 3 - Comparison ————————————————————————————————————————————— ▒▒▒▒ Spring AI @Component public class ConferenceTools { @Tool(description = “Search CFPs”) public String searchCfps(String kw) ▒▒▒▒ LangChain4j McpClient mcp = McpClient.using( new StdioMcpTransport( “developer-events-mcp” ) ).build(); { // Direct HTTP call. No MCP. // No protocol. No middleware. return http.send(req, ofString()) .body(); } } // “Models are smart enough to // call APIs directly.” @jbaruch McpToolProvider tools = McpToolProvider.builder() .mcpClients(mcp) .build(); // “MCP discovers tools at // runtime. Yours are hardcoded.” @gamussa - Direct @Tool calls vs MCP#codepocalypseovery speaking.jbaru.ch

Slide 16

Slide 16

██ THE SECRET WEAPON @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 17

Slide 17

How Are We Coding This Fast? ————————————————————————————————————————————— We gave our coding agents the right context. # Baruch’s setup (Spring AI) tessl install jbaruch/spring-ai-agent jbaruch/spring-boot-4

Viktor’s setup (LangChain4j) tessl install jbaruch/langchain4j-ai-agent jbaruch/quarkus-langchain4j Tessl plugins - versioned context packages for coding agents. Zero hallucinated APIs. One command.

@jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 18

Slide 18

The Proof ————————————————————————————————————————————— Real eval numbers. With tiles, agents write working code. Without, they hallucinate APIs. @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 19

Slide 19

██ ROUND 4 ▓▓▓ Agentic Workflows @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 20

Slide 20

Round 4 - Agentic Workflows ————————————————————————————————————————————— • • • • • • @jbaruch [x] [x] [x] [x] [ ] [ ] @gamussa Basic agent Memory Tools Agentic workflows Guardrails Observability #codepocalypse speaking.jbaru.ch

Slide 21

Slide 21

Round 4 - Comparison ————————————————————————————————————————————— ▒▒▒▒ Spring AI // Agents = composed advisors // Skills = markdown folders // No special agent module @jbaruch ▒▒▒▒ LangChain4j @SequentialAgent interface Pipeline { @AgentMember ClassifierAgent classifier(); ChatClient.builder(model) .defaultAdvisors( memoryAdvisor, toolCallAdvisor, guardrailAdvisor ) .build(); } // Spring says agents are just // well-composed services. // LangChain4j says agents ARE // special. Dedicated module. @AgentMember EmailAgent emailHandler(); @AgentMember CalendarAgent calAgent(); @gamussa - Composed services vs firs#codepocalypse speaking.jbaru.ch

Slide 22

Slide 22

██ ROUND 5 ▓▓▓ Guardrails @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 23

Slide 23

Round 5 - Guardrails ————————————————————————————————————————————— • • • • • • @jbaruch [x] [x] [x] [x] [x] [ ] @gamussa Basic agent Memory Tools Agentic workflows Guardrails Observability #codepocalypse speaking.jbaru.ch

Slide 24

Slide 24

Round 5 - Comparison ————————————————————————————————————————————— ▒▒▒▒ Spring AI @jbaruch ▒▒▒▒ LangChain4j // Guardrails = …also advisors ChatClient.builder(model) .defaultAdvisors( inputGuardrailAdvisor, memoryAdvisor, toolCallAdvisor, outputGuardrailAdvisor ) .build(); class InjectionGuard implements InputGuardrail { // Same pattern. Everything // composes. One ring to rule // them all. } @Override public InputGuardrailResult validate(UserMessage msg) { if (isInjection(msg)) return fatal(“Blocked”); return success(); } // Typed interfaces. Type-safe. // Explicit. Purpose-built. @gamussa - Advisor chain validation #codepocalypserail interfaces speaking.jbaru.ch

Slide 25

Slide 25

██ ROUND 6 ▓▓▓ Observability @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 26

Slide 26

Round 6 - Observability ————————————————————————————————————————————— • • • • • • @jbaruch [x] [x] [x] [x] [x] [x] @gamussa Basic agent Memory Tools Agentic workflows Guardrails Observability #codepocalypse speaking.jbaru.ch

Slide 27

Slide 27

Round 6 - Comparison ————————————————————————————————————————————— ▒▒▒▒ Spring AI // // // // One dependency. Spring Boot Actuator. Micrometer. Prometheus. Grafana. // // // // Every ops team already knows these tools. Production-grade. Standards-based. ▒▒▒▒ LangChain4j AgentMonitor monitor = AgentMonitor.create(); // // // // HTML topology report. Agent execution tree. Token usage per agent. Timing per decision. // Shows WHY the agent // did what it did. Philosophy - Ecosystem metrics vs agent-specific decision trees @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 28

Slide 28

██ THE VERDICT @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 29

Slide 29

The Abstraction War ————————————————————————————————————————————— │ Spring AI │ LangChain4j ──────────────┼───────────────────────┼─────────────────────── Basic agent │ ChatClient builder │ @AiService interface Memory │ Advisor middleware │ Declarative injection Tools │ Direct @Tool (no MCP) │ MCP protocol discovery Agentic │ Composed advisors │ Dedicated module Guardrails │ …also advisors │ Typed interfaces Observability │ Micrometer native │ AgentMonitor tree │ Spring AI │ LangChain4j ────────────┼────────────────────────────┼────────────────────────────── Philosophy │ One pattern for everything │ Right abstraction per concept Real winner │ Java developers │ Java developers @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 30

Slide 30

The Winner Is… ————————————————————————————————————————————— ██ Your team’s philosophy. Spring shop? Spring AI feels like home. The advisor pattern IS the Spring way. Framework independence? LangChain4j delivers. Quarkus, plain Java, most mature agentic module. Both built an OpenClaw in 75 minutes. Both work. @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 31

Slide 31

The REAL Winner ————————————————————————————————————————————— ██ Java Developers Two production-ready AI frameworks. In Java. In 2026. You don’t need TypeScript. You don’t need Python. Your existing skills, ecosystem, and infrastructure - it all works. The codepocalypse isn’t about code dying. It’s about code evolving. @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 32

Slide 32

Resources ————————————————————————————————————————————— speaking.jbaru.ch/codepocalypse-now-2026 Slides, code, links to both frameworks, comparison table @jbaruch @gamussa #codepocalypse speaking.jbaru.ch

Slide 33

Slide 33

Vote! ————————————————————————————————————————————— ▓▓▓ Spring AI ▓▓▓ LangChain4j cheer if Spring won cheer if LangChain4j won ██ Thank you! @jbaruch - @gamussa Never trust a monkey with your codebase. Even an AI monkey. @jbaruch @gamussa #codepocalypse speaking.jbaru.ch