Koog 1.0 idioms, gotchas, and scaffolding skills for Kotlin agents on the JVM
86
88%
Does it follow best practices?
Impact
86%
1.86xAverage score across 45 eval scenarios
Advisory
Suggest reviewing before use
This skill is an action router — pick the step that matches the user's intent and execute only that step. Do not run other steps; do not parallelize.
Available actions:
Add the dependencies:
implementation("ai.koog:a2a-core:1.0.0")
implementation("ai.koog:a2a-server:1.0.0")Construct the agent normally, then wrap it in an A2A server:
import ai.koog.a2a.server.A2AServer
val agent = AIAgent(
promptExecutor = ...,
llmModel = ...,
systemPrompt = "...",
)
val server = A2AServer.builder()
.agent(agent)
.port(8080)
.build()
server.start()The server exposes the agent over the A2A wire protocol — remote clients can invoke run(...) on it as if it were a local agent. Auth, transport, and routing options live on the builder.
For Ktor-backed deployments, the A2A server can also install as a Ktor route — wire the route inside an install(Koog) { ... } block (see wire-ktor-server) rather than running a separate server process.
Finish here.
Add the client dependency:
implementation("ai.koog:a2a-core:1.0.0")
implementation("ai.koog:a2a-client:1.0.0")Build a client and use it inside the local agent — typically wrapped as a tool, so the local LLM can decide when to delegate to the remote agent:
import ai.koog.a2a.client.A2AClient
import ai.koog.agents.core.tools.annotations.Tool
import ai.koog.agents.core.tools.annotations.LLMDescription
import ai.koog.agents.core.tools.reflect.ToolSet
import ai.koog.agents.core.tools.reflect.asTools
val remoteClient = A2AClient.builder()
.endpoint("https://remote-agent.example/a2a")
.auth(...)
.build()
@LLMDescription("Tools that delegate to a remote specialist agent")
class RemoteAgentTools(private val client: A2AClient) : ToolSet {
@Tool
@LLMDescription("Ask the specialist agent for a deep analysis of the input")
suspend fun deepAnalysis(@LLMDescription("Input to analyze") input: String): String =
client.run(input)
}
val localAgent = AIAgent(
promptExecutor = ...,
llmModel = ...,
toolRegistry = ToolRegistry { tools(RemoteAgentTools(remoteClient).asTools()) },
systemPrompt = "...",
)A2A is similar in spirit to MCP — both expose remote capabilities — but the wire shapes differ. Use A2A when the remote is itself a full agent (it plans, retries, calls its own tools); use MCP when the remote is a tool host. See wire-mcp-server for the MCP path.
Finish here.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20
scenario-21
scenario-22
scenario-23
scenario-24
scenario-25
scenario-26
scenario-27
scenario-28
scenario-29
scenario-30
scenario-31
scenario-32
scenario-33
scenario-34
scenario-35
scenario-36
scenario-37
scenario-38
scenario-39
scenario-40
scenario-41
scenario-42
scenario-43
scenario-44
scenario-45
skills
add-observability
add-persistence
add-rag
add-structured-output
add-token-budgeting
add-tool
cache-llm-calls
define-prompt
domain-model-subtask-pipeline
references
enable-prompt-caching
handle-agent-events
manage-state
migrate-from-0-x
model-planner-subtasks
persist-chat-history
query-sql-from-agent
scaffold-agent
snapshot-and-restore
test-koog-agents
trace-agent-internals
use-attachments
use-functional-agent
use-llm-node-variants
use-planner
wire-a2a
wire-acp-server
wire-ktor-server
wire-mcp-server
wire-spring-boot