Member-only story
Building AI Agents in Kotlin with Koog
Dmitry Glazunov11 min read·1 hour ago--
If you are not Medium Member click this link to read it free.
Every few years, a library appears that makes a fast-moving space feel understandable again. For Kotlin and JVM engineers trying to build AI agents without falling back to Python-first tooling, Koog is one of the first frameworks that feels designed for the way we actually build software.
Released by JetBrains and evolving quickly toward a more mature public API, Koog is not just a thin wrapper around an LLM endpoint. It’s a full-stack, Kotlin-native framework for building agents that are observable, fault-tolerant, testable, and designed to run across the main Kotlin targets JetBrains highlights for Koog today, including JVM, Android, iOS, JavaScript, and WebAssembly. As a team lead who’s spent years thinking about architecture, reliability, and team scalability — this is the framework I’ve been waiting for.
Let’s dive into this
Why “AI Agent” ≠ “LLM API call”
Before touching code, it’s worth being precise about what an agent actually is, because the word is wildly overloaded right now.
A basic LLM call is stateless. You send a message, you get a response. Most “AI features” in mobile apps today are exactly this. Useful, but limited.