adk-python

googleApache-2.0活跃维护

用 Python 以代码优先的方式构建、评测和部署复杂 AI Agent 的开源工具包,让开发者对 Agent 行为有更强的灵活性和控制力。

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

v2.14.0发布于 2026-11-07 00:58 UTC22,167star +30 / 7 天4,328fork同步于 2026-11-10 05:22 UTC

怎么上手

由 README 提炼,执行前请确认
pip install google-adk
硬件要求按 README 说明

README 未说明

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

项目说明

由 README 自动翻译提炼

Google 开源的代码优先 Python 框架,用来构建、评估和部署 AI Agent

用 Python 以代码优先的方式构建、评测和部署复杂 AI Agent 的开源工具包,让开发者对 Agent 行为有更强的灵活性和控制力。

核心能力

  • 用图结构 Workflow 编排路由、扇出扇入、循环与重试
  • Task API 支持多轮任务委派与单轮受控输出
  • 组合多个专用 Agent 成层级式多智能体系统
  • 接入预置工具、自定义函数、OpenAPI 与 MCP 工具
  • 内置 adk web 开发 UI 用于测试、评估和调试

容易踩的坑

需要 Python 3.11 及以上版本;默认示例模型为 Gemini,需自行准备模型访问凭据;可选集成需额外安装 google-adk[extensions]

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README
这个条目还没有人工点评。如果它对你很有用,欢迎到 提交仓库 页写下你的使用经验。

用户点评

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

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

    最近发版

    5 个版本v2.14.0
    1. v2.14.0最新正式版2026-11-07 · 2026-11-07 00:58 UTC

      2.14.0 (2026-11-04)

      Highlights

      This release graduates execution environments, A2A, evaluation, and core runtime modules from experimental, adds multi-run evaluation and semantic tool argument matching, adds Microsoft Teams and OpenAI Decisions integrations, and makes long multi-turn workflows faster.

      • Execution environments and sandboxes:
        • BaseEnvironment, LocalEnvironment, EnvironmentToolset, DaytonaEnvironment, and E2BEnvironment are now stable. (c54b253, 799fc94)
        • BaseEnvironment.read_file_stream streams files in chunks across LocalEnvironment, E2BEnvironment, and DaytonaEnvironment so ReadFileTool reads line ranges without loading the whole file into memory. See the unit guide for more details. (fd8d8c1)
        • AgentEngineEnvironment reads and writes large files in chunks and reports commands over 570 seconds as timed out before the service deadline. See the unit guide and sample for more details. (4c88040, 5843c58, b13fa19, d3a199d)
        • ContainerCodeExecutor supports input and output files, and RunSkillScriptTool runs skill scripts from validated paths and arguments instead of a shell command string. (effd641, ff61524)
      • Evaluation:
        • MultiRunConfig (adk eval --num_runs) and --parallelism run each eval case multiple times concurrently and combine scores or pass rates across runs. See the eval config and agent evaluator guides for more details. (7f3517e, e9e8f61)
        • AgentEvaluator accepts a BaseNode or App built at runtime, and --eval_storage_uri stores eval files outside a read-only agents_dir. (ce92e92, ff66b1f)
        • ToolArgsMatcher compares tool call arguments in evaluations and EnvironmentSimulation using exact, case-insensitive, numeric-tolerance, or LLM-backed semantic checks. See the unit guide for more details. (ed76f94, 08c289b)
      • A2A: The A2A integration is now stable, and adk generate_agent_card builds an A2A agent card from the CLI. See the [unit guid
    2. v2.13.02026-10-23 · 2026-10-23 18:08 UTC
      查看更新说明

      2.13.0 (2026-10-22)

      Highlights

      This release stabilizes core features while introducing TypeSafe workflow classification, live audio interactions, MongoDB integrations, and execution performance improvements.

      • Stability: Access 12 mature experimental features now promoted to stable status. See the unit guide for more details. (ea298d4)
      • Classifiers: Route workflows with TypeSafe's Jev models via the new TypesafeClassifier and ClassifierNode. Jev returns calibrated probabilities in a single forward pass, much faster than an LLM. See the unit guide for more details. (ddf8c55, e8c4bac)
      • Live Audio: Enable natural real-time voice interactions with barge-in support alongside Gemini speech-to-text and text-to-speech integration. See the unit guide for more details. (2e7ef92)
      • MongoDB Sessions & Memory: Persist sessions in MongoDB and share them across runner replicas with the new MongoDbSessionService. Add long-term memory without an embedding model using MongoDbMemoryService, which recalls past turns by keyword match on any MongoDB deployment, with no vector index needed. Both are experimental. See the session service and memory service guides for more details. (0df43f5, e40e349)
      • MongoDB: Deploy MongoDbToolset to Agent Engine without packaging your connection string, and let Atlas Automated Embedding embed search queries server-side, with no Google embedding call or credentials needed. See the unit guide for more details. (bc3773f, 2f6c666, 8bbfc33)
      • Performance: Enjoy up to 8x faster execution turns for string-model agents and reduced event-loading overhead. (772f139)
      Breaking changes
      • Telemetry: Defaults to OpenTelemetry GenAI v2 (otel_semconv_1_44, removing call_llm); set ADK_TELEMETRY_SCHEMA_VERSION_OPT_IN=otel_semconv_1_36 to keep the legacy v1 schema. See the unit guide for more details. (7838488)

      ⚠ BREAKING CHANGES

      • telemetry: deprecate call_llm span and OpenTelemetry 1.36 GenAI semconv

      Features

    3. v2.12.02026-10-13 · 2026-10-13 16:35 UTC
      查看更新说明

      2.12.0 (2026-10-13)

      Highlights

      This release enhances execution performance in long sessions while introducing finer control over tool execution, workflow approvals, and deployment security.

      • Performance: Cut time to first model request by 40% in long sessions. (1754b3e)
      • Tools: Intercept and filter tool outputs before returning them to the model using after_tool_callback. (fdda17c)
      • Workflows: Require human confirmation before executing workflow nodes via require_confirmation. (988fd1a)
      • Deployment: Deploy agents to Agent Engine using dedicated custom service accounts. (629e119)
      • Python 3.15: Install and run ADK on Python 3.15. (75aef1e)

      Features

      • add --state_file option to adk run (c390266), closes #7083
      • add after_tool_callback to screen tool output (fdda17c), closes #6966
      • add skill-level security support to AgentCardBuilder (79a7e49)
      • agents: adapt BaseNode in tool consumers and preserve ToolUnion compatibility (8350c14)
      • antigravity: preserve model thinking parts, client tool responses, and sub-agent hierarchy in ADK events (fac77be)
      • cli: source the agent builder assistant's ADK knowledge from the installed package (ab9fffc)
      • continue with de-identified text when only SDP matched (315c3dd), closes #7369
      • encrypt google credential in session (42a17a9)
      • eval: report the efficiency metrics for evals run from the Dev UI (49bf291)
      • install lightweight Gemini Enterprise (Agent Platform) SDK without the GAPIC stack (d92735d)
      • live: add an internal model for Live background tool calls (3f25ab5)
      • live: implement CascadeLive model & sample (128faab)
      • migrate ADK to google-cloud-aiplatform v2.2 (agentplatform) (77d4dcd)
      • migrate VertexAiExampleStore and VertexAiRagRetrieval away from vertexai.preview (9e411be)
      • persist skill-script outputs as artifacts (beaef0d), closes #5579

    4. v2.11.02026-10-02 · 2026-10-02 00:44 UTC
      查看更新说明

      2.11.0 (2026-10-01)

      Highlights

      This release adds graceful cancellation and tool confirmation to workflows, a tool for consulting another model mid-task, and a built-in SQLite memory service.

      • Execution cancellation: Pass an abort_signal to Runner, Workflow, and nodes to stop a run gracefully; /run_sse now cancels the run when the client disconnects. See the unit guide for more details. (ef5bbcf, 3d73603)
      • Tool confirmation in workflows: Tool nodes now pause for user approval via RequestInput, the same way an LlmAgent does, instead of passing an error downstream. (ce132b9)
      • ModelConsultTool: Let an agent consult another model mid-task, capped by per-turn and per-session budgets. See the unit guide for more details. (84cc99a)
      • SQLite memory service: Keep agent memory in a local SQLite database, selected with a sqlite:// memory service URI. (9625b06)
      • MCP SDK 2.x: Connect to MCP servers over the modern protocol through a new opt-in path. (e738c26)

      Features

      • add a sample preloading memory profiles into the instruction (fdf1b7f)
      • add avatar configuration to server commands (e4c0d94), closes #5435
      • add max llm calls to server commands (14f4154), closes #5434
      • add optional abort_signal support to Runner, Workflow, and Nodes (ef5bbcf), closes #4796
      • add pagination to list_accessible_data_agents in data_agent toolset (46d5a2d)
      • add sqlite memory service (9625b06)
      • add the model consult session context handover layer (b2da4c6)
      • cli: wire abort_signal to /run_sse on client disconnect (3d73603)
      • default Vertex project from GCP metadata (8d8bbd2)
      • events: add internal metadata for ADK events (8e29f16)
      • honor tool_thread_pool_config for sync tools outside live mode (c50ade3)
      • let BigQuery tools run where CMEK is required (4d06641), closes #3931
      • live: default to a pre-built avatar for VIDEO live sessions (
    5. v2.10.02026-09-25 · 2026-09-25 19:00 UTC
      查看更新说明

      2.10.0 (2026-09-24)

      Highlights

      This release introduces advanced skill lifecycle management, expands database and model integration support, and brings richer efficiency metrics to agent evaluation.

      • Skills: Control resource usage and tool persistence dynamically using new ephemeral lifecycles and active skill limits (experimental; enable with ADK_ENABLE_SKILL_LIFECYCLE=1). (43b73e4)
      • Database Integrations: Perform high-performance vector and hybrid searches seamlessly within your agent flows with the new MongoDB toolset. (0961ced)
      • Evaluation: Optimize agent execution costs and latency with new evaluation metrics for tracking duration, token consumption, and model call counts. (2d428ea)
      • Model Support: Integrate OpenAI reasoning models more effectively with automated request parameter adaptation and precise reasoning token reporting. (52a2f0f)
      Behavior changes
      • BigQuery protected write mode now runs a non-SELECT statement only when the dry run places it in the session's anonymous dataset, so multi-statement scripts, CALL, EXPORT DATA and other statements the dry run gives no destination are rejected. (8b883d0)
      • BigQuery protected mode keeps its BigQuery session in process memory instead of session state, so its temporary tables do not survive a restart or carry over to another replica. (094012b)
      • OpenAIResponsesLlm ignores thinking_config (thinking_level / thinking_budget) with a warning; use OpenAIGenerateContentConfig.effort instead. (b3d1392)
      • AgentEvaluator.evaluate and evaluate_eval_set raise ValueError when no eval cases are evaluated, instead of passing. (9dbc2ae)
      • Instruction templating leaves ${var} and backslash-escaped \{var} as written instead of filling them from state. (0caecd2)
      • Legacy live-audio modules under google.adk.flows.llm_flows (audio_cache_manager, audio_transcriber, transcription_manager) emit a DeprecationWarning on import; move to google.adk.live. Test suites run with -W error will fail on these imports. (bf2bc56)

      Features

      • add a duration efficiency metric to ADK eval (49e7264)
      • add an EPHEMERAL skill lifecycle that lasts one turn (experimental, off by default; enable with ADK_ENABLE_SKILL_LIFECYCLE=1) (f938abd)
      • add an opt-in unload_skill tool to SkillToolset (experimental, off by default; enable with ADK_ENABLE_SKILL_LIFECYCLE=1) (ce53a36)
      • add dev-only deploy endpoints for Agent Runtime, Cloud Run, and GKE (1235104)
      • add informational efficiency metrics (tokens, calls) to ADK eval ([2d428ea](https://github.com/google/adk-python/commit/2d428ead3860fbc131de362b485e

    README 原文

    未翻译

    Agent Development Kit (ADK) 2.0

    License PyPI version Python versions PyPI downloads Continuous Integration Docs r/agentdevelopmentkit

    Agent Development Kit (ADK) is a flexible and modular framework that applies software development principles to AI agent creation. It is designed to simplify building, deploying, and orchestrating agent workflows, from simple tasks to complex systems. While optimized for Gemini, ADK is model-agnostic, deployment-agnostic, and compatible with other frameworks.

    ✨ Key Features

    • Workflow Runtime: A graph-based execution engine for composing deterministic execution flows for agentic apps, with support for routing, fan-out/fan-in, loops, retry, state management, dynamic nodes, human-in-the-loop, and nested workflows.

    • Task API: Structured agent-to-agent delegation with multi-turn task mode, single-turn controlled output, mixed delegation patterns, human-in-the-loop, and task agents as workflow nodes.

    • Modular Multi-Agent Systems: Design scalable applications by composing multiple specialized agents into flexible hierarchies.

    • Rich Tool Ecosystem: Utilize pre-built tools, custom functions, OpenAPI specs, MCP tools or integrate existing tools to give agents diverse capabilities, all for tight integration with the Google ecosystem.

    • Code-First Development: Define agent logic, tools, and orchestration directly in Python for ultimate flexibility, testability, and versioning.

    • Agent Config: Build agents without code. Check out the Agent Config feature.

    • Tool Confirmation: A tool confirmation flow (HITL) that can guard tool execution with explicit confirmation and custom input.

    • Deploy Anywhere: Easily containerize and deploy agents on Cloud Run or scale seamlessly with Vertex AI Agent Engine.

    🚀 Installation

    Stable Release (Recommended)

    You can install the latest stable version of ADK using pip:

    pip install google-adk
    

    Requirements: Python 3.11+.

    For transitive dependency protection, we recommend installing with our companion constraints files (for python 3.11 to 3.15).

    Choose the constraints file matching your Python version:

    # For example, for Python 3.11
    curl -o constraints-3.11.txt https://raw.githubusercontent.com/google/adk-python/main/constraints-3.11.txt
    pip install google-adk -c constraints-3.11.txt
    rm constraints-3.11.txt
    

    To install optional integrations, you can use the following command:

    pip install "google-adk[extensions]"
    

    The release cadence is roughly bi-weekly.

    Development Version

    Bug fixes and new features are merged into the main branch on GitHub first. If you need access to changes that haven't been included in an official PyPI release yet, you can install directly from the main branch:

    pip install git+https://github.com/google/adk-python.git@main
    

    Note: The development version is built directly from the latest code commits. While it includes the newest fixes and features, it may also contain experimental changes or bugs not present in the stable release. Use it primarily for testing upcoming changes or accessing critical fixes before they are officially released.

    Quick Start

    Beginner Note: ADK applications are built using two main classes: Agent (defines an AI's instructions, tools, and behavior) and Workflow (orchestrates agents and tasks in a graph-based flow).

    Agent

    from google.adk import Agent
    
    root_agent = Agent(
        name="greeting_agent",
        model="gemini-3.5-flash",
        instruction="You are a helpful assistant. Greet the user warmly.",
    )
    

    Workflow

    from google.adk import Agent, Workflow
    
    generate_fruit_agent = Agent(
        name="generate_fruit_agent",
        instruction="Return the name of a random fruit. Return only the name.",
    )
    
    generate_benefit_agent = Agent(
        name="generate_benefit_agent",
        instruction="Tell me a health benefit about the specified fruit.",
    )
    
    root_agent = Workflow(
        name="root_agent",
        edges=[("START", generate_fruit_agent, generate_benefit_agent)],
    )
    

    Run Locally

    # Interactive CLI
    adk run path/to/my_agent
    
    # Web UI (supports multi-agent directories or pointing directly to a single agent folder)
    adk web path/to/agents_dir
    

    Development UI

    A built-in development UI to help you test, evaluate, debug, and showcase your agent(s).

    ADK Web UI

    Watch on YouTube

    Evaluate Agents

    Run the bundled evaluation sample from the repo root:

    adk eval \
        contributing/samples/evaluation/home_automation_agent \
        contributing/samples/evaluation/basic_criteria/home_automation.evalset.json \
        --config_file_path contributing/samples/evaluation/basic_criteria/eval_config.json
    

    🚀 Deployment Options

    Deploying the Agent Locally with Docker Container:

    adk deploy docker --with_ui <agent-folder>
    

    Deploying the Agent in Google Cloud (Cloud Run)

    adk deploy cloud_run --with_ui <agent-folder>
    

    You may set the following environment variables in adk command, or in a .env file instead.

    adk deploy cloud_run --with_ui --env GOOGLE_GENAI_USE_ENTERPRISE=1 <agent-folder>
    

    📚 Documentation

    🤝 Contributing

    We welcome contributions from the community! Whether it's bug reports, feature requests, documentation improvements, or code contributions, please see our:

    Community Repo

    We have the adk-python-community repo that is home to a growing ecosystem of community-contributed tools, third-party service integrations, and deployment scripts that extend the core capabilities of the ADK.

    Vibe Coding

    If you want to develop an agent via vibe coding, the llms.txt and llms-full.txt files published on the ADK documentation site can be used as context for an LLM. The former is a summarized version, while the latter contains the full documentation for LLMs with a large context window.

    Community Events

    • [Completed] ADK's 1st community meeting on Wednesday, October 15, 2025. Remember to join our group to get access to the recording, and deck.

    📄 License

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


    Happy Agent Building!