adk-js

googleApache-2.0活跃维护

用 TypeScript 以代码优先方式构建、评估和部署复杂 AI Agent 的开源工具包,让开发者对 Agent 行为保持灵活控制。

An open-source, code-first Typescript toolkit for building, evaluating, and deploying sophisticated AI agents with flexibility and control.

main-v2.4.0发布于 2026-10-28 16:11 UTC1,473star +4 / 7 天248fork同步于 2026-11-10 11:48 UTC

怎么上手

由 README 提炼,执行前请确认
npm install @google/adk
npm install -D @google/adk-devtools
npx @google/adk-devtools run agent.ts
硬件要求按 README 说明

README 未说明硬件要求;仅要求 Node.js 20.19 或更高版本,模型调用依赖 Google AI Studio API Key 或 Vertex AI。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Google 开源的 TypeScript 代码优先 AI Agent 开发工具包,用于构建、评估和部署多智能体系统

用 TypeScript 以代码优先方式构建、评估和部署复杂 AI Agent 的开源工具包,让开发者对 Agent 行为保持灵活控制。

核心能力

  • 用 TypeScript 代码定义 Agent 逻辑、工具与编排,支持 Zod v3/v4 参数校验
  • 同时提供 ESM、CommonJS 和 web 打包,可在 Node.js 或浏览器中运行
  • 内置 Google Search、Google Maps、Vertex AI Search 等工具,可接入 MCP 服务器
  • 支持顺序、并行、循环、路由多智能体编排,并通过 A2A 协议调用远程 Agent
  • 提供 adk create/run/web/deploy 等 CLI 命令与交互式开发调试 UI

容易踩的坑

需 Node.js 20.19 及以上版本;运行前要在 agent 目录的 .env 中配置 GOOGLE_GENAI_API_KEY,或改用 Vertex AI 相关环境变量;用 npx 时必须写全 @google/adk-devtools,否则会静默下载并运行无关的 adk 包。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本main-v2.4.0
  1. integrations-v2.4.0integrations: v2.4.02026-10-28 · 2026-10-28 16:11 UTC
    查看更新说明

    2.4.0 (2026-10-28)

    Features

    • integrations: add the Claude model on Vertex AI (#1125) (f882b34)

    Bug Fixes

    • integrations: honor maxOutputTokens, set finishReason and sanitize tool ids on Claude (#1139) (cfb4764)

    Dependencies

    • The following workspace dependencies were updated
      • dependencies
        • @google/adk bumped from ^2.3.0 to ^2.4.0
  2. devtools-v2.4.0devtools: v2.4.02026-10-28 · 2026-10-28 16:11 UTC
    查看更新说明

    2.4.0 (2026-10-28)

    Features

    • dev: serve a sample's README.md to the web UI (#853) (a10c58e)
    • devtools: export version from the @google/adk-devtools entry point (#1098) (adc9b61)
    • port adk-python v0.3.0 changes to agents, auth, cli (+6 more) (#1091) (0eb3ac5)

    Bug Fixes

    • cli: pin the generated Dockerfile to Node 24 (#1075) (ccaee44)
    • deploy: stop double-bundling the deployed agent in agent_engine/cloud_run images (#909) (0713105)
    • deploy: stop echoing the rejected value in the Dockerfile newline error (#1096) (be51de9)
    • dev: import Client from the @google-cloud/vertexai root in the Agent Engine deploy CLI (#1056) (afb7aca)
    • dev: preserve workflow node names in bundled agents (#1149) (2a65dc1)
    • dev: stop logging request headers and bodies on /api/reasoning_engine (#1163) (3a7af47)
    • preserve server-managed deployment spec fields on agent_engine update (#1159) (0515f7c)
    • resolve the exit_loop built-in tool in YAML agent configs (#572) (fa62265)
    • resolve Windows CI port-exclusion EACCES and temp-dir EBUSY failures (#1071) (ecfe257)

    Dependencies

    • The following workspace dependencies were updated
      • dependencies
        • @google/adk bumped from ^2.3.0 to ^2.4.0
  3. adk-v2.4.0adk: v2.4.02026-10-28 · 2026-10-28 16:11 UTC
    查看更新说明

    2.4.0 (2026-10-28)

    Features

    • agents: port adk-python v0.5.0 changes to agents (#1104) (0b905df)
    • agents: port adk-python v1.0.0 changes to agents (#1109) (c33d2de)
    • cli: port adk-python v1.0.0 changes to cli (#1123) (bb9a49a)
    • Ergonomic TypeScript client for remote Vertex AI Agent Engine (#522) (0f28dc9)
    • port adk-python v0.2.0 changes to agents, auth, events (+7 more) (#1080) (c5578bb)
    • port adk-python v0.3.0 changes to agents, auth, cli (+6 more) (#1091) (0eb3ac5)
    • port adk-python v0.4.0 changes to agents, events, tools/openapi_tool (#1100) (218b77f)
    • port adk-python v0.5.0 changes to artifacts, auth, events (+7 more) (#1102) (593c451)
    • port adk-python v1.0.0 changes to examples, runners, tools/apihub_tool (+1 more) (#1112) (687a201)
    • skills: throw typed errors from the skill loader (#1129) (d3bf84d)
    • tools: port adk-python v0.2.0 changes to tools/google_api_tool (#1079) (3cab273)
    • tools: port adk-python v0.3.0 changes to tools/application_integration_tool (#1099) (7e8880a)
    • tools: port adk-python v0.3.0 changes to tools/openapi_tool (#1093) (a0a04cc)
    • tools: port adk-python v1.0.0 changes to tools (#1108) (f9ffb18)
    • tools: port adk-python v1.0.0 changes to tools/application_integration_tool (#1122) (70944fe)
    • tools: port adk-python v1.0.0 changes to tools/google_api_tool (#1113) (53d885e)

    Bug Fixes

  4. main-v2.4.0main: v2.4.0最新正式版2026-10-28 · 2026-10-28 16:11 UTC

    2.4.0 (2026-10-28)

    Features

    • agents: port adk-python v0.5.0 changes to agents (#1104) (0b905df)
    • agents: port adk-python v1.0.0 changes to agents (#1109) (c33d2de)
    • cli: port adk-python v1.0.0 changes to cli (#1123) (bb9a49a)
    • dev: serve a sample's README.md to the web UI (#853) (a10c58e)
    • devtools: export version from the @google/adk-devtools entry point (#1098) (adc9b61)
    • Ergonomic TypeScript client for remote Vertex AI Agent Engine (#522) (0f28dc9)
    • integrations: add the Claude model on Vertex AI (#1125) (f882b34)
    • port adk-python v0.2.0 changes to agents, auth, events (+7 more) (#1080) (c5578bb)
    • port adk-python v0.3.0 changes to agents, auth, cli (+6 more) (#1091) (0eb3ac5)
    • port adk-python v0.4.0 changes to agents, events, tools/openapi_tool (#1100) (218b77f)
    • port adk-python v0.5.0 changes to artifacts, auth, events (+7 more) (#1102) (593c451)
    • port adk-python v1.0.0 changes to examples, runners, tools/apihub_tool (+1 more) (#1112) (687a201)
    • skills: throw typed errors from the skill loader (#1129) (d3bf84d)
    • tools: port adk-python v0.2.0 changes to tools/google_api_tool (#1079) (3cab273)
    • tools: port adk-python v0.3.0 changes to tools/application_integration_tool (#1099) (7e8880a)
    • tools: port adk-python v0.3.0 changes to tools/openapi_tool (#1093) (a0a04cc)
    • tools: port adk-python v1.0.0 changes to tools (#1108) (f9ffb18)
    • tools: port adk-python v1.0.0 changes to tools/application_integration_tool (#1122) (70944fe)
    • tools: port adk-python v1.
  5. main-v2.3.0main: v2.3.02026-10-13 · 2026-10-13 20:04 UTC
    查看更新说明

    2.3.0 (2026-10-13)

    Features

    • agents: port agents features from adk-python (#1070) (31a56e8)
    • auth: bring auth to parity with adk-python v0.1.0 (#1013) (4cefafc)
    • cli: bring cli to parity with adk-python v0.1.0 (#1049) (ecb6bd1)
    • dev: accept customMetadata on the API server run endpoints (#964) (b3e3d2f)
    • events: reserve _adk_internal customMetadata keys for ADK (adk-python parity) (#977) (2dc6f47)
    • flows: bring flows to parity with adk-python v0.1.0 (#1048) (94b547b)
    • models: bring models to parity with adk-python v0.1.0 (Scott's foundry impl with task generation pipeline and one task for subsystem) (#981) (03206c8)
    • plugins: add DebugLoggingPlugin with full Python parity (#920) (6482917)
    • plugins: add ToolCallIntegrityPlugin (adk-python parity) (#979) (d7b6f04)
    • runner: add opt-in autoCreateSession (adk-python parity) (#967) (5ad45af)
    • runners: bring runners to parity with adk-python v0.1.0 (#1007) (22f3bf9)
    • samples: add a rerunOnResume human-input workflow sample (#973) (d5d130d)
    • sessions: bring sessions to parity with adk-python v0.1.0 (#1004) (a4e3cb5)
    • telemetry: bring telemetry to parity with adk-python v0.1.0 (#963) (4395fad)
    • tools: bring apihub_tool to parity with adk-python v0.1.0 (#1015) (0e78193)
    • tools: bring application_integration_tool to parity with adk-python v0.1.0 (#1016) (d315993)
    • tools: bring google_api_tool to parity with adk-python v0.1.0 (#1014) (ef1b383)
    • tools: bring mcp_tool to parity with adk-python v0.1.0 (#1047) ([6362192](https://github.com/google/adk-js/commit/63621924f009acd6421fce03

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Agent Development Kit (ADK) for TypeScript

    License NPM Version r/agentdevelopmentkit


    Agent Development Kit (ADK) is a flexible and modular framework for building, deploying, and orchestrating AI agent workflows, from simple tasks to complex multi-agent systems. Define agent behavior, orchestration, and tool use directly in code, enabling robust debugging, versioning, and deployment anywhere.

    The TypeScript version of ADK is built for the Node.js and browser ecosystems, with full type safety, Zod schema validation, and support for ESM, CommonJS, and web runtimes.

    ✨ Key Features

    • Code-First TypeScript: Define agent logic, tools, and orchestration with full type safety. Tool parameters support Zod v3 and v4 schemas with compile-time type inference.

    • Browser and Server: Ships ESM, CommonJS, and web bundles. Run agents in Node.js or directly in the browser.

    • Rich Tool Ecosystem: Built-in tools for Google Search, Google Maps, Vertex AI Search, and URL context. Connect MCP servers, wrap any function as a tool, or add code execution.

    • Multi-Agent Orchestration: Compose agents into sequential, parallel, loop, and routed workflows. Delegate to remote agents via the A2A protocol.

    • Dev Tools and CLI: Interactive dev UI for testing and debugging. CLI commands for scaffolding (adk create), local testing (adk run, adk web), and deployment (adk deploy cloud_run).

    🚀 Installation

    Prerequisite: ADK for TypeScript requires Node.js 20.19 or newer.

    npm install @google/adk
    npm install -D @google/adk-devtools
    

    Or with yarn:

    yarn add @google/adk
    yarn add -D @google/adk-devtools
    

    This installs the core SDK and the dev tools (CLI and dev UI) as a dev dependency.

    Quick Start

    Set up authentication. Get an API key from Google AI Studio and put it in a .env file next to your agent:

    echo "GOOGLE_GENAI_API_KEY=your-api-key-here" > .env
    

    Using Vertex AI instead? Set GOOGLE_GENAI_USE_VERTEXAI=1, GOOGLE_CLOUD_PROJECT, and GOOGLE_CLOUD_LOCATION in place of the API key, and authenticate with gcloud auth application-default login.

    Define an agent in agent.ts:

    import {LlmAgent, GOOGLE_SEARCH} from '@google/adk';
    
    export const rootAgent = new LlmAgent({
      name: 'search_assistant',
      description: 'An assistant that can search the web.',
      model: 'gemini-flash-latest',
      instruction:
        'You are a helpful assistant. Answer user questions using Google Search when needed.',
      tools: [GOOGLE_SEARCH],
    });
    

    Run from your agent project directory:

    # Interactive CLI
    npx @google/adk-devtools run agent.ts
    
    # Web UI
    npx @google/adk-devtools web
    

    Always name the package. If @google/adk-devtools is not installed, bare npx adk silently downloads and runs an unrelated adk package from the public registry.

    The adk web command launches a development UI for testing and debugging agents:

    📚 Documentation

    🤝 Contributing

    We welcome contributions from the community! Whether it's bug reports, feature requests, documentation improvements, or code contributions, please see the contributing guide and CONTRIBUTING.md to get started.

    📄 License

    This project is licensed under the Apache 2.0 License - see the LICENSE file for details.