koog / a2a
CLAUDE.md4.6k starsChanged 7 months agoApache-2.0View on GitHub
The A2A (Agent-to-Agent) module is a meta-module within the larger Koog project that implements a comprehensive client and server library for the A2A protocol, a standardized communication protocol for AI agents based on the specification at https://a2a-protocol.org/latest/specification/. Important: Since this is a meta-module inside a bigger root project, the Gradle wrapper executable is located one directory up. All Gradle commands must use ../gradlew when running from the a2a directory.
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
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.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 CLAUDE.md into the rules it gives an agent
22 rules. About 0 are common, 7 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
No external dependencies beyond Kotlin stdlib and serialization
- Very specific: line 76
Use explicitApi() - all public APIs must have explicit visibility modifiers
- Very specific: line 77
Prefer public declarations for APIs, internal for implementation details
- Very specific: line 78
Use @InternalA2AApi annotation for APIs that are public but internal to the module
- Very specific: line 87
Use suspend functions for all async operations
- Very specific: line 88
Prefer Flow for streaming APIs (task events, message streams)
- Very specific: line 89
Use RWLock pattern: rwLock.withReadLock/withWriteLock for concurrent access
- Very specific: line 90
Use Mutex for single-threaded critical sections: mutex.withLock
- Very specific: line 93
Use domain-specific exceptions (A2AInternalErrorException, TaskOperationException)
- Very specific: line 99
Constructor properties: Document using @param tags in class KDoc
- Very specific: line 100
Public class properties: Document using @property tags in class KDoc
- Very specific: line 101
Cross-references: Use [ClassName], [ClassName.propertyName] syntax for linking components
- Distinctive: line 103
Validation rules: Document constraints with bullet points and clear explanations
- Very specific: line 104
Exception documentation: Use @throws with specific conditions
- Very specific: line 105
Required: All public APIs must have KDoc (enforced by explicitApi())
- Distinctive: line 124
Focus on core functionality: - test essential behavior, not implementation details
- Distinctive: line 126
Avoid verbose, unnecessary tests: - don't test trivial getters/setters
- Distinctive: line 127
Test error conditions: - verify proper exception handling and error states
- Distinctive: line 197
Keep protocol logic separate from transport mechanism
- Distinctive: line 198
Use suspend functions for all transport operations
- Very specific: line 221
Use SessionEventProcessor for event-driven session handling
- Very specific: line 223
Use structured concurrency with CoroutineScope
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
A2A Module Development Guidelines
Module Overview
The A2A (Agent-to-Agent) module is a meta-module within the larger Koog project that implements a comprehensive client and server library for the A2A protocol, a standardized communication protocol for AI agents based on the specification at https://a2a-protocol.org/latest/specification/.
Important: Since this is a meta-module inside a bigger root project, the Gradle wrapper executable is located one directory up. All Gradle commands must use ../gradlew when running from the a2a directory.
Purpose
- Agent Discovery: Through AgentCard manifests describing agent capabilities and interfaces
- Message Exchange: Standardized message format with support for different content types
- Task Management: Long-running operations with state tracking and lifecycle management
- Push Notifications: Asynchronous notifications for task updates
- Multiple Transport Protocols: JSON-RPC, HTTP+JSON/REST with extensibility for gRPC
- Authentication & Security: OpenAPI 3.0 compatible security schemes
Submodules Architecture
- a2a-core: Core abstractions, data models, and transport interfaces
- AgentCard, Message, Task, Event hierarchy
- Transport interfaces: ClientTransport, ServerTransport, RequestHandler
- No external dependencies beyond Kotlin stdlib and serialization
- a2a-client: High-level client library for communicating with A2A servers
- A2AClient wrapper, AgentCardResolver
- Capability validation, request/response handling
- Depends on: a2a-core, Ktor HTTP client
- a2a-server: Server-side implementation for hosting A2A agents
- A2AServer, AgentExecutor interface, session management
- Storage abstractions with in-memory implementations
- Depends on: a2a-core, coroutines, logging
- a2a-transport: Multiple transport protocol implementations
- a2a-transport-core-jsonrpc: JSON-RPC protocol base classes
- a2a-transport-client-jsonrpc-http: HTTP JSON-RPC client transport
- a2a-transport-server-jsonrpc-http: HTTP JSON-RPC server transport
- a2a-transport-*-rest: HTTP+JSON/REST protocol implementations
Technologies & Libraries
Core Dependencies (from gradle/libs.versions.toml)
- Kotlin Multiplatform
- kotlinx-serialization: JSON serialization for protocol messages
- kotlinx-coroutines: Async/concurrent programming, Flow APIs
- kotlinx-datetime: Timestamp handling in protocol messages
- ktor3: HTTP client/server for transport implementations
- oshai-kotlin-logging: Structured logging
Testing Libraries
- kotlin-test: Multiplatform test framework
- kotest-assertions: Rich assertion library for complex objects
- kotlinx-coroutines-test: Testing coroutines with runTest
- testcontainers: Docker-based integration testing
- logback-classic: Runtime logging for tests
Platform Support
- JVM: Full server and client support
- JS (Browser): Client-only support
- Future platforms: Architecture ready for native support
Development Guidelines
Architecture Decisions
⚠️ CRITICAL: Never make design and architecture decisions independently. Always ask the user for confirmation before:
- Adding new transport protocols
- Changing storage interfaces
- Modifying core protocol message formats
- Adding new authentication schemes
- Changing session management behavior
- Doing other sorts of major architectural changes
Code Style Conventions
API Visibility
- Use
explicitApi()- all public APIs must have explicit visibility modifiers - Prefer
publicdeclarations for APIs,internalfor implementation details - Use
@InternalA2AApiannotation for APIs that are public but internal to the module
Naming Conventions
- Classes: PascalCase (
A2AServer,SessionManager,AgentExecutor) - Interfaces: Same as classes, often ending in -or/-er for behaviors (
AgentExecutor) - Functions: camelCase with descriptive names (
onSendMessage,getByContext) - Properties: camelCase (
agentCard,sessionMutex)
Async Patterns
- Use
suspendfunctions for all async operations - Prefer
Flowfor streaming APIs (task events, message streams) - Use
RWLockpattern:rwLock.withReadLock/withWriteLockfor concurrent access - Use
Mutexfor single-threaded critical sections:mutex.withLock
Error Handling
- Use domain-specific exceptions (
A2AInternalErrorException,TaskOperationException) - Propagate errors properly in async contexts
- Include contextual information in exception messages
KDoc Documentation
- Placement: KDoc directly above declarations (classes, functions, properties)
- Constructor properties: Document using
@paramtags in class KDoc - Public class properties: Document using
@propertytags in class KDoc - Cross-references: Use
[ClassName],[ClassName.propertyName]syntax for linking components - Examples: Include practical code examples for complex APIs
- Validation rules: Document constraints with bullet points and clear explanations
- Exception documentation: Use
@throwswith specific conditions - Required: All public APIs must have KDoc (enforced by
explicitApi())
Testing Requirements
Mandatory Test Execution
⚠️ ALWAYS run the specific test suite using Gradle's jvmTest task to ensure changes work correctly:
# Run all tests in a specific module
../gradlew :a2a:a2a-server:jvmTest
# Run a specific test class
../gradlew :a2a:a2a-server:jvmTest --tests "ai.koog.a2a.server.tasks.InMemoryTaskStorageTest"
# Run a specific test method
../gradlew :a2a:a2a-client:jvmTest --tests "ai.koog.a2a.client.A2AClientIntegrationTest.test get agent card"Testing Approach: Crucial Minimum
- Focus on core functionality - test essential behavior, not implementation details
- Separate dedicated tests - one test method per core scenario/edge case
- Avoid verbose, unnecessary tests - don't test trivial getters/setters
- Test error conditions - verify proper exception handling and error states
Preferred Assertion Pattern
✅ DO: Assert on whole objects when possible (especially data classes):
assertEquals(expectedTask, actualTask) // Compares all properties
assertEquals(listOf(expectedArtifact), retrieved?.artifacts)❌ AVOID: Bunch of individual field assertions unless necessary:
// Avoid this pattern:
assertEquals(expected.id, actual.id)
assertEquals(expected.contextId, actual.contextId)
assertEquals(expected.status, actual.status)
// ... many more individual assertionsIntegration Tests
- Docker-based testing: a2a-client uses testcontainers with Python A2A server
- Docker build dependency: Integration tests automatically build required containers
- Test isolation: Each test should be independent and clean up after itself
Test Structure Examples
Unit Tests (InMemoryTaskStorageTest pattern):
class InMemoryTaskStorageTest {
private lateinit var storage: InMemoryTaskStorage
@BeforeTest
fun setUp() {
storage = InMemoryTaskStorage()
}
@Test
fun testStoreAndRetrieveTask() = runTest {
val task = createTask(id = "task-1", contextId = "context-1")
storage.update(task)
val retrieved = storage.get("task-1")
assertNotNull(retrieved)
assertEquals(task, retrieved) // Whole object assertion
}
}Integration Tests (A2AClientIntegrationTest pattern):
@Testcontainers
class A2AClientIntegrationTest {
@Container
val testA2AServer = GenericContainer("test-python-a2a-server")
.withExposedPorts(9999)
.waitingFor(Wait.forListeningPort())
@Test
fun `test get agent card`() = runTest {
val agentCard = client.getAgentCard()
val expectedAgentCard = AgentCard(...)
assertEquals(expectedAgentCard, agentCard) // Full object comparison
}
}Implementation Patterns
Transport Layer Abstraction
- Implement
ClientTransportinterface for new client protocols - Implement
ServerTransportandRequestHandlerfor new server protocols - Keep protocol logic separate from transport mechanism
- Use suspend functions for all transport operations
Storage Interface Pattern
public interface SomeStorage {
public suspend fun save(item: Item)
public suspend fun get(id: String): Item?
public suspend fun delete(id: String)
}
// In-memory implementation for testing/development
@OptIn(InternalA2AApi::class)
public class InMemorySomeStorage : SomeStorage {
private val rwLock = RWLock()
private val items = mutableMapOf<String, Item>()
override suspend fun save(item: Item) = rwLock.withWriteLock {
items[item.id] = item
}
}Session Management Pattern
- Use
SessionEventProcessorfor event-driven session handling - Implement proper cleanup with
Closeableinterface - Use structured concurrency with
CoroutineScope - Handle session lifecycle properly (start → active → closed)
Agent Executor Implementation
public class MyAgentExecutor : AgentExecutor {
override suspend fun execute(
context: RequestContext<MessageSendParams>,
eventProcessor: SessionEventProcessor
) {
// Process request and send events through eventProcessor
eventProcessor.sendTaskEvent(/* task event */)
}
}Some Common Commands
# Build specific modules (a2a is a meta-module, build individual modules)
../gradlew :a2a:a2a-core:assemble
../gradlew :a2a:a2a-client:assemble
../gradlew :a2a:a2a-server:assemble
# Run JVM tests for specific modules
../gradlew :a2a:a2a-core:jvmTest
../gradlew :a2a:a2a-client:jvmTest
../gradlew :a2a:a2a-server:jvmTest
../gradlew :a2a:a2a-transport:a2a-transport-core-jsonrpc:jvmTest
# Run JS tests for specific modules
../gradlew :a2a:a2a-core:jsTest
../gradlew :a2a:a2a-client:jsTest
../gradlew :a2a:a2a-server:jsTest
# Build all non-transport a2a modules at once
../gradlew :a2a:a2a-core:assemble :a2a:a2a-client:assemble :a2a:a2a-server:assemble
# Run all JVM tests across a2a modules
../gradlew :a2a:a2a-core:jvmTest :a2a:a2a-client:jvmTest :a2a:a2a-server:jvmTestDoes 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.

