Koog

Koog by JetBrains

Build fault-tolerant, scalable, and enterprise-ready AI agents for the JVM (Kotlin or Java), Android, iOS, JavaScript, and WebAssembly.

Koog for Java

Supercharge your Java backend with enterprise-grade AI agents

Learn more

Why agents matter

  • Smarter, faster decisions

    Agents learn continuously, interpret context, and adapt in real time. They reshuffle tasks, reset priorities, and catch issues early to help teams respond quickly and confidently.

  • Less repetitiveness

    By automating routine and low-value tasks, agents free people to focus on what matters most: strategic thinking, creativity, and collaboration.

  • Greater efficiency

    Parallel task execution streamlines workflows. Unlike traditional workflows dependent on sequential handoffs, agents coordinate multiple steps simultaneously to keep work moving quickly.

Start simple

Need a quick agent here and now? Spin one up instantly with our default universal strategy and enjoy an instant productivity boost.

Increase complexity

Design advanced workflows with our graph strategy and unlock powerful features built for challenging scenarios.

Stay in control at scale

As your autonomous systems evolve, keep complete visibility with Koog’s tracing, monitoring, and testing tools. Debug quickly, optimize behavior, and maintain reliability at every stage.
  • Use both Kotlin and Java

    Build AI agents with an expressive Kotlin DSL, or adopt Koog in existing Java services with a Java-friendly API.

  • Automate planning

    Let agents iteratively plan, execute, and refine multi-step solutions with a strongly typed GOAP planner or LLM-based planners for adaptive strategies.

  • Model with type-safe precision

    Build agent flows with a type-safe, data-driven approach. Every action is strongly typed, so you rely on structure rather than fragile prompts.

  • Enjoy an open, extensible design

    Koog is open source and modular – transparent, adaptable, and built to let you mix, match, and extend capabilities to fit your needs.

  • Bring your own tools to the party

    Connect your agents to external systems or APIs, or use existing MCP or A2A servers to supercharge their abilities.

  • Jump-start development

    Ship rapidly with pre-built components for enterprise-grade persistence, history compression for cost optimization, and more – helping you avoid common AI engineering pitfalls.

  • Track every step

    Debug and monitor agent execution with detailed and configurable observability tools.

  • Graph your logic

    Design sophisticated agent behaviors with intuitive graph-based workflows.

  • Run everywhere

    Deploy agents inside existing Spring or Ktor backends from Kotlin or Java, and share logic across JS, WasmJS, and iOS with Kotlin Multiplatform.

FAQ

Koog is an open-source framework for building fault-tolerant, scalable, and production-ready AI agents. It supports multiple platforms, including JVM, Android, iOS, JavaScript, and WebAssembly, making it suitable for both enterprise and cross-platform applications.

AI agents (sometimes called “agentic AI”) are systems that can operate with a degree of autonomy, make decisions, identify necessary steps, and take actions to achieve a goal. Unlike traditional AI, which follows fixed rules or responds only to direct inputs, AI agents can adapt to changing environments, coordinate multiple steps, and interact with external tools or services.

You don’t need Kotlin to start. Koog provides a Java-friendly API for JVM backends. Kotlin remains first-class and is available when you want the most expressive authoring experience with the Kotlin DSL, coroutines, and Kotlin Multiplatform targets.

Koog is designed to feel natural in Java, with an API tailored to common workflows. You can use Koog directly from Java without writing Kotlin wrapper modules for all possible use cases. Koog now provides full feature parity between Kotlin and Java.

If you encounter a Java API gap, you can still interop with the Kotlin core.

Unlike popular Python or JavaScript frameworks such as LangChain/LangGraph, Koog provides Kotlin Domain-Specific Language (DSL) designed specifically for JVM and Kotlin developers. This ensures smooth integration into Kotlin- and Java-based applications, significantly improving productivity and enhancing the overall developer experience.

On top of that, Koog includes pre-built, composable solutions to simplify and speed up the development of agentic systems, setting it apart from frameworks that only offer basic components.

With Koog’s multiplatform support, you can deploy your agentic applications across JVM, JS, WasmJS, and iOS targets.

Koog also provides out-of-the-box integration with popular observability providers like W&B Weave and Langfuse for monitoring and debugging AI applications.

You can choose from a variety of LLM providers and platforms, including Google, OpenAI, Anthropic, DeepSeek, OpenRouter, Ollama, and Bedrock. Learn more here.

You can deploy agents with Koog across JVM, JS, WasmJS, Android, and iOS targets using Kotlin Multiplatform.

Koog provides agent checkpoint functionality and lets you save and restore the state of an agent at specific points during execution. The agent persistence feature requires that all nodes in your agent's strategy have unique names. To use the feature, add it to your agent's configuration. You can find a detailed how-to guide here.

The Koog framework integrates with MCP using the MCP SDK and additional API extensions in the agent-mcp module. This integration enables Koog agents to connect to MCP servers via multiple transport mechanisms (stdio, SSE), retrieve available tools from an MCP server, transform those tools into the Koog tool interface, register transformed tools in a tool registry, and call MCP tools with arguments provided by the LLM. You can find more information in the Koog documentation.

Yes. You can build connected AI agents with Koog using Google’s Agent2Agent Protocol (A2A). Koog provides the core agent logic and tool integration, while A2A ensures standardized communication between agents.

Koog is open source and licensed under the Apache 2.0 License.

Join our Slack community to ask questions, share feedback, and submit ideas. Use the official Koog YouTrack project to add feature requests and bug reports.

Koog and Spring AI operate on different layers of the stack. Spring AI focuses on model integration and infrastructure, while Koog provides an agent runtime and orchestration layer. Koog can be used on top of Spring AI (or independently, depending on your architecture).

Spring AI gives you the primitives to interact with LLMs, embeddings, and vector stores. Koog builds on top of those primitives to help you design and run structured, reliable agent systems.

You need Koog when your application starts to scale in complexity, requiring more coordination, state management, durable execution (fault tolerance), and control over execution.

With Koog, you can:

  • Orchestrate complex workflows with branching logic, guardrails, and tailored, controllable steps.
  • Run long-lived agents with persistent state and recoverability.
  • Optimize storage and LLM token usage with built-in strategies for message history compression.
  • Improve reliability through retries, fault tolerance, and controlled execution.
  • Execute AI workflows concurrently for better performance.
  • Add observability to agent execution with support for tools like OpenTelemetry, Langfuse, W&B Weave, and Datadog.

In short, Spring AI helps you connect to AI capabilities, while Koog helps you turn those capabilities into production-ready, reliable agent systems.