The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
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…
Install
git clone https://github.com/JetBrains/koogInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →Koog
Build status:
Useful links:
Overview
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
Key features of Koog include:
- 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.
- Model Context Protocol integration: Use Model Context Protocol (MCP) tools in AI agents.
- Agent Client Protocol integration: Build ACP-compliant agents that can communicate with standardized client applications using the Agent Client Protocol (ACP).
- Knowledge retrieval and memory: Retain and retrieve knowledge across conversations using vector embeddings and RAG.
- Powerful Streaming API: Process responses in real-time with streaming support and parallel tool calls.
- Modular feature system: Customize agent capabilities through a composable architecture.
- Flexible graph workflows: Design complex agent behaviors using intuitive graph-based workflows.
- Custom tool creation: Enhance your agents with tools that access external systems and APIs.
- Comprehensive tracing: Debug and monitor agent execution with detailed, configurable tracing.
Available LLM providers and platforms
The LLM providers and platforms whose LLMs you can use to power your agent capabilities:
- OpenAI
- Anthropic
- DeepSeek
- OpenRouter
- Ollama
- Bedrock
Quickstart example
To help you get started with AI agents, here is a quick example:
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)
}
Using in your projects
Supported targets
Similar plugs
Reverse engineer anything with agents, from app behavior down to native binaries.
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io
Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.