agentleFS
GoogleKnown publishergoogle/adk-kotlin/AGENTS.md

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…

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
  1. Distinctive:

    Keep these when changing the runtime:

    line 32
  2. Distinctive:

    Only non-partial events are persisted.

    line 35
  3. Very specific:

    Don't choose a dispatcher on the agent, model or tool path.

    line 37

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 per runAsync call and returns a Flow<Event>.
  • Tool (BaseTool, FunctionTool, @Tool via 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/:

SkillUse it for
adk-kotlin-setupAdding ADK to a project, KSP wiring for @Tool, building and testing this repository, source-set placement, PR rules
adk-kotlin-agent-builderWriting 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:

  • runAsync returns a cold Flow: 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.
  • internal and @FrameworkInternalApi symbols are not public API. @ExperimentalWorkflowApi marks the experimental graph workflow in the workflow package, @ExperimentalLiveApi the experimental live (bidirectional streaming) API, and @ExperimentalClassifierApi the experimental classifiers in the classifiers package.
  • @AdkJavaInteropApi marks 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 its Builder and toBuilder() (no binary-compatibility copy() overload is needed).
  • Public API must compile at the Kotlin language level set by kotlinCompatVersion in the root build.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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.