adk_dart 2026.2.28 copy "adk_dart: ^2026.2.28" to clipboard
adk_dart: ^2026.2.28 copied to clipboard

Core Dart port of Agent Development Kit (ADK) runtime primitives.

Agent Development Kit (ADK) for Dart #

License pub package Package Sync

ADK Dart is an open-source, code-first Dart framework for building and running AI agents with modular runtime primitives, tool orchestration, and MCP integration.

It is a Dart port of ADK concepts with a focus on practical runtime parity and developer ergonomics.


๐Ÿ”ฅ What's New #

  • MCP Protocol Core Package: Added packages/adk_mcp and moved MCP streamable HTTP protocol handling into a dedicated package.
  • MCP Spec Hardening: Improved MCP lifecycle and transport behavior (session recovery, SSE response matching by request id, cancellation notifications, capability-aware RPC usage).
  • Parity Expansion: Added broader runtime parity coverage across sessions, toolsets, and model/tool integration layers in the 0.1.x line.

โœจ Key Features #

  • Code-First Agent Runtime: Build agents with BaseAgent, LlmAgent (Agent alias), and explicit invocation/session context objects.
  • Event-Driven Execution: Run agents asynchronously with Runner / InMemoryRunner and stream Event outputs.
  • Multi-Agent Composition: Compose agent hierarchies with subAgents and orchestrate specialized workflows.
  • Tooling Ecosystem: Use function tools, OpenAPI tools, Google API toolsets, data tools (BigQuery/Bigtable/Spanner), and MCP toolsets.
  • MCP Integration: Connect to remote MCP servers through streamable HTTP using McpToolset and McpSessionManager (backed by adk_mcp).
  • Developer CLI + Web UI: Scaffold projects and run chat/dev server with the adk CLI (create, run, web, api_server).

๐Ÿš€ Installation #

dart pub add adk_dart

If you prefer a shorter import path, use the facade package:

dart pub add adk

Development Version #

Use a git dependency in your pubspec.yaml:

dependencies:
  adk_dart:
    git:
      url: https://github.com/adk-labs/adk_dart.git
      ref: main

Then:

dart pub get

๐Ÿค– MCP (Model Context Protocol) #

ADK Dart includes MCP support and now ships protocol primitives as a dedicated package:

  • packages/adk_mcp: MCP transport/lifecycle core for Dart
  • adk_dart MCP layer: ADK tool/runtime integration (McpToolset, McpSessionManager, LoadMcpResourceTool, McpInstructionProvider)

For most users, importing package:adk_dart/adk_dart.dart is sufficient.

๐Ÿ“š Documentation #

  • Repository: https://github.com/adk-labs/adk_dart
  • API surface entrypoint: lib/adk_dart.dart
  • Parity status tracker: python_parity_status.md
  • Parity manifest: python_to_dart_parity_manifest.md

๐Ÿ Feature Highlight #

Define a single agent #

import 'package:adk_dart/adk_dart.dart';

class EchoModel extends BaseLlm {
  EchoModel() : super(model: 'echo');

  @override
  Stream<LlmResponse> generateContent(
    LlmRequest request, {
    bool stream = false,
  }) async* {
    final String userText = request.contents.isEmpty
        ? ''
        : request.contents.last.parts
              .where((Part part) => part.text != null)
              .map((Part part) => part.text!)
              .join(' ');

    yield LlmResponse(content: Content.modelText('echo: $userText'));
  }
}

Future<void> main() async {
  final Agent agent = Agent(name: 'echo_agent', model: EchoModel());
  final InMemoryRunner runner = InMemoryRunner(agent: agent);

  final Session session = await runner.sessionService.createSession(
    appName: runner.appName,
    userId: 'user_1',
    sessionId: 'session_1',
  );

  await for (final Event event in runner.runAsync(
    userId: 'user_1',
    sessionId: session.id,
    newMessage: Content.userText('hello'),
  )) {
    print(event.content?.parts.first.text ?? '');
  }
}

Define a multi-agent system #

import 'package:adk_dart/adk_dart.dart';

class StubModel extends BaseLlm {
  StubModel() : super(model: 'stub');

  @override
  Stream<LlmResponse> generateContent(
    LlmRequest request, {
    bool stream = false,
  }) async* {
    yield LlmResponse(content: Content.modelText('done'));
  }
}

void main() {
  final Agent greeter = Agent(
    name: 'greeter',
    model: StubModel(),
    instruction: 'Handle greetings.',
  );

  final Agent worker = Agent(
    name: 'worker',
    model: StubModel(),
    instruction: 'Handle execution tasks.',
  );

  final Agent coordinator = Agent(
    name: 'coordinator',
    model: StubModel(),
    instruction: 'Route requests to sub-agents.',
    subAgents: <BaseAgent>[greeter, worker],
  );

  // Use coordinator with Runner / InMemoryRunner.
  print(coordinator.name);
}

Development CLI and Web UI #

dart pub global activate adk_dart
adk create my_agent
adk run my_agent
adk web --port 8000 my_agent

adk web starts a local development server and UI at http://127.0.0.1:8000.

๐Ÿงช Test #

dart test
dart analyze

๐Ÿค Contributing #

Issues and pull requests are welcome:

๐Ÿ“„ License #

This project is licensed under Apache 2.0. See LICENSE.

1
likes
0
points
232
downloads

Publisher

unverified uploader

Weekly Downloads

Core Dart port of Agent Development Kit (ADK) runtime primitives.

Repository (GitHub)
View/report issues

Topics

#adk #ai #llm #agents #multi-agent

License

unknown (license)

Dependencies

adk_mcp, google_generative_ai, http

More

Packages that depend on adk_dart