Koog

Koog is a JVM (Java and Kotlin) framework for building predictable, fault-tolerant and enterprise-ready AI agents across all platforms – from backend services to Android and iOS, JVM, and even in-browser environments. Koog is based on our AI products expertise and provides proven solutions for compl

Last verified:

Visit Koog

What is Koog?

Koog is an open-source JetBrains framework for building AI agents designed specifically for the JVM ecosystem. It provides a first-class development experience for both Kotlin and Java developers, featuring an idiomatic, type-safe Kotlin DSL and fluent builder-style Java APIs. Koog enables developers to create AI agents that can interact with tools, handle complex workflows, and communicate with users entirely in idiomatic Kotlin.

Key features include graph workflows with domain modeling, multiple history compression strategies, advanced persistence with durable execution, support for all modern agent patterns (GOAP, LLM planning, multi-agent orchestration), seamless LLM switching, robust retry components, Spring Boot and Ktor integrations, multiplatform support (JVM, JS, WasmJS, Android, iOS), broad AI integration with major LLM providers (OpenAI, Anthropic, Google, DeepSeek, Mistral, Alibaba, Bedrock, Ollama), and OpenTelemetry support for observability with W&B Weave, Langfuse, and DataDog.

Koog is primarily designed for Kotlin and Java developers working in JVM ecosystems who need to build predictable, fault-tolerant, and enterprise-ready AI agents. It powers multiple JetBrains products including internal AI agents, ensuring real-world validation. The framework is ideal for teams building backend services, Android/iOS applications, or in-browser environments that require reliable AI agent capabilities with production-grade reliability.

The framework emphasizes reliability as its primary focus, enabling AI agents that can be confidently used in demanding enterprise environments. Its unique advantage comes from direct collaboration with JetBrains ML engineers and product teams, ensuring features are tested and refined based on real-world product requirements rather than being purely theoretical.

Koog pricing

Pricing model: Freemium

Koog is completely free and open-source under the Apache 2.0 License. There is no paid tier or subscription cost for the framework itself. Users only need to pay for their chosen LLM provider API costs (OpenAI, Anthropic, Google, DeepSeek, etc.) or run local models via Ollama for free. Nightly builds are available for free from the JetBrains Grazie Maven repository at https://packages.jetbrains.team/maven/p/grazi/grazie-platform-public for access to the latest features before stable releases.

Koog pros

  • Open-source with Apache 2.0 license
  • Idiomatic type-safe Kotlin DSL for Kotlin developers
  • Fluent builder-style Java APIs for Java developers
  • Multiplatform support: JVM, JS, WasmJS, Android, iOS
  • Built-in history compression strategies out of the box
  • Advanced persistence with durable execution and state machine restoration
  • Graph workflows with explicit domain modeling
  • Supports all modern agent patterns: GOAP, LLM planning, multi-agent orchestration
  • Seamless LLM switching without losing conversation history
  • Robust retry components for failure resilience
  • Spring Boot and Ktor integrations with ready-to-use beans
  • Broad LLM provider support: OpenAI, Anthropic, Google, DeepSeek, Mistral, Alibaba, Bedrock, Ollama
  • OpenTelemetry support with W&B Weave, Langfuse, DataDog integration
  • Model Context Protocol (MCP) integration for tools
  • powers multiple JetBrains products with real-world validation
  • Parallel tool calls and streaming API support
  • Knowledge retrieval with vector embeddings and RAG support
  • Comprehensive tracing for debugging agent execution
  • Modular feature system for customizable agent capabilities
  • Fine-tuned prompts optimized for real-world performance by JetBrains ML engineers

Koog cons

  • Requires JDK 17 or higher minimum
  • Kotlin 2.2.0+ required for full functionality
  • Primarily focused on JVM ecosystem, limited non-JVM support
  • Steep learning curve for developers unfamiliar with Kotlin coroutines
  • Requires API keys from LLM providers or local Ollama setup
  • Relatively new framework with smaller community compared to established alternatives
  • Documentation still evolving with frequent updates
  • Nightly builds required for latest features, stable releases lag behind

Frequently asked questions about Koog

What is Koog and what does it do?

Koog is an open-source JetBrains framework for building AI agents designed specifically for the JVM ecosystem. It provides an idiomatic, type-safe Kotlin DSL for Kotlin developers and fluent builder-style Java APIs for Java developers. Koog enables developers to create AI agents that can interact with tools, handle complex workflows, communicate with users, and operate entirely in idiomatic Kotlin without external service dependencies.

What LLM providers does Koog support?

Koog integrates with major LLM providers including OpenAI, Anthropic, Google (Gemini), DeepSeek, Mistral, Alibaba, OpenRouter, enterprise-level AI clouds like Amazon Bedrock, and local models such as Ollama. You can switch between different LLMs during a conversation without losing history, and Koog automatically handles unavailable tools when switching.

What platforms can I deploy Koog agents on?

Koog supports multiplatform deployment across JVM, JS, WasmJS, Android, and iOS targets using Kotlin Multiplatform. On JVM, JDK 17 or higher is required. This allows you to build agentic applications for backend services, Android and iOS mobile apps, and even in-browser environments from a single codebase.

How does Koog handle conversation history management?

Koog includes multiple advanced history compression strategies out of the box to optimize token usage while maintaining context in long-running conversations. These strategies use fine-tuned prompts, techniques, and algorithms tested and refined by JetBrains ML engineers. Koog also enables seamless LLM switching that automatically rewrites history when changing models.

What agent patterns does Koog support?

Koog supports all modern agent patterns in one framework: graph workflows with domain modeling, GOAP (Goal-Oriented Action Planning), LLM planning, multi-agent orchestration, basic agents with predefined strategies, functional agents with custom lambda logic, and planner agents that iteratively build plans. All patterns are fully composable so you can build exactly what your use case requires.

How does Koog handle failures and reliability?

Koog includes robust retry components that let you wrap operations and retry them until they meet configurable conditions. It also features advanced persistence with durable execution, allowing you to restore full agent state machines (not just chat messages) for checkpoints, failure recovery, and reverting to any point in execution. This makes agents resilient to LLM timeouts, tool failures, and network issues.

Can I integrate Koog with Spring Boot or Ktor?

Yes. For Spring Boot, Koog provides ready-to-use beans and auto-configured LLM clients. If you use Spring AI for LLM and RAG capabilities, Koog can layer on top as an orchestration framework. For Ktor servers, you can install Koog as a plugin, configure providers using configuration files, and call agents directly from any route without manually connecting LLM clients.

How do I observe and debug Koog agents?

Koog provides out-of-the-box OpenTelemetry support with integration for popular observability providers like W&B Weave, Langfuse, and DataDog. You can trace, log, and measure your agents using the same tools already in your system. Comprehensive tracing allows debugging and monitoring of agent execution with detailed, configurable tracing of LLM calls, tools, and agent stages.

What are the system requirements for Koog?

Koog requires JDK 17 or higher for JVM usage, Kotlin 2.2.0+, and Gradle 8.0+ or Maven 3.8+ for build tools. You also need either an API key from a supported LLM provider (OpenAI, Anthropic, Google, DeepSeek, OpenRouter, Bedrock, Mistral) or a locally running LLM via Ollama. kotlinx-coroutines 1.10.2 and kotlinx-serialization 1.8.1 should be set explicitly in existing projects.

Is Koog free to use and what is the license?

Yes, Koog is completely free and open-source under the Apache 2.0 License. There is no paid tier or subscription cost. The framework itself is free; you only pay for your chosen LLM provider API costs or use local models via Ollama for free. Nightly builds with the latest features are also available for free from the JetBrains Grazie Maven repository.

Categories

Use cases

Browse all AI tools on NeedAnAI