Koog क्या है?
Koog Kotlin और Java में idiomatic तरीके से AI एजेंट बनाने के लिए JetBrains का framework, backend services से लेकर Android और iOS तक. यह Agents & Automation टूल्स की Agent Frameworks & Builders श्रेणी में आता है; ओपन सोर्स है, Kotlin में लिखा गया है और Apache-2.0 लाइसेंस के तहत है।
सारांश
Koog, JetBrains का एक ओपन सोर्स framework है, जिससे पूरी तरह Kotlin या Java में AI एजेंट बनाए और चलाए जा सकते हैं। Python stack को wrap करने के बजाय, यह JVM टीमों को type-safe Kotlin DSL और fluent Java builder APIs देता है, ताकि वे ऐसे एजेंट बना सकें जो tools call करें, multi-step workflows चलाएं और उपयोगकर्ताओं से बात करें। JetBrains ने इसे मई 2025 में ओपन सोर्स किया, 21 मई 2026 को पहला stable 1.0 release जारी किया, और इसे Apache 2.0 license के तहत Maven Central पर प्रकाशित करता है।

हर Koog एजेंट एक strategy चलाता है: nodes का एक directed graph, जैसे “LLM को call करें”, “tool execute करें” और “tool का result वापस भेजें”। सबसे सरल एजेंट पहले से तय strategy इस्तेमाल करते हैं (एक basic tool-calling loop, या ReAct, जो reasoning step और action step के बीच बारी-बारी से चलता है), जबकि graph-based एजेंट अपने nodes, edges, subgraphs और parallel branches खुद define करते हैं। Koog functional agents भी देता है, जहाँ logic एक सादा lambda होता है, और planner agents (beta) भी, जो एक plan बनाकर उसे step by step execute करते हैं।
इस core के चारों ओर वे features हैं जिनकी long-running production agents को ज़रूरत होती है: built-in retries, agent persistence जो checkpoint से state वापस लाती है, history compression ताकि लंबी बातचीत context window के अंदर रहे, बातचीत के बीच में history खोए बिना किसी दूसरे LLM पर switch करना, streaming, structured output, और embeddings के साथ RAG। Kotlin Multiplatform के साथ वही agent code JVM, JS, WasmJS, Android और iOS को target करता है, और integrations में Spring Boot, Spring AI, Ktor, Amazon Bedrock AgentCore, Model Context Protocol, A2A और Agent Client Protocol शामिल हैं।
यह क्या करता है
- Basic, functional, graph-based और planner (beta) agents, idiomatic Kotlin DSL में या fluent Java builders से लिखे गए
- ReAct जैसी पहले से तय strategies वाले strategy graphs, custom nodes, subgraphs, parallel node execution और nodes के बीच typed data transfer

- Tools के रूप में annotated functions (@Tool और @LLMDescription), class-based tools या built-in tools, साथ में MCP (beta), A2A (beta) और Agent Client Protocol integration
- Reliability features: retries, checkpoints के साथ agent persistence, history compression, और बातचीत खोए बिना LLM providers बदलना
- OpenAI, Anthropic, Google, DeepSeek, OpenRouter, Amazon Bedrock, Mistral और local Ollama models के clients, streaming और structured output के साथ
- Langfuse, W&B Weave और Datadog के लिए tracing और OpenTelemetry exporters, तथा Spring Boot, Spring AI और Ktor के starters

शुरू करें
Koog को JVM पर JDK 17 या उससे नए version की ज़रूरत है, और मौजूदा projects में Kotlin 2.3.10 या उससे नए version को साफ़ तौर पर set करना होता है। ये steps project के README और Koog docs में दिए Quickstart के अनुसार हैं।

Dependency जोड़ें
Koog, Maven Central पर उपलब्ध है। अपने Gradle build में core agents artifact (और चाहें तो beta additions module) जोड़ें, और सुनिश्चित करें कि आपके repositories में mavenCentral() है। Maven इस्तेमाल करने वाले users इसके बजाय koog-agents-jvm पर निर्भर रहें।
dependencies {
implementation("ai.koog:koog-agents:1.3.0")
implementation("ai.koog:koog-agents-additions:1.3.0-beta")
}Provider का API key सेट करें
Koog को किसी supported provider का API key चाहिए, या Ollama में चल रहा कोई local model। Key को source code में नहीं, environment variable में रखें।
export OPENAI_API_KEY=your-api-keyपहला एजेंट बनाएं और चलाएं
AIAgent एक prompt executor (LLM client), एक model और एक वैकल्पिक system prompt को जोड़ता है। run को call करने पर input भेजा जाता है और एजेंट का जवाब लौटता है।
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)
}एजेंट को एक tool दें
ToolSet लागू करने वाली class में functions को annotate करें, @LLMDescription से उन्हें model के लिए describe करें, और उस set को agent के ToolRegistry में register करें। इसके बाद एजेंट काम करते समय tool call करने का फ़ैसला ले सकता है।
@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?")कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।
कब इस्तेमाल करें
- मौजूदा Spring Boot या Ktor backend में Python service जोड़े बिना AI एजेंट जोड़ना
- Kotlin Multiplatform के ज़रिए वही agent logic Android, iOS और web clients तक पहुँचाना
- लंबे समय चलने वाले, multi-step एजेंट बनाना जो failures के बाद भी बचे रहें, checkpoints से दोबारा शुरू हो सकें और context window के भीतर रहें
- Langfuse, W&B Weave या Datadog में agent runs को node-दर-node trace और debug करना
वर्शन इतिहास
Every verified update to Koog that AI/TLDR tracked, newest first — each links to our coverage and the official changeset.
- 24 सित॰ 20261.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.
- 21 मई 20261.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.
| टूल | स्टार | यह क्या करता है |
|---|---|---|
| DeepSeek Harness | ★ 290k | DeepSeek का ओपन एजेंट हार्नेस, जहाँ हर क्षमता एक प्लगइन है |
| AutoGPT | ★ 188k | दोबारा इस्तेमाल होने वाले ब्लॉक्स से निरंतर AI एजेंट बनाएं, डिप्लॉय करें और चलाएं |
| DeerFlow | ★ 86.1k | सब कुछ पहले से शामिल सुपर एजेंट हार्नेस, जिसमें स्किल्स, सब-एजेंट्स, सैंडबॉक्स और मेमोरी हैं |
| nanobot | ★ 50.5k | WebUI, मेमोरी, MCP और चैट ऐप्स वाला सेल्फ-होस्टेड पर्सनल एजेंट रनटाइम |
| LangGraph | ★ 45.7k | लंबे समय तक चलने वाले, stateful AI agents बनाने के लिए low-level orchestration framework |
| Agno | ★ 43.4k | AI agent प्लेटफ़ॉर्म बनाने, चलाने और मैनेज करने के लिए Python SDK |
| AgentGPT | ★ 36.3k | ब्राउज़र में ही ऑटोनॉमस AI एजेंट बनाएं, कॉन्फ़िगर करें और डिप्लॉय करें |
| Koog | ★ 4.7k | Kotlin और Java में idiomatic तरीके से AI एजेंट बनाने के लिए JetBrains का framework, backend services से लेकर Android और iOS तक |
