Koog 1.0 idioms, gotchas, and scaffolding skills for Kotlin agents on the JVM
87
88%
Does it follow best practices?
Impact
87%
1.85xAverage 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:
runFromCheckpoint only (replay/restore from a saved checkpoint, no feature install)runFromCheckpoint OnlyUse when you have a checkpoint payload (typically from a previous run that did install the feature) and you want to resume execution from it — without installing the write-side feature yourself.
import ai.koog.agents.core.agent.AIAgent
import ai.koog.agents.core.persistence.AgentCheckpointData
val checkpoint: AgentCheckpointData = loadFromYourStorage(...)
val agent = AIAgent(
promptExecutor = ...,
llmModel = ...,
systemPrompt = "...",
)
val result = agent.runFromCheckpoint(checkpoint)AgentCheckpointData shape in 1.0:
id, sessionId, schemaVersion at the top levelproperties: JSONObject contains nodePath, lastInput, lastOutput (moved inside properties in 1.0)storage is the serialized AIAgentStorageIf you constructed checkpoints manually under 0.x, the shape is different — extract the moved fields and rebuild before passing.
Finish here.
Use when the agent needs to write checkpoints continuously during a run — for crash resilience, replay-with-modifications, or to back planner agents that survive restarts.
Add the dependency:
implementation("ai.koog:agents-features-persistence-jdbc:1.0.0")
// or another persistence backend module — JDBC is one of severalInstall in the agent's trailing lambda:
import ai.koog.agents.features.persistence.Persistence
val agent = AIAgent(
promptExecutor = ...,
llmModel = ...,
systemPrompt = "...",
) {
install(Persistence) {
// backend-specific config — JDBC URL + credentials, or in-memory for tests
// type names use `Persistence*` spelling — `Persistency*` from pre-1.0 was renamed
}
}For planner agents specifically: 1.0 added checkpoint support for planner state (KG-673). AIAgentStorage is serialized into checkpoints automatically, so any createStorageKey<T> value with a @Serializable type rides along — non-serializable types break checkpointing silently (invoke Skill(skill: "manage-state") for the serialization constraints).
The corresponding pipeline interfaces also split in 1.0: AIAgentPipeline → AIAgentPipelineAPI + AIAgentGraphPipeline / AIAgentPlannerPipeline. Code that referenced the old interface needs updating.
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