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 t
What is 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 complex LLM and AI problems
Overview of koog
What it is
Koog is a Kotlin-based framework designed to build and run AI agents entirely in idiomatic Kotlin and Java API. It lets you create agents that can interact with tools, handle complex workflows, and communicate with users.
Key features
- Multiplatform development: Deploy agents across JVM, JS, WasmJS, Android, and iOS targets using Kotlin Multiplatform.
- Reliability and fault-tolerance: Handle failures with built-in retries and restore the agent state at specific points during execution with the agent persistence feature.
- Intelligent history compression: Optimize token usage while maintaining context in long-running conversations using advanced built-in history compression techniques.
- Enterprise-ready integrations: Utilize integration with popular JVM frameworks such as Spring Boot and Ktor to embed Koog into your applications.
- Observability with OpenTelemetry exporters: Monitor and debug applications with built-in support for popular observability providers (W&B Weave, Langfuse).
- LLM switching and seamless history adaptation: Switch to a different LLM at any point without losing the existing conversation history, or reroute between multiple LLM providers.
- Integration with JVM and Kotlin applications: Build AI agents with an idiomatic, type-safe Kotlin DSL designed specifically for JVM and Kotlin developers.
Use cases
Building and running AI agents that can interact with tools, handle complex workflows, and communicate with users. Deploying agents across JVM, JS, WasmJS, Android, and iOS targets. Integrating with enterprise applications using Spring Boot or Ktor.
Getting started
kotlin dependencies { implementation('ai.koog:koog-agents:1.3.0') implementation('ai.koog:koog-agents-additions:1.3.0-beta') } // Quickstart example: fun main() = runBlocking { val apiKey = System.getenv('OPENAI_API_KEY') val agent = AIAgent( promptExecutor = MultiLLMPromptExecutor(OpenAILLMClient(apiKey)), 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) }
License and pricing
Apache-2.0 license, open source.
Based on the project's public README and repository metadata.