JetBrains/koog
소개
Koog는 JVM(Java 및 Kotlin) 기반 프레임워크로, 백엔드 서비스부터 Android와 iOS, JVM, 나아가 브라우저 환경까지 모든 플랫폼에서 예측 가능하고 장애에 강하며 엔터프라이즈 환경에 적합한 AI 에이전트를 구축할 수 있습니다. Koog는 AI 제품 개발 경험을 바탕으로 복잡한 LLM 및 AI 문제에 검증된 솔루션을 제공합니다.
웹 및 앱 개발What you can do
- 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.
측정된 스타 증가
- in 24h
- +2
- in 7 days
- +5
- in 15 days
- +16
- in 1 month
- +30
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalKoog
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
Currently, the framework supports the JVM, JS, WasmJS and iOS targets.
Requirements
- JDK 17 or higher is required to use the framework on JVM.
- Kotlin 2.3.10 or higher is required on JVM, and Kotlin 2.4 or higher for JS, WasmJS and iOS. It should be set explicitly in existing projects. Please check the libs.versions.toml to know more about Kotlin dependencies (currently it uses kotlinx-coroutines 1.10.2, kotlinx-serialization 1.10.0 and kotlinx-datetime 0.7.1)
Gradle (Kotlin DSL)
Add dependencies to the
build.gradle.ktsfile:dependencies { implementation("ai.koog:koog-agents:1.4.0") implementation("ai.koog:koog-agents-additions:1.4.0-beta") }Make sure that you have
mavenCentral()in the list of repositories.
Gradle (Groovy)
Add dependencies to the
build.gradlefile:dependencies { implementation 'ai.koog:koog-agents:1.4.0' implementation 'ai.koog:koog-agents-additions:1.4.0-beta' }Make sure that you have
mavenCentral()in the list of repositories.
Maven
Add dependencies to the
pom.xmlfile:<dependency> <groupId>ai.koog</groupId> <artifactId>koog-agents-jvm</artifactId> <version>1.4.0</version> </dependency> <dependency> <groupId>ai.koog</groupId> <artifactId>koog-agents-additions-jvm</artifactId> <version>1.4.0-beta</version> </dependency>Make sure that you have
mavenCentralin the list of repositories.
Versioning
Koog framework is stable and follows semantic versioning. See VERSIONING.md for details.
Contributing
Read the Contributing Guidelines.
Code of Conduct
This project and the corresponding community are governed by the JetBrains Open Source and Community Code of Conduct. Please make sure you read it.
License
Koog is licensed under the Apache 2.0 License.
Support
Please feel free to ask any questions in our official Slack channel and to use Koog official YouTrack project for filing feature requests and bug reports.
관련 프로젝트 살펴보기
불러오는 중…