Loading repository data…
Loading repository data…
sps014 / repository
An open-source, code-first C# (Dotnet) toolkit for building, evaluating, and deploying sophisticated AI agents with flexibility and control.
The Agent Development Kit (ADK) is a code-first toolkit for building AI agents in .NET. It lets you define agent behavior, orchestration, and tools directly in C#, integrating closely with Google Cloud services.
⚠️ EXPERIMENTAL - This project is in active development. The API is subject to change.
For guides, API references, and feature details, see the documentation.
dotnet add package GoogleAdk --prerelease
LlmAgent with tool use, instructions, streaming, and structured output.SequentialAgent, ParallelAgent, and LoopAgent for multi-step workflows.[FunctionTool] attribute.OpenAPIToolset.SKILL.md, references/, assets/, scripts/) via SkillToolset and SkillLoader.LoadFromDirectory.gemini-2.5-flash-preview-tts.// Load env variables like GOOGLE_API_KEY
AdkEnv.Load();
var rootAgent = new LlmAgent(new()
{
Name = "weather_assistant",
Description = "An assistant that provides weather data.",
Model = "gemini-2.5-flash",
Instruction = "You are a helpful assistant. If the user asks about weather, use the GetWeatherData tool to provide the forecast.",
Tools = [GetWeatherDataTool]
});
// Creates a webserver that can launch the ADK web UI and other endpoints
await AdkServer.RunAsync(rootAgent);
// await ConsoleRunner.RunAsync(rootAgent); // For CLI usage
/// <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)
{
return new WeatherData(location, "Sunny with a chance of rainbows");
}
public record WeatherData(string Location, string Forecast);
A built-in development UI to test, evaluate, and debug your agents.
Runnable samples cover MCP, A2A, orchestration, skills, evaluation, plugins, audio, and more. See samples/README.md for the full index.
cd samples/GoogleAdk.Samples.GoogleSearch
cp .env.example .env # then edit .env and set GOOGLE_API_KEY
dotnet run
Prerequisites: .NET SDK 10.0+.
git clone https://github.com/sps014/GoogleAdk-cs.git
cd GoogleAdk-cs
dotnet build GoogleAdk.slnx
dotnet test GoogleAdk.slnx
Package versions are managed centrally in Directory.Packages.props, and shared build settings are in Directory.Build.props.
See our guidelines:
Google’s Agent Development Kit (ADK) is a copyrighted product of Google LLC. 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 Google’s first-party 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 full terms.
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.