Koog: Kotlin AI agent workflows with Spring
Learn how Koog builds a banking agent with Spring, typed graph workflows, persistent chat memory, crash recovery and history compression.
Player not loading? Watch on YouTube
Vadim Briliantov explains Koog, the open source Kotlin and JVM framework, through a Spring banking backend. The talk covers typed agent workflows, saved conversations and crash recovery using hosted models. An introductory announcement also describes Android agents running models on the device.
The example starts with annotated Kotlin functions for reading accounts and transferring money. Briliantov recommends injecting user IDs and secrets through application code rather than letting the model supply them. Spring Boot and Spring AI integrations handle model configuration, and persistent chat memory lets users continue earlier conversations after an application restart.
Most of the session develops a typed graph workflow that separates problem identification, account changes and verification. Each step gets a limited tool set and can use a different model. Koog adapts earlier tool calls when later steps change the available tools. The speaker explains that graph strategies support checkpoint recovery, whereas functional strategies lack persistence and observability.
The final section covers tracing and context costs. Briliantov demonstrates history compression, then explains how summaries can discard details and trigger repeated work. He presents chunking and fact retrieval as alternatives, reporting a roughly 5 to 8 percent benchmark improvement for fact retrieval without establishing a universal performance gain.