█

AI/TLDR

Invítame a un café
Invítame un café

Koog

El framework de JetBrains para crear agentes de IA en Kotlin y Java idiomáticos, desde servicios backend hasta Android e iOS

Agent Frameworks & BuildersCódigo abierto
Latest
1.3.0
Actualizado
24 Sep 2026
Idioma
Kotlin
Licencia
Apache-2.0

What's new

1.3.024 Sep 2026

Adds ready-made model definitions with capabilities, context windows and pricing for new Anthropic, OpenAI, Google, Bedrock, DashScope, DeepSeek, Mistral, Ollama and OpenRouter models, and fixes Google prompt-cache token counts and empty assistant content in Langfuse traces.

EN BREVE

What is Koog?

Koog es un framework de código abierto de JetBrains para crear y ejecutar agentes de IA por completo en Kotlin o Java. It sits in the Agent Frameworks & Builders category of the Agents & Automation tools and is open-source, written in Kotlin and licensed Apache-2.0. To get started: añade la dependencia.

Actualizado Versión en Markdown ↗

Resumen

Koog es un framework de código abierto de JetBrains para crear y ejecutar agentes de IA por completo en Kotlin o Java. En lugar de envolver una pila de Python, ofrece a los equipos de JVM un DSL de Kotlin con seguridad de tipos y APIs de builders fluidos en Java para agentes que llaman a herramientas, ejecutan flujos de trabajo de varios pasos y conversan con los usuarios. JetBrains lo publicó como código abierto en mayo de 2025, lanzó la primera versión estable 1.0 el 21 de mayo de 2026 y lo publica en Maven Central bajo la licencia Apache 2.0.

Flow chart of Koog's basic strategy: send the input to the LLM; if it answers with a message, finish; otherwise run the tool it calls, send the result back and repeat
Koog's basic strategy graph: the agent loops through tool calls until the LLM answers with a message.Koog docs (custom strategy graphs) ↗

Cada agente de Koog ejecuta una estrategia: un grafo dirigido de nodos como «llamar al LLM», «ejecutar una herramienta» y «enviar el resultado de la herramienta de vuelta». Los agentes más sencillos usan una estrategia predefinida (un bucle básico de llamadas a herramientas, o ReAct, que alterna un paso de razonamiento con un paso de acción), mientras que los agentes basados en grafos definen sus propios nodos, aristas, subgrafos y ramas paralelas. Koog también ofrece agentes funcionales, donde la lógica es una lambda sencilla, y agentes planificadores (beta) que construyen y ejecutan un plan paso a paso.

Alrededor de ese núcleo están las funciones que necesitan los agentes de producción de larga duración: reintentos integrados, persistencia de agentes que restaura el estado desde un punto de control, compresión del historial para mantener las conversaciones largas dentro de la ventana de contexto, cambio a otro LLM a mitad de una conversación sin perder el historial, streaming, salida estructurada y RAG con embeddings. Con Kotlin Multiplatform, el mismo código de agente se despliega en JVM, JS, WasmJS, Android e iOS, y las integraciones cubren Spring Boot, Spring AI, Ktor, Amazon Bedrock AgentCore, el Model Context Protocol, A2A y el Agent Client Protocol.

Qué hace

  • Agentes básicos, funcionales, basados en grafos y planificadores (beta), escritos en un DSL de Kotlin idiomático o con builders fluidos de Java
  • Grafos de estrategias con estrategias predefinidas como ReAct, nodos personalizados, subgrafos, ejecución paralela de nodos y transferencia de datos tipados entre nodos
Flow diagram of Koog's ReAct strategy: Start, CallLLMReason, CallLLMAction, then Finish if finished, or ExecuteTool and back to CallLLMReason if not
The predefined ReAct strategy alternates a reasoning call and an action call, running tools until the task is finished.Koog docs (predefined agent strategies) ↗
  • Herramientas como funciones anotadas (@Tool y @LLMDescription), herramientas basadas en clases o herramientas integradas, además de integración con MCP (beta), A2A (beta) y Agent Client Protocol
  • Funciones de fiabilidad: reintentos, persistencia de agentes con puntos de control, compresión del historial y cambio de proveedor de LLM sin perder la conversación
  • Clientes para OpenAI, Anthropic, Google, DeepSeek, OpenRouter, Amazon Bedrock, Mistral y modelos Ollama locales, con streaming y salida estructurada
  • Trazas y exportadores de OpenTelemetry para Langfuse, W&B Weave y Datadog, y starters para Spring Boot, Spring AI y Ktor
A Koog agent run traced in Langfuse: the node tree with nodeCallLLM, nodeExecuteTool running HelloTool and ByeTool, and nodeSendToolResult, a graph of the strategy, and the prompt, tool results and final answer
A Koog agent run in Langfuse, traced node by node through the OpenTelemetry exporter, with the strategy graph and each tool call.Koog docs (Langfuse exporter) ↗

Primeros pasos

Koog necesita JDK 17 o posterior en la JVM y Kotlin 2.3.10 o posterior configurado explícitamente en los proyectos existentes. Los pasos siguen el README del proyecto y el Quickstart de la documentación de Koog.

VideoKoog's technical lead walks through the framework's design on the Talking Kotlin podcast.Kotlin by JetBrains ↗

Añade la dependencia

Koog está en Maven Central. Añade el artefacto principal de agentes (y, opcionalmente, el módulo de extras beta) a tu build de Gradle y asegúrate de que mavenCentral() esté en tus repositorios. Los usuarios de Maven deben usar koog-agents-jvm en su lugar.

kotlinkotlin
dependencies {
    implementation("ai.koog:koog-agents:1.3.0")
    implementation("ai.koog:koog-agents-additions:1.3.0-beta")
}

Configura una clave de API del proveedor

Koog necesita una clave de API de un proveedor compatible o de un modelo local ejecutándose en Ollama. Guarda la clave en una variable de entorno en lugar de en el código fuente.

bashbash
export OPENAI_API_KEY=your-api-key

Crea y ejecuta tu primer agente

Un AIAgent combina un ejecutor de prompts (el cliente del LLM), un modelo y un prompt de sistema opcional. Al llamar a run se envía la entrada y se devuelve la respuesta del agente.

kotlinkotlin
fun main() = runBlocking {
    val apiKey = System.getenv("OPENAI_API_KEY")
        ?: error("The API key is not set.")

    val agent = AIAgent(
        promptExecutor = MultiLLMPromptExecutor(OpenAILLMClient(apiKey)),
        llmModel = OpenAIModels.Chat.GPT4o
    )

    val result = agent.run("Hello! How can you help me?")
    println(result)
}

Dale una herramienta al agente

Anota funciones en una clase que implemente ToolSet, descríbelas para el modelo con @LLMDescription y registra el conjunto en el ToolRegistry del agente. Así, el agente puede decidir llamar a la herramienta mientras trabaja.

kotlinkotlin
@LLMDescription("Tools for getting weather information")
class MyFirstToolSet : ToolSet {
    @Tool
    @LLMDescription("Get the current weather for a location")
    fun getWeather(
        @LLMDescription("The city and state/country")
        location: String
    ): String {
        return "The weather in $location is sunny and 72°F"
    }
}

val agent = AIAgent(
    promptExecutor = simpleOpenAIExecutor(apiKey),
    systemPrompt = "Provide weather information for a given location.",
    llmModel = OpenAIModels.Chat.GPT4o,
    toolRegistry = ToolRegistry { tools(MyFirstToolSet()) }
)
agent.run("What's the weather like in New York?")

Commands and code are distilled from the project's own documentation — always check the repositorio oficial para lo último.

Cuándo usarlo

  • Añadir agentes de IA a un backend existente de Spring Boot o Ktor sin introducir un servicio en Python
  • Llevar la misma lógica de agente a clientes Android, iOS y web mediante Kotlin Multiplatform
  • Crear agentes de larga duración y de varios pasos que sobrevivan a fallos, se reanuden desde puntos de control y se mantengan dentro de la ventana de contexto
  • Trazar y depurar las ejecuciones de agentes nodo por nodo en Langfuse, W&B Weave o Datadog

Historial de versiones

Every verified update to Koog that AI/TLDR tracked, newest first — each links to our coverage and the official changeset.

  1. 2026-09-241.3.0

    Adds ready-made model definitions with capabilities, context windows and pricing for new Anthropic, OpenAI, Google, Bedrock, DashScope, DeepSeek, Mistral, Ollama and OpenRouter models, and fixes Google prompt-cache token counts and empty assistant content in Langfuse traces.

  2. 2026-05-211.0.0

    First stable release: modules split into stable and beta streams, deprecated APIs removed, graph DSL node names finalized, a redesigned Java interop layer, OpenTelemetry on Kotlin Multiplatform and Anthropic prompt caching.

How Koog compares

Koog alongside other open-source agent frameworks & builders tools AI/TLDR tracks, ranked by GitHub stars.

HerramientaEstrellasQué hace
DeepSeek Harness★ 289kDeepSeek AI's open-source agent harness (dsh), built on Cordis, where models, tools, skills, sessions, sandboxes, storage and the UI are all plugins composed through profiles.
AutoGPT★ 188kOne of the earliest autonomous agent projects, now a platform for building and running agents from reusable blocks and workflows.
DeerFlow★ 86kByteDance's open-source super agent harness built on LangGraph: skills, sub-agents, sandboxes, a filesystem and long-term memory for long-horizon research, coding and content tasks.
nanobot★ 50.5kLightweight self-hosted personal AI agent framework in Python, with a WebUI, terminal and chat-app channels, tools, long-term memory, MCP and scheduled automations.
LangGraph★ 45.6kA library from the LangChain team for building stateful, graph-based agent workflows with explicit control over steps, memory, and human-in-the-loop checkpoints.
Agno★ 43.3kA fast Python framework (formerly Phidata) for building agents with memory, tools, and multimodal inputs, plus a runtime for deploying them in production.
AgentGPT★ 36.3kAgentGPT lets you name a custom AI, give it a goal, and watch it plan tasks, run them, and learn from the results, all from a web browser.
Koog★ 4.7kEl framework de JetBrains para crear agentes de IA en Kotlin y Java idiomáticos, desde servicios backend hasta Android e iOS