Overview
Koog is an open-source JetBrains framework for building AI agents with an idiomatic, type-safe Kotlin DSL designed specifically for JVM and Kotlin developers. It lets you create agents that interact with tools, handle complex workflows, and communicate with users.
You can customize agent capabilities with a modular feature system and deploy your agents across JVM, JS, WasmJS, Android, and iOS targets using Kotlin Multiplatform.
-
Build and run your first AI agent
-
Learn the essential terms
Agent types
-
Create and run agents that process a single input and provide a response
-
Create and run lightweight agents with custom logic in plain Kotlin
-
Create and run agents that handle complex workflows with custom strategies
Core functionality
-
Create prompts, run them using LLM clients or prompt executors, switch between LLMs and providers, and handle failures with built-in retries
-
Enhance your agents with built‑in, annotation‑based, or class‑based tools that can access external systems and APIs
-
Design complex agent behaviors using intuitive graph-based workflows
-
Monitor and process agent lifecycle, strategy, node, LLM call, and tool call events with predefined handlers
Advanced usage
-
Optimize token usage while maintaining context in long-running conversations using advanced techniques
-
Restore the agent state at specific points during execution
-
Generate responses in structured formats
-
Process responses in real-time with streaming support and parallel tool calls
-
Retain and retrieve knowledge across conversations using vector embeddings, ranked document storage, and shared agent memory
-
Debug and monitor agent execution with detailed, configurable tracing
Integrations
-
Use MCP tools directly in AI agents
-
Add Koog to your Spring applications
-
Integrate Koog with Ktor servers
-
Trace, log, and measure your agent with popular observability tools
-
Connect agents and services over a shared protocol