ADK Ex
Elixir/OTP port of Google's Agent Development Kit (ADK). Provides agent orchestration, session management, tool use, LLM abstraction, memory, artifacts, and telemetry.
Features
- Agent types: LLM agents, Sequential, Parallel, Loop, and Custom agents
- Tool system: Function tools, agent transfer, memory search, artifact loading
- Multi-LLM: Gemini and Claude providers via REST API, extensible via behaviour
- Session management: Prefix-scoped state (session/app/user/temp) with GenServer + ETS
- Memory service: Cross-session knowledge with word-based search
- Artifact service: Versioned file storage with user-scoped sharing
- Telemetry: Dual OpenTelemetry spans + Elixir
:telemetryevents - Orchestration: Multi-agent workflows with agent transfer, escalation, and branch isolation
Installation
Add adk_ex to your list of dependencies in mix.exs:
def deps do
[
{:adk_ex, "~> 0.2"}
]
end
For database-backed session persistence, add the separate adk_ex_ecto package.
Quick Example
# Define a tool
tool = ADK.Tool.FunctionTool.new(
name: "get_weather",
description: "Get weather for a city",
handler: fn _ctx, %{"city" => city} ->
{:ok, %{"weather" => "Sunny in #{city}"}}
end
)
# Create an LLM agent
agent = %ADK.Agent.LlmAgent{
name: "weather-agent",
model: ADK.Model.Registry.resolve("gemini-2.0-flash"),
instruction: "You are a helpful weather assistant.",
tools: [tool]
}
# Run
{:ok, runner} = ADK.Runner.new(
app_name: "my-app",
root_agent: agent,
session_service: my_session_service
)
events =
runner
|> ADK.Runner.run("user-1", "session-1", ADK.Types.Content.new_from_text("user", "What's the weather in Paris?"))
|> Enum.to_list()Documentation
- HexDocs
- Google ADK Docs (reference)
- Architecture
Related Packages
a2a_ex— A2A (Agent-to-Agent) protocol for Elixir, depends on this package
LLM Usage Rules
This package ships usage rules for LLM-assisted development. Add to your app's mix.exs:
# In project/0:
usage_rules: [file: "AGENTS.md", usage_rules: [:adk_ex]]
# In deps:
{:usage_rules, "~> 1.2", only: :dev}
Then run mix usage_rules.sync to pull ADK conventions into your AGENTS.md / CLAUDE.md.
License
MIT — see LICENSE for details.