If you’ve been building AI agents in Java, you know the drill. You either shoehorn Python libraries into your stack via microservices and REST bridges, or you pick one of the handful of JVM-native options and hope it does what you need. JetBrains just made that choice a lot more interesting.
This month, JetBrains announced that Koog — their AI agent framework originally built for Kotlin — now ships with a fully idiomatic Java API. No Kotlin knowledge required. No wrapper hacks. Just plain Java builder patterns, thread pool executors, and the kind of enterprise-grade plumbing that makes architects sleep at night.
What Koog Actually Is
Koog started as an internal framework at JetBrains. They needed something to power their own AI products — think JetBrains AI Assistant, Junie, and the rest — and the existing options weren’t cutting it. So they built their own, grounded in Kotlin’s coroutine model, and quietly shipped it as open source (Apache 2.0) after unveiling it at KotlinConf.
The Java release is not a watered-down port. It’s a first-class API surface that gives Java developers access to the same workflow strategies that power JetBrains’ own tooling:
- Functional strategies: code-based orchestration where you control the flow step by step, limiting tool sets per subtask with type-safe inputs and outputs.
- Graph-based strategies: finite state machines with persistence, so you can visualize workflows, add conditional edges, and recover from specific checkpoints mid-execution.
- Planning-based strategies: goal-oriented action planning where the agent figures out how to reach a goal, not just what to do next.
On top of that, you get Spring Boot integration, support for every major LLM provider (OpenAI, Anthropic, Google, DeepSeek, Ollama, and more), automatic persistence with failure recovery, OpenTelemetry integration, and built-in history compression to keep your token bills in check.
The Landscape: What Else Is Out There?
Koog doesn’t exist in a vacuum, and it’s worth looking at where it fits relative to the alternatives Java developers already have.
Spring AI is the obvious comparison for anyone already in the Spring ecosystem. It follows the Spring philosophy to the letter — opinionated defaults, auto-configuration, and deep integration with Spring Boot’s dependency injection and configuration model. If your team already lives and breathes Spring, adding AI capabilities through Spring AI feels natural. It handles model abstraction, prompt templating, and RAG pipelines, though its agentic capabilities are still maturing compared to dedicated agent frameworks.
LangChain4j takes a different approach. It’s framework-agnostic, modular, and arguably the most feature-rich option for LLM workflows on the JVM today. Its RAG pipeline is remarkably mature — document loaders for practically every format, advanced splitters, and automated ETL via ingestors. Tool calling is built in and straightforward. If you need maximum flexibility and don’t want to be tied to Spring, LangChain4j has been the go-to choice.
Semantic Kernel for Java is Microsoft’s entry, ported from .NET. It’s functional and supports Azure OpenAI well, but its contributor community is significantly smaller (around 30 contributors compared to hundreds for Spring AI and LangChain4j), which means some features and fixes arrive slower.
So where does Koog fit? Its differentiator is the agent-first design. While Spring AI and LangChain4j started as LLM integration libraries and are evolving toward agentic patterns, Koog was built from day one to orchestrate autonomous agents — with workflow strategies, state persistence, failure recovery, and observability baked into the core. It also supports both MCP (Model Context Protocol) and A2A (Agent2Agent) protocol, positioning it well for the emerging multi-agent ecosystem.
Why This Matters for Java Teams
The Python-to-Java bridge tax is real. Every team that’s tried to integrate CrewAI, AutoGen, or LangGraph into a Java backend knows the pain: serialization headaches, deployment complexity, two sets of dependencies to manage, and the inevitable “who owns this microservice?” conversation.
Koog eliminates that entirely. Your agent logic lives in the same codebase, the same build system, the same CI/CD pipeline. You define tools with a @Tool annotation and an @LLMDescription — the framework handles the rest. Thread management uses standard ExecutorService, so your ops team doesn’t need to learn a new concurrency model. And because it integrates with Spring Boot, you can drop it into an existing application without rearchitecting anything.
The graph-based workflow strategy is particularly compelling for enterprise use cases. Being able to checkpoint agent state to Postgres or S3 and resume from a specific node after a failure isn’t a nice-to-have — it’s a hard requirement for anything touching financial transactions, compliance workflows, or long-running business processes.
A Few Things to Watch
Koog is still young. The current version sits at 0.6.4, and JetBrains labels it an “incubator project.” That’s not a warning — JetBrains has a solid track record of supporting their open source tools — but it does mean the API surface may shift. If you’re picking a framework for a greenfield project today, that’s probably fine. If you’re looking to migrate a production system, you might want to wait for a 1.0.
The documentation at docs.koog.ai is decent but still filling in gaps, and the community around it is smaller than what LangChain4j and Spring AI have built over the past couple of years. That said, having JetBrains as the primary maintainer — a company that dogfoods the framework in their own AI products — carries more weight than a large but fragmented contributor base.
Conclusion
The Java AI agent space just got genuinely competitive. For the past year, the conversation has been “Spring AI or LangChain4j?” and the answer usually depended on whether you were already using Spring. Koog changes that dynamic by offering something neither of those frameworks prioritized from the start: a purpose-built agent orchestration engine with enterprise-grade resilience.
If you’re building simple LLM integrations — chat completions, RAG pipelines, prompt chaining — Spring AI and LangChain4j remain excellent choices. But if you’re building agents — autonomous workflows that need to plan, recover from failures, persist state, and coordinate across multiple models — Koog deserves a serious look. JetBrains didn’t build this as a side project. They built it because they needed it, and now they’re handing it to the rest of us.
The fact that it now speaks fluent Java, not just Kotlin, removes the last real barrier to adoption. Keep an eye on this one.