Koog: Kotlin Framework for AI Agents

Discover Koog, the official Kotlin framework for building robust, scalable, and production-ready AI agents. This open-source project empowers developers to create AI agents across diverse platforms, including backend services, Android, iOS, JVM, and web browsers. Leveraging JetBrains' AI expertise, Koog offers solutions for complex LLM challenges, featuring pure Kotlin implementation, MCP integration, embedding capabilities, custom tool creation, and a flexible graph workflow system. Learn how Koog can streamline your AI agent development with its multiplatform support and array of ready-to-use components.

Koog: The Official Kotlin Framework for Building Powerful AI Agents

JetBrains has unveiled Koog, a groundbreaking open-source Kotlin framework designed to simplify and enhance the development of AI agents. This framework is built to create robust, scalable, and production-ready AI agents that can operate seamlessly across a wide array of platforms, from backend services and mobile applications (Android and iOS) to JVM environments and even in-browser experiences using WebAssembly.

Koog draws upon JetBrains' extensive expertise in AI products, offering proven solutions for intricate Large Language Model (LLM) and AI-related challenges. Its core philosophy is to allow developers to build AI agents entirely in idiomatic Kotlin, making the process more natural and efficient.

Key Features and Capabilities:

  • Pure Kotlin Implementation: Develop AI agents using the full power and expressiveness of Kotlin.
  • Multiplatform Support: Deploy your agents on JVM, JavaScript, WasmJS, and iOS targets thanks to Kotlin Multiplatform.
  • LLM Provider Integration: Seamlessly connect with various LLM providers including Google, OpenAI, Anthropic, OpenRouter, and Ollama.
  • MCP Integration: Benefit from Model Context Protocol integration for advanced model management.
  • Embedding Capabilities: Utilize vector embeddings for sophisticated semantic search and knowledge retrieval.
  • Custom Tool Creation: Extend agent functionality by building custom tools that interact with external systems and APIs.
  • Intelligent History Compression: Optimize token usage and maintain crucial conversation context with multiple pre-built compression strategies.
  • Powerful Streaming API: Process LLM responses in real-time with efficient streaming support and parallel tool calls.
  • Persistent Agent Memory: Enable agents to retain knowledge across sessions and even share memory between different agents.
  • Comprehensive Tracing: Debug and monitor agent execution with detailed and configurable tracing mechanisms.
  • Flexible Graph Workflows: Design complex agent behaviors using an intuitive, graph-based workflow system.
  • Modular Feature System: Customize and extend agent capabilities through a composable and modular architecture.
  • Scalable Architecture: Built to handle diverse workloads, from simple chatbots to enterprise-level applications.

Getting Started with Koog:

Koog provides straightforward integration methods for popular build tools.

For Gradle (Kotlin DSL):

dependencies {
    implementation("ai.koog:koog-agents:0.4.1") // Use the latest version
}

Ensure mavenCentral() is included in your project's repositories.

**For Gradle (Groovy): **

dependencies {
    implementation 'ai.koog:koog-agents:0.4.1' // Use the latest version
}

Again, confirm mavenCentral() is in your repositories.

For Maven:

<dependency>
    <groupId>ai.koog</groupId>
    <artifactId>koog-agents-jvm</artifactId>
    <version>0.4.1</version> <!-- Use the latest version -->
</dependency>

Make sure mavenCentral() is configured in your pom.xml.

Koog is more than just a framework; it's a comprehensive ecosystem empowering developers to push the boundaries of what's possible with AI agents, all within the elegant and powerful Kotlin language. Whether you're building a conversational AI, an automation tool, or a complex reasoning system, Koog offers the flexibility and scalability needed for success.