Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问clear审计提醒

google-adkGoogle ADK 搜索

Agent Skill

google-adk 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,752

周安装

117

GitHub Stars

14

下载量

964
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:google-adk(Google ADK 搜索)
来源仓库:https://github.com/vladm3105/aidoc-flow-framework
仓库路径:skills/google-adk
安装命令:
npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill google-adk
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill google-adk

简介

用于查找和筛选 Google ADK 相关资源与信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中开展广告开发工具研究。
  • 根据关键词快速定位技术文档或示例代码。
  • 安装前需确认仓库维护状态与 API 访问权限。
  • google-adk 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Google Agent Development Kit (ADK) Skill

Purpose

Provide specialized guidance for developing agentic applications and multi-agent systems using Google's Agent Development Kit (ADK). Enable AI assistants to design agents, build tools, orchestrate multi-agent workflows, implement memory/state management, and deploy agent-based applications following code-first development patterns.

When to Use This Skill

Invoke this skill when:

  • Building conversational AI agents with tool integration
  • Creating multi-agent orchestration systems
  • Developing workflow agents (sequential, parallel, iterative)
  • Implementing custom tools for agents
  • Designing agent architectures for complex tasks
  • Deploying agent applications to production
  • Evaluating agent performance and behavior
  • Implementing human-in-the-loop patterns

Do NOT use this skill for:

  • Generic Python development (use Python-specific skills)
  • Simple REST API development (ADK is for agentic systems)
  • Frontend development (ADK is backend agent framework)
  • Direct LLM API usage without agent orchestration (use LLM provider SDKs)
  • Non-Python agent frameworks (LangChain, CrewAI, AutoGPT - different patterns)

Core ADK Concepts

Platform Architecture

Framework Philosophy:

  • Code-first approach - Define agents in Python code (not YAML/JSON configs)
  • Model-agnostic - Optimized for Gemini but supports other LLMs
  • Composable - Build complex systems from simple agent primitives
  • Observable - Built-in integration with tracing and monitoring tools

Supported Languages:

  • Python (primary, most mature) - google-adk package
  • Go (available) - adk-go repository
  • Java (available) - adk-java repository

Runtime Environment:

  • Python 3.9+ required
  • Agent Engine for deployment (containerized execution)
  • Web UI for development/testing (Angular + FastAPI)
  • CLI for evaluation and deployment operations

Agent Types and Hierarchy

1. LlmAgent (Dynamic, model-driven)

*Use for:*

  • Conversational interfaces
  • Decision-making with uncertainty
  • Natural language understanding
  • Creative tasks (content generation)
  • Contextual reasoning

*Characteristics:*

  • Uses LLM for decision-making
  • Non-deterministic execution
  • Tool selection driven by model
  • Handles ambiguous inputs

2. Workflow Agents (Deterministic, programmatic)

*Sequential Agent:*

  • Executes tools in fixed order
  • Use for: Multi-step processes with dependencies
  • Example: Data pipeline (fetch → transform → load)

*Parallel Agent:*

  • Executes multiple tools concurrently
  • Use for: Independent operations requiring aggregation
  • Example: Multi-source data gathering

*Loop Agent:*

  • Repeats execution until condition met
  • Use for: Iterative refinement, convergence tasks
  • Example: Generator-critic pattern

3. Custom Agents (User-defined logic)

*Use for:*

  • Domain-specific orchestration
  • Complex state machines
  • Integration with existing systems
  • Specialized execution patterns

Agent Composition:

  • Agents can contain sub-agents (hierarchical)
  • Parent agent coordinates child agents
  • Supports multi-level nesting

Tool Ecosystem

Tool Categories:

  1. Built-in Tools:

- Search - Web search via Google Search API - Code Execution - Python code interpreter (sandboxed) - Google Cloud tools - Vertex AI, BigQuery, Cloud Storage

  1. Custom Function Tools:

- Python functions wrapped as tools - Automatic schema generation from type hints - Supports async functions

  1. OpenAPI Tools:

- Auto-generate from OpenAPI/Swagger specs - HTTP-based service integration

  1. MCP (Model Context Protocol) Tools:

- Integration with MCP servers - Cross-framework tool sharing

Tool Attributes:

  • Name - Unique identifier
  • Description - Natural language explanation for LLM
  • Parameters - JSON schema defining inputs
  • Function - Execution logic
  • Confirmation - Optional human-in-the-loop approval

Memory and State Management

Session Management:

  • Agent maintains conversation history
  • Automatic context window management
  • Configurable history retention

State Persistence:

  • Custom state objects per agent
  • Serialization support (JSON, pickle)
  • Database integration for long-term storage

Context Caching:

  • Reduces token usage for repeated context
  • Automatic cache invalidation
  • Configurable cache TTL

Agent Development Methodology

Planning Phase

Step 1: Define Agent Purpose

  • Primary objective (single responsibility)
  • Input/output format
  • Success criteria
  • Failure modes

Step 2: Identify Required Tools

Decision criteria:

  • Use built-in tools when available (Search, Code Execution)
  • Create custom functions for simple operations (<100 lines)
  • Use OpenAPI tools for existing REST APIs
  • Use MCP tools for cross-framework compatibility

Step 3: Select Agent Type

START: What's the agent's decision pattern?
  │
  ├─> Requires natural language reasoning? ─Yes─> LlmAgent ★
  │
  ├─> Fixed sequence of steps?
  │   └─> Sequential Workflow Agent ★
  │
  ├─> Independent parallel operations?
  │   └─> Parallel Workflow Agent ★
  │
  ├─> Iterative refinement needed?
  │   └─> Loop Workflow Agent ★
  │
  └─> Custom orchestration logic?
      └─> Custom Agent ★

Step 4: Design Multi-Agent Architecture (if needed)

Patterns:

  • Coordinator/Dispatcher - Central agent routes to specialists
  • Sequential Pipeline - Output of Agent A → Input of Agent B
  • Parallel Fan-Out/Gather - Distribute work, aggregate results
  • Hierarchical Decomposition - Break complex task into subtasks

Implementation Phase

Agent Implementation Examples:

[See Code Examples: examples/google_adk_agent_implementation.py]

Key agent patterns demonstrated:

  • LlmAgent - create_weather_assistant() - Conversational agent with custom tools
  • SequentialAgent - create_data_pipeline() - Ordered execution (fetch → transform → save)
  • ParallelAgent - create_market_researcher() - Concurrent tool execution
  • LoopAgent - create_content_generator() - Iterative refinement with break conditions
  • Session Management - create_stateful_session() - Multi-turn conversation with history

Testing Phase

Web UI Testing:

# Start API server
adk api_server --port 8000

# Start web UI (separate terminal)
cd adk-web
npm install
npm start
# Access: http://localhost:4200

Programmatic Testing:

# Unit test for agent
def test_weather_agent():
    agent = create_weather_agent()
    response = agent.run("Weather in NYC?")
    assert "weather" in response.content.lower()
    assert response.success is True

# Integration test with mock tools
def test_pipeline_agent():
    agent = create_pipeline_agent(mock_tools=True)
    result = agent.run({"input": "test_data"})
    assert result["status"] == "completed"

Evaluation Framework:

from google.adk.evaluation import evaluate_agent

# Criteria-based evaluation
results = evaluate_agent(
    agent=my_agent,
    test_cases=[
        {"input": "What's 2+2?", "expected_output": "4"},
        {"input": "Explain quantum computing", "criteria": "mentions_qubits"}
    ],
    evaluator_model="gemini-2.0-flash"
)

print(f"Pass rate: {results.pass_rate}")
print(f"Average score: {results.avg_score}")

Tool Development

[See Code Examples: examples/google_adk_tools_example.py]

Custom Function Tools

Examples demonstrated:

  • Basic Function Tool - calculate_tax() - Simple tool with type hints
  • Async Tool - fetch_user_data() - Asynchronous API calls
  • HITL Confirmation - send_email(), delete_user_account() - Human approval required
  • Input Validation - send_email_tool() - Email format validation and sanitization
  • Retry Logic - fetch_external_data() - Automatic retry with exponential backoff
  • Rate Limiting - call_external_api() - Decorator-based rate limiting
  • Error Handling - fetch_stock_price() - Graceful degradation on failures

OpenAPI Tools

Integration Pattern:

  • Load tools from OpenAPI spec URL
  • Optional tool filtering for specific operations
  • Automatic schema generation from spec [See: create_api_agent() in examples/google_adk_tools_example.py]

MCP Tool Integration

Integration Pattern:

  • Connect to MCP server endpoint
  • Import tools for cross-framework compatibility [See: create_mcp_agent() in examples/google_adk_tools_example.py]

Multi-Agent Orchestration

[See Code Examples: examples/google_adk_multi_agent.py]

Multi-Agent Patterns

Pattern 1: Coordinator/Dispatcher (Complexity: 4)

  • Use case: Route user requests to specialized agents
  • Function: create_coordinator_system() - Weather + Finance specialists

Pattern 2: Sequential Pipeline (Complexity: 3)

  • Use case: Multi-stage processing with dependencies
  • Function: create_content_pipeline() - Research → Write → Edit

Pattern 3: Parallel Fan-Out/Gather (Complexity: 4)

  • Use case: Aggregate results from multiple sources
  • Function: create_market_analysis_system() - Technical + Fundamental + Sentiment analysis

Pattern 4: Hierarchical Decomposition (Complexity: 5)

  • Use case: Break complex tasks into manageable subtasks
  • Function: create_project_management_system() - Multi-level agent hierarchy

Pattern 5: Generator-Critic Loop (Complexity: 4)

  • Use case: Iterative refinement with feedback
  • Function: create_quality_content_system() - Generate → Critique → Refine

Pattern 6: Human-in-the-Loop (HITL) (Complexity: 3)

  • Use case: Critical decisions require human approval
  • Function: create_account_management_agent() - Confirmation before deletion

Pattern 7: State Management

  • Use case: Persistent user context across sessions
  • Class: StatefulAgent - In-memory state storage with history

Pattern 8: Database Persistence

  • Use case: Long-term state storage
  • Functions: save_state(), load_state() - PostgreSQL-backed persistence

Memory and State Management

[See Code Examples: examples/google_adk_multi_agent.py - State Management section]

Session Management

Basic Session Pattern:

  • Multi-turn conversation with history retention
  • Automatic context window management
  • Configurable history limits

[See: create_stateful_session() in examples/google_adk_agent_implementation.py]

State Persistence

Custom State Object:

  • In-memory state storage per user
  • Dataclass-based state modeling
  • Conversation history tracking

[See: StatefulAgent class in examples/google_adk_multi_agent.py]

Database Persistence:

  • Long-term state storage with SQLAlchemy
  • JSON-serialized state data
  • PostgreSQL/MySQL support

[See: save_state(), load_state() functions in examples/google_adk_multi_agent.py]

Deployment Options

[See Code Examples: examples/google_adk_deployment.py]

Agent Engine (Managed Service)

Deployment Commands:

pip install google-adk[cli]
adk auth login
adk deploy --agent-file agent.py --agent-name my_agent --project-id my-gcp-project --region us-central1

[See: create_production_agent() for configuration example]

Cloud Run Deployment

Components:

  • FastAPI server with agent endpoints
  • Dockerfile for containerization
  • Health check and error handling
  • Environment configuration

[See: FastAPI app implementation, Dockerfile reference, deployment commands in examples/google_adk_deployment.py]

Docker Containerization

Self-Hosted Options:

  • Docker Compose with Redis
  • Single container deployment
  • Environment variable configuration

[See: docker-compose.yml reference, deployment commands in examples/google_adk_deployment.py]

Resource Requirements

Agent ComplexityCPURAMConcurrent Requests
Simple LlmAgent1 core512MB10
Workflow Agent2 cores1GB20
Multi-Agent (3-5 agents)4 cores2GB10
Complex Multi-Agent (>5)8 cores4GB5

Evaluation and Testing

[See Code Examples: examples/google_adk_deployment.py - Evaluation endpoint]

Criteria-Based Evaluation

Pattern:

  • Define custom evaluation criteria (accuracy, helpfulness, etc.)
  • Run test cases against agent
  • Analyze pass rate and scores

[See: evaluate_agent_endpoint() in examples/google_adk_deployment.py]

User Simulation Evaluation

Pattern:

  • Simulate user interactions with defined goals
  • Track goal completion rate
  • Measure average turns to completion

[See documentation for UserSimulator examples]

Best Practices

[See Code Examples: examples/google_adk_tools_example.py - Tool Design Best Practices section]

Agent Instruction Writing

Effective Patterns:

  • Clear role and responsibilities
  • Structured format with constraints
  • Specific tool usage guidance
  • Example interactions

[See: GOOD vs BAD examples at end of examples/google_adk_tools_example.py]

Tool Design Principles

Key Principles:

  1. Single Responsibility - One clear purpose per tool
  2. Descriptive Naming - Clear action and object naming
  3. Type Hints - Complete type annotations for all parameters

[See: Tool design examples at end of examples/google_adk_tools_example.py]

Error Handling

Strategies:

  • Graceful Degradation - Return error messages instead of raising exceptions
  • Retry Logic - Automatic retry with exponential backoff
  • Input Validation - Validate and sanitize all inputs

[See: fetch_stock_price(), fetch_external_data(), send_email_tool() in examples/google_adk_tools_example.py]

Security and Safety

Implementation:

  • Input Validation - Email format validation, length limits
  • Rate Limiting - Decorator-based request throttling
  • Sanitization - Remove dangerous HTML/script content

[See: send_email_tool(), rate_limit() decorator in examples/google_adk_tools_example.py]

Performance Optimization

Async Tools:

  • Automatic parallel execution for async functions
  • Improved throughput for I/O-bound operations

[See: fetch_price(), create_portfolio_analyzer() in examples/google_adk_tools_example.py]

Quality Gates

Definition of Done: Agents

An agent is production-ready when:

  1. Functionality:

- ✓ Agent completes primary objective on test cases - ✓ Tool execution succeeds with valid inputs - ✓ Error handling covers expected failure modes - ✓ Multi-turn conversations maintain context

  1. Performance:

- ✓ Response time <5 seconds for simple queries - ✓ Response time <30 seconds for complex workflows - ✓ Evaluation pass rate ≥80% on criteria - ✓ Resource usage within deployment limits

  1. Safety:

- ✓ Input validation on all tools - ✓ High-risk actions require confirmation (HITL) - ✓ No hardcoded credentials or API keys - ✓ Rate limiting on external API calls

  1. Observability:

- ✓ Logging configured for debugging - ✓ Tracing enabled for multi-agent workflows - ✓ Evaluation metrics tracked - ✓ Error alerts configured

  1. Documentation:

- ✓ Agent purpose and capabilities documented - ✓ Tool descriptions clear and accurate - ✓ Example usage provided - ✓ Known limitations documented

Definition of Done: Tools

A tool is production-ready when:

  1. Interface:

- ✓ Function has type hints for all parameters - ✓ Docstring explains purpose, args, returns - ✓ Parameter descriptions guide LLM selection - ✓ Return values are JSON-serializable

  1. Reliability:

- ✓ Error handling with informative messages - ✓ Input validation prevents invalid operations - ✓ Timeout configured for long-running operations - ✓ Retry logic for transient failures

  1. Testing:

- ✓ Unit tests cover success cases - ✓ Unit tests cover error cases - ✓ Integration tests with agent execution - ✓ Performance benchmarks for expensive operations

Error Handling Guide

Common Issues and Resolutions

Issue: Agent doesn't call the right tool

  • Cause: Tool description unclear or ambiguous
  • Resolution: # BAD: Vague description def process(data): """Process data.""" # Too generic # GOOD: Specific description def validate_email_format(email: str) -> bool: """Check if email address matches valid format (user@domain.com). Use this tool ONLY to validate email syntax, not to verify if email exists or is deliverable."""

Issue: Agent loops indefinitely

  • Cause: No termination condition in Loop Agent
  • Resolution: # Add max_iterations and explicit break condition agent = LoopAgent(tools=[...], max_iterations=10, # Hard limit break_condition=lambda result: result.get("completed", False))

Issue: "Tool execution failed" errors

  • Cause: Tool raises unhandled exception
  • Resolution: def robust_tool(param: str) -> str: try: result = risky_operation(param) return f"Success: {result}" except SpecificError as e: return f"Operation failed: {e.message}" except Exception as e: logger.error(f"Unexpected error in robust_tool: {e}") return "Temporary service error, please try again"

Issue: Agent response is too slow

  • Cause: Sequential tool calls when parallelization possible
  • Resolution: # Use Parallel Agent or async tools agent = ParallelAgent(tools=[tool1, tool2, tool3] # Execute concurrently)

Issue: Context limit exceeded

  • Cause: Conversation history too long
  • Resolution: session = Session(agent=my_agent, max_history_turns=10, # Limit history context_window_tokens=30000 # Set explicit limit)

Issue: Deployment fails on Cloud Run

  • Cause: Missing dependencies or environment variables
  • Resolution: # Ensure requirements.txt is complete pip freeze > requirements.txt # Set required environment variables gcloud run deploy my-agent \ --set-env-vars GOOGLE_API_KEY=your_key,AGENT_CONFIG=prod

Debugging Strategies

1. Enable verbose logging:

import logging

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("google.adk")
logger.setLevel(logging.DEBUG)

2. Test tools independently:

# Test tool without agent
tool = Tool.from_function(my_function)
result = my_function("test_input")
print(f"Tool output: {result}")

3. Use web UI for interactive debugging:

adk api_server --debug
# Access UI at http://localhost:4200
# View tool calls, agent reasoning, response generation

4. Inspect agent execution trace:

response = agent.run("test query", return_trace=True)
print(response.trace)  # Shows all tool calls and decisions

Complexity Ratings

TaskRatingDescription
Simple LlmAgent with tools2Basic conversational agent
Sequential Workflow Agent2Fixed-order tool execution
Parallel Workflow Agent3Concurrent operations
Loop Workflow Agent3Iterative refinement
Custom Agent3User-defined orchestration
Coordinator/Dispatcher (2-3 agents)4Multi-agent routing
Sequential Pipeline (3+ agents)4Chained agent execution
Hierarchical Multi-Agent (>5 agents)5Complex nested architecture
Custom tool development2Python function wrapper
OpenAPI tool integration2Auto-generated from spec
MCP tool integration3Cross-framework tools
Deployment to Agent Engine2Managed deployment
Self-hosted Docker deployment3Container orchestration
Advanced evaluation framework4Custom criteria and simulation

References

Official Documentation

Python SDK Resources

Additional Languages

Community Resources

Related Skills

  • For workflow automation: Use n8n skill
  • For API design: Use api-design-architect skill
  • For cloud deployment: Use cloud-devops-expert skill
  • For Python development: Use Python-specific skills
  • For LLM integration: Use model provider SDKs (OpenAI, Anthropic, etc.)

Version: 1.0.0 Last Updated: 2025-11-13 Complexity Rating: 3 (Moderate - requires agent architecture knowledge) Estimated Learning Time: 10-15 hours for proficiency

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Gemini CLI

30.42%
按下载量换算293

Claude Code

22.66%
按下载量换算218

OpenCode

15.4%
按下载量换算148

Antigravity

11.3%
按下载量换算109

Cursor

7.85%
按下载量换算76

github-copilot

3.56%
按下载量换算34

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/vladm3105/aidoc-flow-framework --skill google-adk;npx skills add vladm3105/aidoc-flow-framework --skill "google-adk" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills