adk-kotlin
AGENTS.md305 starsChanged 52 days agoApache-2.0View on GitHub
The Agent Development Kit (ADK) for Kotlin is an open-source, code-first Kotlin toolkit for building and deploying AI agents on the JVM and Android. It mirrors adk-python, which is the source of truth for behaviour. Runtime code lives in core, under the package com.google.adk.kt, one sub-package per concept (agents, runners, tools, events, sessions, models, ...). settings.gradle.kts lists the other modules. Skills for ADK Kotlin development are in .agents/skills/: The skills record only what should stay true across releases and point…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 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 repository21 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adk-kotlin-agent-builderSkill
- adk-kotlin-setupSkill
- root-only-skillSkill
- skill1Skill
- skill2Skill
- mismatchedSkill
- skill-unauthorizedSkill
- valid-skillSkill
- mismatchedSkill
- skill1Skill
- echo_skillSkill
- py_skillSkill
- cast-fireballSkill
- summon-familiarSkill
- cast-fireballSkill
- summon-familiarSkill
- translateSkill
- cast-fireballSkill
- summon-familiarSkill
- translateSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Keep these when changing the runtime:
- Distinctive: line 35
Only non-partial events are persisted.
- Very specific: line 37
Don't choose a dispatcher on the agent, model or tool path.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
AGENTS.md
Project Overview
The Agent Development Kit (ADK) for Kotlin is an open-source, code-first Kotlin toolkit for building and deploying AI agents on the JVM and Android. It mirrors adk-python, which is the source of truth for behaviour.
Key Components
- Agent (
BaseAgent,LlmAgent): identity, instructions, tools and sub-agents. - Runner (
Runner,InMemoryRunner): runs one invocation perrunAsynccall and returns aFlow<Event>. - Tool (
BaseTool,FunctionTool,@Toolvia KSP,Toolset): capabilities the model can call. - Context: what tools and callbacks receive to read and write state, artifacts and memory.
- Session (
SessionService,State): conversation history and state. - Model (
Model,Gemini, and on-device backends): one interface for cloud and local models. - Plugins and callbacks: hooks around runs, agents, model calls and tool calls.
Runtime code lives in core, under the package com.google.adk.kt, one sub-package per concept (agents, runners, tools, events, sessions, models, ...). settings.gradle.kts lists the other modules.
Skills
Skills for ADK Kotlin development are in .agents/skills/:
| Skill | Use it for |
adk-kotlin-setup | Adding ADK to a project, KSP wiring for @Tool, building and testing this repository, source-set placement, PR rules |
adk-kotlin-agent-builder | Writing agents, tools, multi-agent trees, callbacks, state handling and tests; references/best-practices.md lists the common failure modes |
The skills record only what should stay true across releases and point at the code for everything else. When a skill and the code disagree, the code is right; fix the skill in the same change.
Runtime invariants
Keep these when changing the runtime:
runAsyncreturns a coldFlow: nothing runs until it is collected.- Only non-partial events are persisted. Partial streaming chunks are emitted but never stored.
- State changes travel on events (
EventActions.stateDelta) and are applied when the session service appends the event.temp:keys are applied to the live session and never stored. - Don't choose a dispatcher on the agent, model or tool path; it inherits the collector's. Always rethrow
CancellationException. - Plugin callbacks run before an agent's own callbacks.
internaland@FrameworkInternalApisymbols are not public API.@ExperimentalWorkflowApimarks the experimental graph workflow in theworkflowpackage,@ExperimentalLiveApithe experimental live (bidirectional streaming) API, and@ExperimentalClassifierApithe experimental classifiers in theclassifierspackage.@AdkJavaInteropApimarks builders and bridges for Java callers. Kotlin code uses the constructors with named arguments. When adding an optional field to a public data class, append it at the end, ensure the primary constructor has@JvmOverloads, and implement or update itsBuilderandtoBuilder()(no binary-compatibilitycopy()overload is needed).- Public API must compile at the Kotlin language level set by
kotlinCompatVersionin the rootbuild.gradle.kts.
Development Setup
Build with the Gradle wrapper on JDK 17 or newer (some modules also need JDK 21) with an Android SDK installed. The adk-kotlin-setup skill has the build and test commands and the single-commit, Conventional-Commit PR policy.
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.

