An open-source, code-first .NET toolkit for building, evaluating, and deploying sophisticated AI agents with flexibility and control.
Agent Development Kit (ADK) is designed for developers seeking fine-grained control and flexibility when building advanced AI agents that are tightly integrated with services in Google Cloud. It allows you to define agent behavior, orchestration, and tool use directly in code, enabling robust debugging, versioning, and deployment anywhere – from your laptop to the cloud.
⚠️ EXPERIMENTAL - This project is in active development and the API will change. Builds are nightly and super frequent and may contain breaking changes. Use in production at your own risk.
- ADK Web (development server & UI): Run agents with the embedded dev UI,
REST/WebSocket APIs, Swagger, and optional static file hosting—via
AdkServer.RunAsync, the CLI (GoogleAdk.ApiServer), or your own host. See Running agents. - A2A (client + server): Client types in
src/GoogleAdk.Core/A2a(A2aClient,A2aRemoteAgent, streaming/event helpers) for calling remote agents. Server endpoints viaMapA2aApi()on the API host so your agent speaks the A2A protocol. Enable A2A on the dev server withenableA2a: trueinAdkServer.RunAsyncor the CLI--a2aflag. Details: docs/a2a.md. - Planning: Attach an
IPlannertoLlmAgent(e.g. built-in and ReAct-style planners) with natural-language planning processors in the LLM pipeline. See docs/planning.md. - Prompt / context caching:
ContextCacheConfigon agents and apps, with Gemini-backed implicit caching viaGoogleAdk.Models.GeminiandContextCacheRequestProcessor. See docs/caching.md. - C# tools & source generation: Mark static/instance methods with
[FunctionTool];GoogleAdk.SourceGeneratorsemits partial classes with schema-backedFunctionToolinstances (XML docs required for descriptions). See docs/tools.md. - MCP (Model Context Protocol):
GoogleAdk.Tools.McpprovidesMcpToolsetfor stdio and HTTP MCP servers, dynamic tool discovery, and integration withLlmAgenttoolsets. See docs/mcp.md. - OpenAPI-backed tools: Generate tools from OpenAPI documents with
GoogleAdk.Tools.OpenApi. Sample:samples/GoogleAdk.Samples.OpenApi. - Model backends: Gemini (
GoogleAdk.Models.Gemini) and MEAI (GoogleAdk.Models.Meai) for providers such as Ollama and other MEAI-compatible models. See docs/models.md. - Sessions & persistence: In-memory sessions in core; optional EF Core
session storage in
GoogleAdk.Sessions.EfCore. - State & memory: Session state (scoped keys,
{placeholder}injection in instructions) viaStateandRunnerConfig.InitialState/ dev server defaults; memory viaIBaseMemoryServicewithInMemoryMemoryServiceas the runner default andAgentContexthelpers (AddSessionToMemoryAsync,SearchMemoryAsync, etc.). See docs/state.md and docs/memory.md. - Evaluation & optimization:
GoogleAdk.Evaluation(datasets, inference, LLM-as-judge scoring) andGoogleAdk.Optimizationfor systematic prompt/agent improvement. See docs/evaluation-optimization.md. - Rich built-in tools & Google integrations: Search, maps, Vertex AI Search, Discovery Engine, URL context, code execution, artifacts, sub-agents, human-in-the-loop confirmations, and more—see docs/tools.md and docs/features.md.
- Orchestration & processors:
SequentialAgent,ParallelAgent,LoopAgent, transfer-to-agent, and a configurable LLM request/response processor pipeline (instructions, code execution, output schema, context compaction, etc.). See docs/orchestration.md. - Plugins, telemetry, streaming: Hook lifecycle with plugins, OpenTelemetry-style tracing in the API server, and streaming event flows. See docs/plugins.md, docs/streaming.md.
- Code-First Development: Define agent logic, tools, and orchestration in C# for flexibility, testability, and versioning.
Install the preview package via NuGet:
dotnet add package GoogleAdk --prereleaseFor building, evaluating, and deploying agents, follow the docs and samples:
- In-repo docs (feature guides for this .NET port)
- Samples
//Load env variables like GOOGLE_API_KEY
AdkEnv.Load();
var rootAgent = new LlmAgent(new LlmAgentConfig
{
Name = "search_assistant",
Description = "An assistant that can search the web.",
Model = "gemini-2.5-flash",
Instruction = "You are a helpful assistant. Answer user questions using Google Search when needed. If User asks about weather use the GetWeather tool",
Tools = [new GoogleSearchTool(), GetWeatherDataTool], //GetWeatherDataTool is generated from GetWeatherData in format ADK expect
});
await AdkServer.RunAsync(rootAgent); //creates a webserver that can launch the adk web ui and other endpoints
/// <summary>
/// Fetches the current weather data for a given location.
/// </summary>
/// <param name="location">The location to get the weather for (e.g., 'New York')</param>
/// <returns>A WeatherData object containing the location and forecast</returns>
[FunctionTool]
static WeatherData? GetWeatherData(string location)
{
// trigger recompilation
return new WeatherData(location, "Sunny with a chance of rainbows");
}
public record WeatherData(string Location, string Forecast);
Same as the Python Development UI. A built-in development UI to help you test, evaluate, debug, and showcase your agent(s).
Use GoogleAdk.Evaluation and GoogleAdk.Optimization for eval sets, inference
runs, scoring, and prompt tuning. See
docs/evaluation-optimization.md and sample
GoogleAdk.Samples.EvalOptimize.
Remote agent-to-agent communication uses the
A2A protocol. Client code lives under
src/GoogleAdk.Core/A2a; server wiring is in GoogleAdk.ApiServer (MapA2aApi).
End-to-end coverage is in tests/GoogleAdk.E2e.Tests. See docs/a2a.md.
To set up the project and build it from source, follow these steps:
-
Install dependencies:
dotnet restore "GoogleAdk/GoogleAdk.slnx" -
Build the project:
dotnet build "GoogleAdk/GoogleAdk.slnx"
We welcome contributions from the community! Whether it's bug reports, feature requests, documentation improvements, or code contributions, please see our guidelines:
- General contribution guideline and flow.
- Then if you want to contribute code, please read Code Contributing Guidelines to get started.
Google’s Agent Development Kit (ADK)—the reference product family (for example, the Python ADK), its documentation, and related Google materials—is a copyrighted product of Google LLC and/or its affiliates. Google retains applicable rights in that product and in the ADK and Google trademarks.
This repository is a .NET port: an open-source implementation aligned with ADK-style APIs and patterns. It is not described here as Google’s own first-party, directly Google-copyrighted release of ADK for .NET; copyright in this port belongs to its contributors, who license the code under the Apache License, Version 2.0. See LICENSE.md for the full terms, including how upstream ADK, this port, and trademarks are distinguished.
Use, reproduction, and distribution of this repository are governed by the Apache License, Version 2.0; it does not transfer ownership of Google’s ADK, Google’s trademarks, or third-party materials to you. Third-party components may be subject to separate licenses as noted in the applicable files or notices.
If you contribute code, your contributions may be subject to the contributor license arrangements described in the contribution documentation. Nothing in this README is legal advice or a waiver of Google’s or any third party’s rights except as stated in LICENSE.md and applicable licenses.
Happy Agent Building!
