JetBrains/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

What it solves

Koog 是一個用於構建 AI 代理的框架,讓開發者能以慣用的 Kotlin 與 Java API 建立能與工具互動、管理複雜工作流程、並與使用者溝通的代理。它提供類型安全的方式將 LLM 整合至基於 JVM 的應用程式,同時確保可靠性與可擴展性。

How it works

Koog 採用可組合的架構與 Kotlin DSL 來定義代理行為。它支援廣泛的 LLM 供應商(包括 Google、OpenAI、Anthropic 與 Ollama),並允許在模型之間無縫切換。框架內建歷史壓縮、狀態持久化以提升容錯能力,以及使用向量嵌入的 RAG 知識檢索功能。

Who it’s for

此框架設計給 JVM 與 Kotlin 開發者,讓他們能在企業應用中(如 Spring Boot、Ktor 等框架)構建 AI 代理並嵌入使用。

Highlights

  • Multiplatform Support: Deploy agents across JVM, JS, WasmJS, Android, and iOS.
  • Agentic Capabilities: Support for parallel tool calls, Model Context Protocol (MCP) integration, and flexible graph-based workflows.
  • Observability: Built-in OpenTelemetry exporters for monitoring with tools like Langfuse and W&B Weave.
  • Reliability: Built-in retries and agent state persistence to recover from failures.
  • RAG Integration: Native support for knowledge retrieval and memory via vector embeddings.