Getting Started¶
The Agent Development Kit (ADK) for .NET provides foundational components to build, test, and deploy intelligent agents.
Prerequisites¶
- .NET SDK 10.0+
- API Key (e.g., Google AI Studio, Vertex AI)
Authentication¶
Set the required environment variables in a .env file at the root of your project. The ADK automatically loads them via AdkEnv.Load().
Google AI Studio
Vertex AI
GOOGLE_GENAI_USE_VERTEXAI=True
GOOGLE_CLOUD_PROJECT=your_project_id
GOOGLE_CLOUD_LOCATION=us-central1
First Agent in 30 Seconds¶
-
Create a new console app and install the package:
-
Update
Program.cs:
Running the Web UI¶
To test and debug your agents visually, you can use the built-in server:
Learn more about ADK WebCustom Runners¶
For deep integration into production apps, background services, or Discord bots, you can bypass the pre-built runners and construct the core Runner directly:
var runner = new InMemoryRunner("custom-app", agent);
await foreach (var evt in runner.RunAsync("user-1", "session-id", content))
{
// Handle your own streams and events
}