Favicon of Koog

Koog

An open-source AI agent framework for Kotlin and Java that supports local models through Ollama, cloud providers, and graph-based workflows.

Screenshot of Koog website

Koog is a JetBrains framework for developers building AI agents into Kotlin and Java applications. It supports agents that call tools and follow custom workflows, with Ollama as an option for running models locally.

  • Agent workflows: Use predefined strategies, write custom logic in Kotlin or Java, or define a graph that controls how an agent moves through a task.
  • Tools and responses: Give agents access to external systems and APIs, request structured output, and stream responses with parallel tool calls.
  • Recovery and context: Built-in retries handle failures, persistence restores saved execution states, and history compression reduces token use in long conversations.
  • Model switching: Change models during a conversation or route requests between providers while adapting the existing conversation history.
  • Tracing: Inspect agent execution with configurable traces and connect monitoring through OpenTelemetry, W&B Weave, or Langfuse.

Koog is open source under Apache 2.0. Java agents run on the JVM; Kotlin Multiplatform also supports JS, WasmJS, Android, and iOS. JVM applications require JDK 17 or higher.

Model inference can run locally through Ollama or use external providers including OpenAI, Anthropic, Google, DeepSeek, OpenRouter, and Amazon Bedrock. The chosen backend determines where model requests go; using a cloud provider sends those requests to that service.

Similar to Koog