google-cloud-solution-build-deploy-agents
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBuild and deploy AI agents on Google Cloud
构建并部署Google Cloud上的AI Agent
This skill guides agents through the workflow of designing and implementing a
tailored multi-product solution in the cloud for a given workload, use case, or
requirement.
本技能将引导用户完成针对特定工作负载、用例或需求,在云端设计并实现定制化多产品解决方案的工作流。
Workflow
工作流
The solution design and implementation workflow is divided into the following
phases:
- Phase 1: Requirements discovery and analysis: Analyze the workload's requirements, constraints, dependencies, and current state.
- Phase 2: Solution design: Build a technology stack, architecture, and deployment configuration for the workload based on Google Cloud design best practices and recommendations.
- Phase 3: Implementation plan: Generate automation and instructions to deploy the solution.
- Phase 4: Solution validation: Validate that the deployment meets the requirements of the workload.
Copy this checklist into your active task/plan artifact to track progress across
the four phases:
- Phase 1: Requirements discovery and analysis completed & confirmed.
- Phase 2: Solution architecture generated & approved.
- Phase 3: Implementation plan generated & approved.
- Phase 4: Solution validation generated & approved.
解决方案设计与实现工作流分为以下阶段:
- 阶段1:需求发现与分析:分析工作负载的需求、约束、依赖关系及当前状态。
- 阶段2:解决方案设计:基于Google Cloud设计最佳实践与建议,为工作负载构建技术栈、架构及部署配置。
- 阶段3:实施计划:生成自动化脚本与部署说明以落地解决方案。
- 阶段4:解决方案验证:验证部署是否满足工作负载的需求。
将以下检查清单复制到你的任务/计划文档中,跟踪四个阶段的进度:
- 阶段1:需求发现与分析已完成并确认。
- 阶段2:解决方案架构已生成并获批。
- 阶段3:实施计划已生成并获批。
- 阶段4:解决方案验证已完成并获批。
Phase 1: Requirements discovery and analysis
阶段1:需求发现与分析
-
Discover requirements: Gather and understand the functional and non-functional requirements, business goals, and current state (if any) of the workload, including its architecture, dependencies, and constraints.Important: First, check whether the user's initial prompt has already answered the following questions or whether the prompt explicitly asks you to propose a solution architecture/diagram from a given set of parameters.
-
If the user's prompt provides sufficient requirements and it explicitly requests an architecture proposal or diagram, then skip asking the questions below, and instead proceed to the step Recommend agent design pattern.
-
If the user's prompt doesn't provide sufficient requirements, then complete these steps to gather missing information:
-
Ask the user to describe the functional requirements of their workload: business processes, activities, and use cases.
-
Ask the user to describe the non-functional requirements (security, privacy, compliance, reliability, disaster recovery, cost, operations, performance, and sustainability) of their workloads.
-
Ask the user what existing systems, knowledge bases, product documentation, or other documentation the AI agents need to access for grounded guidance.
-
Ask the user to describe dependencies, if any, on other workloads, products, or tools.
-
Review the input that the user has provided so far, and check whether there are any ambiguities or contradictions in the input.If you identify any ambiguities or contradictions in the requirements that the user has provided, then do the following for each ambiguity or contradiction that you identify:
- Describe the ambiguity or contradiction.
- Ask the user how they wish to resolve the ambiguity or
contradiction.
- If the user delegates the choice to you (e.g., the user replies with "do what you think is best" or "you decide"), then provide a clear suggestion to resolve the ambiguity or contradiction, explain your reasoning, and ask the user to approve your suggestion.
Critical: Until all the ambiguities and contradictions that you identify are resolved according to the preceding guidance, you must NOT recommend or generate any architecture design, technical decomposition, or Google Cloud product recommendations.
-
-
-
Recommend agent design pattern: Evaluate the complexity, workflow, latency, and cost requirements of the workload to recommend an agent design pattern:
- Single-agent system: Recommend for simpler tasks, acting as an effective starting point to refine core logic and tools.
- Multi-agent system: Recommend for complex problems requiring multiple specialized agents to collaborate on a workflow.
-
Identify components: Based on the requirements analysis, generate a technical decomposition of the workload. The technical decomposition must identify the logical components of the workloads and their relationships. Also identify any cross-cloud components, hybrid components, or on-premises components that the solution needs to integrate with.
-
Ask for confirmation: Ask the user to confirm whether the recommended design pattern and technical decomposition match their workload requirements.
-
Iterate: If the user requests changes, generate an updated technical decomposition, and ask the user to confirm the changes. Continue iterating until the user confirms the technical decomposition. Proceed to the next phase only after the user provides confirmation of the technical decomposition.
-
发现需求:收集并理解工作负载的功能与非功能需求、业务目标及当前状态(如有),包括其架构、依赖关系与约束。重要提示:首先检查用户的初始提示是否已回答以下问题,或是否明确要求根据给定参数提出解决方案架构/图表。
-
如果用户提示提供了足够的需求,且明确要求架构提案或图表,则跳过以下问题,直接进入推荐Agent设计模式步骤。
-
如果用户提示未提供足够的需求,则完成以下步骤以收集缺失信息:
-
请用户描述其工作负载的功能需求:业务流程、活动及用例。
-
请用户描述其工作负载的非功能需求(安全、隐私、合规、可靠性、灾难恢复、成本、运维、性能及可持续性)。
-
请用户说明AI Agent需要访问哪些现有系统、知识库、产品文档或其他文档以获取可靠指导。
-
请用户描述工作负载对其他系统、产品或工具的依赖关系(如有)。
-
回顾用户目前提供的输入,检查其中是否存在模糊或矛盾之处。若发现需求中存在模糊或矛盾点,针对每个问题执行以下操作:
- 描述模糊或矛盾的具体内容。
- 询问用户希望如何解决该问题。
- 如果用户将选择权交给你(例如用户回复“按你认为最佳的方式处理”或“你来决定”),则提供明确的解决方案建议,解释理由,并请求用户批准。
关键要求:在所有已识别的模糊或矛盾点按上述指导解决之前,不得推荐或生成任何架构设计、技术分解或Google Cloud产品建议。
-
-
-
推荐Agent设计模式:评估工作负载的复杂度、工作流、延迟及成本需求,推荐合适的Agent设计模式:
- 单Agent系统:适用于较简单任务,是完善核心逻辑与工具的有效起点。
- 多Agent系统:适用于需要多个专业Agent协作完成工作流的复杂问题。
-
识别组件:基于需求分析,生成工作负载的技术分解。技术分解必须明确工作负载的逻辑组件及其关系,同时识别解决方案需要集成的跨云组件、混合组件或本地组件。
-
请求确认:请用户确认推荐的设计模式与技术分解是否符合其工作负载需求。
-
迭代优化:如果用户要求修改,生成更新后的技术分解并请求用户确认。持续迭代直至用户确认技术分解,获得确认后方可进入下一阶段。
Phase 2: Solution design
阶段2:解决方案设计
-
Retrieve relevant Google Cloud guidance from.
references/related-guidance.mdImportant: Use the content that you retrieved fromto ground the guidance that you generate in the remaining steps of this phase.references/related-guidance.md -
Map components to Google Cloud products: For each component in the confirmed technical decomposition, identify the appropriate Google Cloud products and features by consulting product-mappings.md for detailed recommendations, trade-offs, and alternatives across networking, frontends, agent/model runtimes, memory stores, and tools.
-
Create architecture diagram: Create an architecture diagram in Mermaid format: https://github.com/mermaid-js/mermaid. The diagram should show the components, their relationships, and data/control flows.
-
Generate design recommendations: Generate design guidance based on the following Google Cloud best practices and recommendations. Use the information in, with an emphasis on the guidance in
references/related-guidance.md.references/design-principles.md -
Draft solution architecture: Compile the requirements, technical decomposition, product mapping, architecture diagram, and design recommendations into a single Markdown file adhering to the format in solution-template.md. Save this document in the workspace as.
solution-architecture.md -
Request review: Present the generated solution architecture (including the complete fencedcode block for the diagram) directly to the user in your response, and explicitly request their feedback or approval. When you present the architecture, ask the user to provide approval for you to proceed with an implementation plan.
mermaid -
Iterate: If the user requests changes, generate an updated solution architecture and repeat the steps from "Map components to Google Cloud products" through "Request review" until the user approves the solution architecture.
-
从获取相关Google Cloud指导。
references/related-guidance.md重要提示:使用从获取的内容,作为本阶段后续步骤生成指导的依据。references/related-guidance.md -
将组件映射到Google Cloud产品:针对已确认技术分解中的每个组件,通过查阅product-mappings.md获取详细建议、权衡方案及替代选项,确定合适的Google Cloud产品与功能,覆盖网络、前端、Agent/模型运行时、内存存储及工具等领域。
-
创建架构图:以Mermaid格式创建架构图:https://github.com/mermaid-js/mermaid。图表应展示组件、组件间关系及数据/控制流。
-
生成设计建议:基于以下Google Cloud最佳实践与建议生成设计指导。使用中的信息,重点参考
references/related-guidance.md中的指导内容。references/design-principles.md -
起草解决方案架构:将需求、技术分解、产品映射、架构图及设计建议整合为单个Markdown文件,遵循solution-template.md中的格式。将该文档保存到工作区,命名为。
solution-architecture.md -
请求评审:在回复中直接向用户展示生成的解决方案架构(包括完整的代码块),并明确请求反馈或批准。展示架构时,请用户批准你继续制定实施计划。
mermaid -
迭代优化:如果用户要求修改,生成更新后的解决方案架构,并重复“将组件映射到Google Cloud产品”至“请求评审”的步骤,直至用户批准解决方案架构。
Phase 3: Implementation plan
阶段3:实施计划
-
Retrieve relevant implementation resources:Important: Use the resources in references/related-guidance.md as the technical foundation for the Infrastructure as Code (IaC) and the deployment instructions that you generate in the remaining steps of this phase.
-
Identify deployment prerequisites: Document prerequisites for the deployment, including the following:
- Projects and billing associations
- Required Google Cloud APIs
- Required IAM permissions
- Any other prerequisites
-
Generate Infrastructure as Code (IaC): Generate code (e.g., Terraform) and deployment scripts to automate the provisioning of the proposed Google Cloud resources.
- Where appropriate, alongside or instead of raw infrastructure scripts,
instruct the user to use Agents CLI commands (or
agents-cli scaffold create) to set up or enhance the project structure, deployment configuration, and CI/CD pipelines.agents-cli scaffold enhance
- Where appropriate, alongside or instead of raw infrastructure scripts,
instruct the user to use Agents CLI commands (
-
Write deployment instructions: Draft sequential, step-by-step deployment instructions to execute the IaC and initialize the workload components. Compile the deployment prerequisites, IaC, and deployment instructions into a single Markdown file adhering to the format in implementation-template.md. Save this document in the workspace as.
implementation-instructions.md- The instructions MUST provide the exact ADK code to define a stateful agent node that takes a prompt, calls a model, and returns a tool execution request.
- The instructions MUST demonstrate how to register tools like database readers by using Model Context Protocol (MCP) standards.
- If deploying the agent to Cloud Run, the instructions MUST show how to configure Cloud Run to scale to zero when the agent is idle, reducing runtime costs.
- The instructions MUST recommend using encrypted environment variables to store model parameters or private API credentials. Encryption helps to prevent the exposure of sensitive credentials in plain-text container log streams.
- Where appropriate, the instructions MUST specify using the Agents CLI
command (alongside or instead of raw infrastructure/deployment scripts) to run the deployment.
agents-cli deploy
-
Request review: Present the generated deployment instructions to the user and explicitly request their feedback and confirmation.
-
Iterate: If the user requests changes, generate an updated implementation plan and repeat the steps from "Generate Infrastructure as Code (IaC)" through "Request review" until the user approves the implementation plan.
-
获取相关实施资源:重要提示:使用references/related-guidance.md中的资源,作为生成基础设施即代码(IaC)及部署说明的技术基础。
-
识别部署先决条件:记录部署的先决条件,包括:
- 项目与计费关联
- 所需的Google Cloud API
- 所需的IAM权限
- 其他任何先决条件
-
生成基础设施即代码(IaC):生成代码(如Terraform)及部署脚本,以自动化配置拟议的Google Cloud资源。
- 适当时,可指导用户使用Agents CLI命令(或
agents-cli scaffold create)来设置或完善项目结构、部署配置及CI/CD流水线,替代或补充原始基础设施脚本。agents-cli scaffold enhance
- 适当时,可指导用户使用Agents CLI命令(
-
编写部署说明:起草分步部署说明,以执行IaC并初始化工作负载组件。将部署先决条件、IaC及部署说明整合为单个Markdown文件,遵循implementation-template.md中的格式。将该文档保存到工作区,命名为。
implementation-instructions.md- 说明必须提供定义有状态Agent节点的精确ADK代码,该节点接收提示、调用模型并返回工具执行请求。
- 说明必须演示如何按照Model Context Protocol (MCP)标准注册数据库读取器等工具。
- 如果将Agent部署到Cloud Run,说明必须展示如何配置Cloud Run,使其在Agent空闲时缩容至零,以降低运行成本。
- 说明必须建议使用加密环境变量存储模型参数或私有API凭据,加密有助于防止敏感凭据在明文容器日志流中暴露。
- 适当时,说明必须指定使用Agents CLI的命令(替代或补充原始基础设施/部署脚本)来执行部署。
agents-cli deploy
-
请求评审:向用户展示生成的部署说明,并明确请求反馈与确认。
-
迭代优化:如果用户要求修改,生成更新后的实施计划,并重复“生成基础设施即代码(IaC)”至“请求评审”的步骤,直至用户批准实施计划。
Phase 4: Solution validation
阶段4:解决方案验证
-
Retrieve relevant verification resources:Important: Use the resources in references/related-guidance.md and their verification patterns as the starting point for the validation checks and verification scripts that you generate in the remaining steps of this phase.
-
Define validation checks: Outline validation steps to verify that the deployed infrastructure meets the workload's requirements:
- Deployment dry-run: Commands like to preview changes. Include instructions to run agent deployment in dry-run mode (e.g., using
terraform planoragents-cli deploy --dry-run) to preview steps and Terraform executions before pushing to production.-n - Local testing and quality verification: Recommend using the Agents
CLI to run and test agent logic locally () and conduct systematic evaluations (
agents-cli run) to verify agent quality and performance before deploying.agents-cli eval run - Connectivity and routing: Verification of network paths, load balancer routing, and service endpoints.
- Security policies: Verification of restricted access, firewall rules, and IAM enforcement.
- Deployment dry-run: Commands like
-
Generate verification scripts: Draft lightweight scripts or command-line instructions (e.g. using,
curl, orgcloud) that the user can run to perform these validation checks.agents-cli- The validation plan MUST include instructions using the Agents CLI for
local runs, evaluations, and post-deployment validation checks (e.g.,
to test the deployed service endpoint).
agents-cli run --url <service-url>
- The validation plan MUST include instructions using the Agents CLI for
local runs, evaluations, and post-deployment validation checks (e.g.,
-
Compile validation plan: Document the validation steps, verification scripts, and expected outcomes in a single Markdown file adhering to the format in validation-template.md. Save this document in the workspace as.
validation-plan.md -
Request review: Present the validation plan to the user and explicitly request their feedback or approval on the validation plan.
-
Conduct validation and finalize: Assist the user in executing the validation checks and troubleshooting any deployment issues. After the solution is validated successfully, request final approval from the user.
-
Iterate: If the user requests changes, generate an updated validation plan and repeat the steps from "Define validation checks" through "Request review" until the user approves the validation plan.
-
获取相关验证资源:重要提示:使用references/related-guidance.md中的资源及其验证模式,作为生成本阶段后续步骤中验证检查与验证脚本的起点。
-
定义验证检查:概述验证步骤,以确认部署的基础设施满足工作负载需求:
- 部署预演:使用等命令预览变更。包括指导用户以预演模式运行Agent部署(例如使用
terraform plan或agents-cli deploy --dry-run),在推送至生产环境前预览步骤与Terraform执行情况。-n - 本地测试与质量验证:建议使用Agents CLI在本地运行并测试Agent逻辑(),并进行系统性评估(
agents-cli run),在部署前验证Agent的质量与性能。agents-cli eval run - 连通性与路由:验证网络路径、负载均衡路由及服务端点。
- 安全策略:验证访问限制、防火墙规则及IAM执行情况。
- 部署预演:使用
-
生成验证脚本:起草轻量脚本或命令行说明(如使用、
curl或gcloud),供用户运行以执行这些验证检查。agents-cli- 验证计划必须包含使用Agents CLI进行本地运行、评估及部署后验证检查的说明(例如以测试已部署的服务端点)。
agents-cli run --url <service-url>
- 验证计划必须包含使用Agents CLI进行本地运行、评估及部署后验证检查的说明(例如
-
编制验证计划:将验证步骤、验证脚本及预期结果记录在单个Markdown文件中,遵循validation-template.md中的格式。将该文档保存到工作区,命名为。
validation-plan.md -
请求评审:向用户展示验证计划,并明确请求对验证计划的反馈或批准。
-
执行验证并最终确定:协助用户执行验证检查并排查任何部署问题。解决方案成功验证后,请求用户最终批准。
-
迭代优化:如果用户要求修改,生成更新后的验证计划,并重复“定义验证检查”至“请求评审”的步骤,直至用户批准验证计划。
References & Supporting Links
参考资料与支持链接
- For the complete list of Google Cloud architectural documentation, product manuals, development kits, and checklists used by this skill, see related-guidance.md.
- 关于本技能使用的完整Google Cloud架构文档、产品手册、开发工具包及检查清单,请查看related-guidance.md。