koog
AGENTS.md4.6k starsChanged 7 months agoApache-2.0View on GitHub
Koog is a Kotlin multiplatform framework for building AI agents with graph-based workflows. It supports JVM and JS targets and integrates with multiple LLM providers (OpenAI, Anthropic, Google, OpenRouter, Ollama) and Model Context Protocol (MCP). The project follows a modular architecture with a clear separation of concerns: AIAgent — Main orchestrator that executes strategies in coroutine scopes, manages tools via ToolRegistry, runs features through AIAgentPipeline, and handles LLM communication via PromptExecutor. AIAgentStrategy — Graph-based execution logic that defines workflows as…
Trending
More talk lately.about the whole repository
Who's talking about JetBrains/koog
- A Hacker News story“Koog, a Kotlin-based framework to build and run Al agents in idiomatic Kotlin”Hacker News · May 22, 2025 · 79 points
- @johnoreilly.dev“Yay, just created my first (very basic) AI Agent using the new Koog framework (github.com/JetBrains/koog) …”Bluesky · Jun 10, 2025 · 21 likes
- @vadim-briliantov.bsky.social“If for some reason you haven’t seen it yet, we released Koog — one of the most advanced frameworks for …”Bluesky · Sep 7, 2025 · 19 likes
- @johnoreilly.dev“Koog: a Kotlin-based framework designed to build and run AI agents entirely in idiomatic Kotlin (just …”Bluesky · May 22, 2025 · 17 likes
- @johnoreilly.dev“Inspired by proandroiddev.com/building-age... I updated the Koog agent (github.com/JetBrains/koog) in …”Bluesky · Aug 17, 2025 · 6 likes
The biggest 5 of 59 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 59
Talked about on GitHub, Bluesky and Hacker News (59 times).
On GitHub · 46
- Jul 31, 2025Adding missing watchos targets — oshai/kotlin-logging2 reactions · 5 comments
- Sep 7, 2026build(deps): bump the koog group with 2 updates — edjchapman/HelloDave1 reaction · 1 comment
- Jul 27, 2026build(deps): bump the koog group with 2 updates — edjchapman/HelloDave1 reaction · 1 comment
- Jul 20, 2026build(deps): bump ai.koog:koog-agents from 1.0.0 to 1.1.1 — Yuonsa/CommitGenius1 reaction · 1 comment
- Dec 23, 2025Bump ai.koog:koog-agents from 0.5.4 to 0.6.0 — Marko-Veljovic/Memoriori1 reaction · 1 comment
41 more on GitHub
- Oct 29, 2025Refactoring to Multiplatform Protocol with KMP — phodal/auto-dev1 reaction
- Sep 15, 2025Duplicate LibVersionKt causing Android build failure — modelcontextprotocol/kotlin-sdk1 reaction · 2 comments
- Oct 5, 2026build(deps): Bump ai.koog:koog-agents from 0.8.0 to 1.3.0 — geoknoesis/kastor0 reactions
- Oct 3, 2026agent-skills.github.jetbrains.koog: 1.2.0 → 1.3.0 — sudosubin/agents.nix0 reactions
- Oct 3, 2026build(deps): bump the all-dependencies group with 14 updates — storytellerF/A0 reactions
- Oct 3, 2026Bump ai.koog:agents-tools from 1.2.0 to 1.3.0 in the koog group — T45K/koog-google-search-tool0 reactions · 1 comment
- Oct 1, 2026Bump the gradle group with 2 updates — siarhei-luskanau/koog-models0 reactions
- Sep 28, 2026agent-skills.github.jetbrains.koog: init at 1.2.0 — sudosubin/agents.nix0 reactions
- Sep 28, 2026Bump ai.koog:koog-agents from 1.2.0 to 1.3.0 — myda-chi/frictionless0 reactions
- Sep 28, 2026chore(deps): bump ai.koog:koog-agents from 1.2.0 to 1.3.0 in /android — kaeawc/auto-mobile0 reactions · 1 comment
- Sep 26, 2026Bump ai.koog:http-client-ktor from 1.2.0 to 1.3.0 — UgaiSoftwares/ACPSample0 reactions
- Sep 26, 2026Bump ai.koog:agents-features-trace from 1.2.0 to 1.3.0 — UgaiSoftwares/ACPSample0 reactions · 1 comment
- Sep 24, 2026release: update Package.swift for 1.3.0 — JetBrains/koog-spm0 reactions
- Sep 5, 2026Bump ai.koog:agents-features-trace from 1.1.1 to 1.2.0 — UgaiSoftwares/ACPSample0 reactions · 1 comment
- Sep 5, 2026Bump ai.koog:http-client-ktor from 1.1.1 to 1.2.0 — UgaiSoftwares/ACPSample0 reactions
- Sep 5, 2026Bump ai.koog:agents-tools from 1.1.1 to 1.2.0 in the koog group — T45K/koog-google-search-tool0 reactions · 1 comment
- Sep 1, 2026build(deps): bump ai.koog:koog-agents from 0.8.0 to 1.2.0 in /examples/demo-compose-app — secure-workflows/koog0 reactions · 1 comment
- Aug 31, 2026chore(deps): bump koogVersion from 1.1.1 to 1.2.0 — elenavanengelenmaslova/mocknest-serverless0 reactions · 2 comments
- Aug 27, 2026build(deps): bump ai.koog:koog-agents from 0.6.0 to 1.1.1 in /app — rishabhpandey139/Summora-AI0 reactions
- Jul 24, 2026Koog MkDocs Material icons and nested content tabs are rendered as raw Markdown — BinaryTape/Open-AIDoc0 reactions
- Jul 20, 2026release: update Package.swift for 1.1.1 — JetBrains/koog-spm0 reactions
- May 25, 2026chore: update skills for koog 1.0.0 — javiergbravo/koog-skills-mcp0 reactions
- May 22, 2026Bump ai.koog:koog-agents from 0.7.1 to 1.0.0 — Valentine-456/AICodePlugin0 reactions
- Apr 23, 2026chore: update skills for koog 0.8.0 — javiergbravo/koog-skills-mcp0 reactions
- Apr 7, 2026build(deps): bump ai.koog:koog-agents from 0.6.0 to 0.7.3 in /examples/demo-compose-app — xfqwdsj/koog-fixed-llm-provider0 reactions · 1 comment
- Mar 31, 2026Bump ai.koog:koog-agents-jvm from 0.7.2 to 0.7.3 — Iarylkin/auto-issue0 reactions · 1 comment
- Mar 23, 2026Bump ai.koog:koog-agents-jvm from 0.7.1-rc3 to 0.7.2 — Iarylkin/auto-issue0 reactions · 1 comment
- Mar 23, 2026fix(koog-ktor): parsing timeouts configuration — BLannoo/koog0 reactions
- Mar 13, 2026Add Java API to Koog documentation — BLannoo/koog0 reactions · 2 comments
- Mar 9, 2026build(deps): bump ai.koog:koog-agents from 0.6.0 to 0.6.4 in /app — talosross/SummaryYou0 reactions
- Feb 26, 2026chore(deps): bump koog from 0.6.2 to 0.6.3 — phodal/routa.kt0 reactions
- Feb 13, 2026add multi executor and history compression strategy — hernandazevedo/kotlin-ai-agent-koog0 reactions
- Oct 30, 2025Bump ai.koog:koog-agents from 0.4.1 to 0.5.2 — iammohdzaki/Starter-Project-Ktor0 reactions
- Sep 4, 2025Check trending repo: JetBrains/koog — uibm/trending-watcher0 reactions · 1 comment
- Sep 4, 2025Check trending repo: JetBrains/koog — uibm/trending-watcher0 reactions · 1 comment
- Sep 3, 2025Check trending repo: JetBrains/koog — uibm/trending-watcher0 reactions · 1 comment
- Sep 3, 2025Check trending repo: JetBrains/koog — uibm/trending-watcher0 reactions · 1 comment
- Sep 2, 2025Check trending repo: JetBrains/koog — uibm/trending-watcher0 reactions · 1 comment
- Sep 1, 2025Check trending repo: JetBrains/koog — uibm/trending-watcher0 reactions · 1 comment
- Aug 6, 2025[FEAT] Introduce Koog for full agentic capabilities — Open-Distributed-Edge-Agents/EdgeGenAI0 reactions
- Jun 20, 2025Interesting Projects — PenumbraOS/mabl0 reactions
On Bluesky · 12
- Jun 10, 2025Yay, just created my first (very basic) AI Agent using the new Koog framework (github.com/JetBrains/koog) from @jetbrains.com . Agent… — @johnoreilly.dev21 likes and reposts · 1 reply
- Sep 7, 2025If for some reason you haven’t seen it yet, we released Koog — one of the most advanced frameworks for building AI agents! Targeting… — @vadim-briliantov.bsky.social19 likes and reposts
- May 22, 2025Koog: a Kotlin-based framework designed to build and run AI agents entirely in idiomatic Kotlin (just announced at #KotlinConf keynote)… — @johnoreilly.dev17 likes and reposts · 1 reply
- Aug 17, 2025Inspired by proandroiddev.com/building-age... I updated the Koog agent (github.com/JetBrains/koog) in ClimateTraceKMP sample… — @johnoreilly.dev6 likes and reposts
- Jul 3, 2025Did you know that a lot of Kotlin AI libraries are built on top of Ktor? The new Koog library for building agents is doing all its… — @vergauwensimon.bsky.social4 likes and reposts
7 more on Bluesky
- Sep 23, 2026https://github.com/JetBrains/koog more like this: https://agentwire.thecompound.tech/aw/1f6ane — @agentwire.thecompound.tech2 likes and reposts
- Aug 11, 2026Does anyone have experience with this #Kotlin library for building agents? Thoughts? I need Kotlin as it'd like to build an Android app.… — @alexn.org2 likes and reposts · 3 replies
- Oct 4, 2025Trying out new Functional Agents support in Koog 0.5.0 (github.com/JetBrains/koog) ....also have set things up now to invoke population and… — @johnoreilly.dev2 likes and reposts · 1 reply
- Sep 30, 2025More information about Koog here github.com/JetBrains/koog. @vadim-briliantov.bsky.social (Koog Technical Lead) has also been writing a… — @johnoreilly.dev2 likes and reposts · 1 reply
- Sep 10, 2025JetBrains Koog : « We didn’t just port Python concepts to Kotlin. We reimagined what an AI agent framework could be »… — @nfonrose.bsky.social1 likes and repost · 1 reply
- May 26, 2025https://github.com/JetBrains/koog KoogはKotlinでAIエージェントを構築・実行するためのフレームワークです。 自然なKotlinでAIエージェントを構築できます。 外部システムやAPIにアクセスするツールでエージェントを拡張可能です。 — @topickapp.bsky.social1 likes and repost
- May 25, 2025Koog, a Kotlin-based framework to build and run Al agents in idiomatic Kotlin | Discussion — @hackernewsbot.bsky.social1 likes and repost
On Hacker News · 1
- May 22, 2025Koog, a Kotlin-based framework to build and run Al agents in idiomatic Kotlin79 points · 2 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository7 other files it gives its agents.
- a2a/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- examples/simple-examples/CLAUDE.mdCLAUDE.md
- add-java-code-snippets-in-docsSkill
- split-jvm-nonjvmSkill
- arithmetic-evaluatorSkill
- weather-retrievalSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
23 rules. About 1 is common, 19 are distinctive, and 3 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 64
Follow Kotlin Coding Conventions
- Distinctive: line 65
Use four spaces for indentation (consistent across all files)
- Distinctive: line 67
Use descriptive variable and function names
- Distinctive: line 68
Prefer functional programming patterns where appropriate
- Distinctive: line 69
Use type-safe builders and DSLs for configuration
- Distinctive: line 70
Document public APIs with KDoc comments
- Distinctive: line 71
NEVER suppress compiler warnings without a good reason
- Distinctive: line 74
Read and follow the Quality Gates section in /TESTING.md before considering any code change complete.
- Common: line 173
NEVER: commit API keys or secrets to the repository
- Distinctive: line 174
Use environment variables for all sensitive configuration
- Distinctive: line 188
Use type-safe tool arguments to prevent injection attacks
- Distinctive: line 194
Use specific version ranges to avoid supply chain attacks
- Distinctive: line 196
Follow the principle of the least privilege in tool implementations
- Distinctive: line 221
Test configuration supports both JVM and JS targets
- Distinctive: line 233
develop: All development (features and bug fixes)
- Very specific: line 236
Use descriptive branch names: feature/agent-memory, fix/tool-registry-bug
- Very specific: line 240
ALWAYS: run ./gradlew build before submitting PRs
- Distinctive: line 241
Ensure all tests pass on JVM, JS, WASM targets
- Distinctive: line 242
Follow established patterns in existing code
- Distinctive: line 243
Add tests for new functionality
- Distinctive: line 244
Update documentation for API changes
- Very specific: line 248
Use conventional commit format: feat:, fix:, docs:, test:
- Distinctive: line 250
Keep commits focused and atomic
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Koog AI Agent Framework
Koog is a Kotlin multiplatform framework for building AI agents with graph-based workflows. It supports JVM and JS targets and integrates with multiple LLM providers (OpenAI, Anthropic, Google, OpenRouter, Ollama) and Model Context Protocol (MCP).
Project Structure
The project follows a modular architecture with a clear separation of concerns:
koog/
├── agents/
│ ├── agents-core/ # Core abstractions (AIAgent, AIAgentStrategy, AIAgentEnvironment)
│ ├── agents-tools/ # Tool infrastructure (Tool<TArgs, TResult>, ToolRegistry, AIAgentTool)
│ ├── agents-features-*/ # Feature implementations (memory, tracing, event handling)
│ ├── agents-mcp/ # Model Context Protocol integration
│ └── agents-test/ # Testing utilities and framework
├── prompt-*/ # LLM interaction layer (executors, models, structured data)
├── embeddings-*/ # Vector embedding support
├── examples/ # Reference implementations and usage patterns
└── build.gradle.kts # Root build configurationBuild & Commands
Development Commands
# Full build including tests
./gradlew build
# Build without tests
./gradlew assemble
# Run all JVM tests
./gradlew jvmTest
# Run all JS tests
./gradlew jsTest
# Test specific module
./gradlew :agents:agents-core:jvmTest
# Run specific test class
./gradlew jvmTest --tests "ai.koog.agents.test.SimpleAgentMockedTest"
# Run specific test method
./gradlew jvmTest --tests "ai.koog.agents.test.SimpleAgentMockedTest.test AIAgent doesn't call tools by default"
# Compile test classes only (for faster iteration)
./gradlew jvmTestClasses jsTestClassesDevelopment Environment
- JDK: 17+ required for JVM target
- Build System: Gradle with version catalogs for dependency management
- Targets: JVM, JavaScript (Kotlin Multiplatform), WASM
- IDE: IntelliJ IDEA recommended with Kotlin plugin
Code Style
- Follow Kotlin Coding Conventions
- Use four spaces for indentation (consistent across all files)
- Name test functions as
testXxx(no backticks for readability) - Use descriptive variable and function names
- Prefer functional programming patterns where appropriate
- Use type-safe builders and DSLs for configuration
- Document public APIs with KDoc comments
- NEVER suppress compiler warnings without a good reason
Quality Gates
Read and follow the Quality Gates section in /TESTING.md before considering any code change complete.
Architecture
Core Framework Components
AIAgent — Main orchestrator that executes strategies in coroutine scopes, manages tools via ToolRegistry, runs features through AIAgentPipeline, and handles LLM communication via PromptExecutor.
AIAgentStrategy — Graph-based execution logic that defines workflows as subgraphs with start/finish nodes, manages tool selection strategy, and handles termination/error reporting.
ToolRegistry — Centralized, type-safe tool management using a builder pattern: ToolRegistry { tool(MyTool()) }.
Supports registry merging with + operator.
AIAgentFeature — Extensible capabilities installed into AIAgentPipeline with configuration. Features have unique storage keys and can intercept agent lifecycle events.
Module Organization
- agents-core: Core abstractions (
AIAgent,AIAgentStrategy,AIAgentEnvironment) - agents-tools: Tool infrastructure (
Tool<TArgs, TResult>,ToolRegistry,AIAgentTool) - agents-features-*: Feature implementations (memory, tracing, event handling)
- agents-mcp: Model Context Protocol integration
- prompt-*: LLM interaction layer (executors, models, structured data)
- embeddings-*: Vector embedding support
- examples: Reference implementations and usage patterns
Key Architectural Patterns
- State Machine Graphs: Agents execute as node graphs with typed edges
- Feature Pipeline: Extensible behavior via installable features with lifecycle hooks
- Environment Abstraction: Safe tool execution context preventing direct tool calls
- Type Safety: Generics ensure compile-time correctness for tool arguments/results
- Builder Patterns: Fluent APIs for configuration throughout the framework
Testing
The framework provides comprehensive testing utilities in agents-test module:
LLM Response Mocking
val mockLLMApi = getMockExecutor(toolRegistry, eventHandler) {
mockLLMAnswer("Hello!") onRequestContains "Hello"
mockLLMToolCall(CreateTool, CreateTool.Args("solve")) onRequestEquals "Solve task"
mockLLMAnswer("Default response").asDefaultResponse
}Tool Behavior Mocking
// Simple return value
mockTool(PositiveToneTool) alwaysReturns "The text has a positive tone."
// With additional actions
mockTool(NegativeToneTool) alwaysTells {
println("Tool called")
"The text has a negative tone."
}
// Conditional responses
mockTool(SearchTool) returns SearchTool.Result("Found") onArgumentsMatching {
args.query.contains("important")
}Graph Structure Testing
AIAgent(...) {
withTesting()
testGraph("test") {
val firstSubgraph = assertSubgraphByName<String, String>("first")
val secondSubgraph = assertSubgraphByName<String, String>("second")
assertEdges {
startNode() alwaysGoesTo firstSubgraph
firstSubgraph alwaysGoesTo secondSubgraph
}
verifySubgraph(firstSubgraph) {
val askLLM = assertNodeByName<String, Message.Response>("callLLM")
assertNodes {
askLLM withInput "Hello" outputs Message.Assistant("Hello!")
}
}
}
}For comprehensive testing examples, see agents/agents-test/TESTING.md.
Security
API Key Management
- NEVER commit API keys or secrets to the repository
- Use environment variables for all sensitive configuration
- Store test API keys in a local environment only
- Required environment variables for integration tests:
ANTHROPIC_API_TEST_KEYGEMINI_API_TEST_KEYMISTRAL_AI_API_TEST_KEYOLLAMA_IMAGE_URLOPEN_AI_API_TEST_KEYOPEN_ROUTER_API_TEST_KEY
Tool Execution Safety
- Tools execute within controlled
AIAgentEnvironmentcontexts - Direct tool calls are prevented outside agent execution
- Use type-safe tool arguments to prevent injection attacks
- Validate all external inputs in tool implementations
Dependency Security
- Regularly update dependencies using Gradle version catalogs
- Use specific version ranges to avoid supply chain attacks
- Review dependencies for known vulnerabilities
- Follow the principle of the least privilege in tool implementations
Configuration
Environment Setup
Set environment variables for integration testing (never commit API keys):
# Export in your shell or IDE run configuration
export ANTHROPIC_API_TEST_KEY=your_key_here
export DEEPSEEK_API_TEST_KEY=your_key_here
export GEMINI_API_TEST_KEY=your_key_here
export MISTRAL_AI_API_TEST_KEY=your_key_here
export OLLAMA_IMAGE_URL=http://localhost:11434
export OPEN_AI_API_TEST_KEY=your_key_here
export OPEN_ROUTER_API_TEST_KEY=your_key_here
# Or add to ~/.bashrc, ~/.zshrc, or IDE environment variablesGradle Configuration
- Uses version catalogs (
gradle/libs.versions.toml) for dependency management - Multiplatform configuration in
build.gradle.kts - Test configuration supports both JVM and JS targets
Development Environment Requirements
- JDK: 17+ (OpenJDK recommended)
- IDE: IntelliJ IDEA with Kotlin Multiplatform plugin
- Optional: Docker for Ollama local testing
Development Workflow
Branch Strategy
- develop: All development (features and bug fixes)
- main: Released versions only
- Base all PRs against
developbranch - Use descriptive branch names:
feature/agent-memory,fix/tool-registry-bug
Code Quality
- ALWAYS run
./gradlew buildbefore submitting PRs - Ensure all tests pass on JVM, JS, WASM targets
- Follow established patterns in existing code
- Add tests for new functionality
- Update documentation for API changes
Commit Guidelines
- Use conventional commit format:
feat:,fix:,docs:,test: - Include issue references where applicable
- Keep commits focused and atomic
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

