Koog 1.0

Frameworks & SDKs 💻 Kotlin ⚖️ Apache-2.0 🟢 Actively maintained
4.6k stars

Koog is a Kotlin-based framework for building and running AI agents entirely in idiomatic Kotlin and Java API. It solves the problem of creating agents that can interact with tools, handle complex workflows, and communicate with users, targeting JVM, JS, WasmJS, Android, and iOS platforms. It is designed for Kotlin and JVM developers who want to integrate AI agents into their applications.

✨ Key features

  • Multiplatform development across JVM, JS, WasmJS, Android, iOS.
  • Built-in retries and agent persistence for fault tolerance.
  • Intelligent history compression to optimize token usage.
  • Integrations with Spring Boot and Ktor.
  • OpenTelemetry exporters for observability (W&B Weave, Langfuse).
  • Switch LLMs without losing conversation history.

🎯 Use cases

  • Build AI agents that answer user questions with LLMs.
  • Create agents that use external tools via MCP.
  • Implement complex agent workflows using graph-based design.
  • Embed AI agents into Spring Boot or Ktor applications.
  • Monitor and debug agent execution with tracing.

📦 Installation

🧰 Requirements: JDK 17 or higher for JVM; Kotlin 2.3.10 or higher in existing projects; API keys for LLM providers (e.g., OpenAI) as environment variables.

Gradle (Kotlin DSL)

Add dependencies to build.gradle.kts:

dependencies {
    implementation("ai.koog:koog-agents:1.2.0")
    implementation("ai.koog:koog-agents-additions:1.2.0-beta")
}

Make sure mavenCentral() is in repositories.

Gradle (Groovy)

Add dependencies to build.gradle:

dependencies {
    implementation 'ai.koog:koog-agents:1.2.0'
    implementation 'ai.koog:koog-agents-additions:1.2.0-beta'
}

Make sure mavenCentral() is in repositories.

Maven

Add dependencies to pom.xml:

<dependency>
    <groupId>ai.koog</groupId>
    <artifactId>koog-agents-jvm</artifactId>
    <version>1.2.0</version>
</dependency>
<dependency>
    <groupId>ai.koog</groupId>
    <artifactId>koog-agents-additions-jvm</artifactId>
    <version>1.2.0-beta</version>
</dependency>

Make sure mavenCentral is in repositories.

🚀 Usage

fun main() = runBlocking {
    // Before you run the example, assign a corresponding API key as an environment variable.
    val apiKey = System.getenv("OPENAI_API_KEY") // or Anthropic, Google, OpenRouter, etc.

    val agent = AIAgent(
        promptExecutor = MultiLLMPromptExecutor(OpenAILLMClient(apiKey)), // or Anthropic, Google, OpenRouter, etc.
        systemPrompt = "You are a helpful assistant. Answer user questions concisely.",
        llmModel = OpenAIModels.Chat.GPT4o
    )

    val result = agent.run("Hello! How can you help me?")
    println(result)
}

⚠️ Good to know

The framework is stable and follows semantic versioning; no specific limitations are mentioned in the README.

❓ FAQ

What are the supported platforms?

Koog supports JVM, JS, WasmJS, Android, and iOS targets via Kotlin Multiplatform.

Which LLM providers can I use?

You can use LLMs from Google, OpenAI, Anthropic, DeepSeek, OpenRouter, Ollama, and Bedrock.

How do I add Koog to my project?

Add the dependencies ai.koog:koog-agents:1.2.0 and ai.koog:koog-agents-additions:1.2.0-beta from Maven Central using your build tool.

What are the system requirements?

JDK 17 or higher is required for JVM, and Kotlin 2.3.10 or higher should be set explicitly in existing projects.

📊 Repository

Stars★ 4,555
Forks🍴 467
Open issues🐛 190
Last commit🕒 Sep 1, 2026
Created📅 May 2025
Language💻 Kotlin
License⚖️ Apache-2.0

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.