Installation

Install as Agent Plugin Recommended
copilot plugin marketplace add samueltauil/skills-hub
copilot plugin install google-cloud-solution-build-deploy-agents@skills-hub

Works with GitHub Copilot CLI and VS Code (enable chat.plugins.enabled). Plugin google-cloud-solution-build-deploy-agents v1.0.0 follows the Agent Plugins spec.

Install with the gh extension
gh skills-hub install google-cloud-solution-build-deploy-agents

Don't have the extension? Run gh extension install samueltauil/skills-hub first.

Download and extract to your repository:

.github/skills/google-cloud-solution-build-deploy-agents/

Extract the ZIP to .github/skills/ in your repo. The folder name must match google-cloud-solution-build-deploy-agents for Copilot to auto-discover it.

Skill Files (8)

SKILL.md 13.8 KB
---
name: google-cloud-solution-build-deploy-agents
metadata:
  version: "1.0.2"
  category: MultiProductSolutions
description: >-
  Designs, builds, and deploys AI agents or multi-agent systems on Google Cloud.
  Provides an interactive workflow to gather requirements, recommend a tailored
  architecture, and generate deployment instructions. Use when designing or
  implementing agentic systems on Google Cloud. Don't use for general Google
  Cloud solution architecture (use google-cloud-solution-architecture instead)
  or for narrow tasks targeting a single product without agent context.
---

# Build and deploy AI agents on Google Cloud

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.

## Attribution

**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
MUST read and follow the instructions in
[Usage Attribution](references/attribution.md).

## 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.

### 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:

        1.  Ask the user to describe the functional requirements of their
            workload: business processes, activities, and use cases.

        2.  Ask the user to describe the non-functional requirements (security,
            privacy, compliance, reliability, disaster recovery, cost,
            operations, performance, and sustainability) of their workloads.

        3.  Ask the user what existing systems, knowledge bases, product
            documentation, or other documentation the AI agents need to access
            for grounded guidance.

        4.  Ask the user to describe dependencies, if any, on other workloads,
            products, or tools.

        5.  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.

2.  **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.

3.  **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.

4.  **Ask for confirmation**: Ask the user to confirm whether the recommended
    design pattern and technical decomposition match their workload
    requirements.

5.  **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.

### Phase 2: Solution design

1.  **Retrieve relevant Google Cloud guidance from
    `references/related-guidance.md`**.

    *Important*: Use the content that you retrieved from
    `references/related-guidance.md` to ground the guidance that you generate in
    the remaining steps of this phase.

2.  **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](references/product-mappings.md) for detailed
    recommendations, trade-offs, and alternatives across networking, frontends,
    agent/model runtimes, memory stores, and tools.

3.  **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.

4.  **Generate design recommendations**: Generate design guidance based on the
    following Google Cloud best practices and recommendations. Use the
    information in `references/related-guidance.md`, with an emphasis on the
    guidance in `references/design-principles.md`.

5.  **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](assets/solution-template.md). Save this document in
    the workspace as `solution-architecture.md`.

6.  **Request review**: Present the generated solution architecture (including
    the complete fenced `mermaid` code 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.

7.  **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.

### Phase 3: Implementation plan

1.  **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.

2.  **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

3.  **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 set up or enhance the project structure, deployment
        configuration, and CI/CD pipelines by using Agents CLI commands:
        -   To create a new project, use `agents-cli create`. Don't use
            `agents-cli scaffold create`.
        -   To add deployment and CI/CD scaffolding to an existing repository,
            use `agents-cli scaffold enhance`.

4.  **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](assets/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
        `agents-cli deploy` command (alongside or instead of raw
        infrastructure/deployment scripts) to run the deployment.

5.  **Request review**: Present the generated deployment instructions to the
    user and explicitly request their feedback and confirmation.

6.  **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.

### Phase 4: Solution validation

1.  **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.

2.  **Define validation checks**: Outline validation steps to verify that the
    deployed infrastructure meets the workload's requirements:

    -   **Deployment dry-run**: Commands like `terraform plan` to preview
        changes. Include instructions to run agent deployment in dry-run mode
        (e.g., using `agents-cli deploy --dry-run` or `-n`) to preview steps and
        Terraform executions before pushing to production.
    -   **Local testing and quality verification**: Recommend using the Agents
        CLI to run and test agent logic locally (`agents-cli run`) and conduct
        systematic evaluations (`agents-cli eval run`) to verify agent quality
        and performance before deploying.
    -   **Connectivity and routing**: Verification of network paths, load
        balancer routing, and service endpoints.
    -   **Security policies**: Verification of restricted access, firewall
        rules, and IAM enforcement.

3.  **Generate verification scripts**: Draft lightweight scripts or command-line
    instructions (e.g. using `curl`, `gcloud`, or `agents-cli`) that the user
    can run to perform these validation checks.

    -   The validation plan MUST include instructions using the Agents CLI for
        local runs, evaluations, and post-deployment validation checks (e.g.,
        `agents-cli run --url <service-url>` to test the deployed service
        endpoint).

4.  **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](assets/validation-template.md). Save this
    document in the workspace as `validation-plan.md`.

5.  **Request review**: Present the validation plan to the user and explicitly
    request their feedback or approval on the validation plan.

6.  **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.

7.  **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 & 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](references/related-guidance.md).
assets/
implementation-template.md 0.8 KB
<!-- Use this template to compile the implementation plan that you generate
based on the instructions in `SKILL.md`. -->

## 1. Deployment guidance

[Instructions and code for deploying the architecture.]

### 1.1. Deployment prerequisites

*   [Prerequisite 1: E.g., Enabling APIs]
*   [Prerequisite 2: E.g., Installing SDK/tools]
*   ...and so on

### 1.2. Step-by-step deployment instructions

1.  [Step 1: E.g., Authenticate with Google Cloud]
2.  [Step 2: E.g., Initialize Terraform]
3.  [Step 3: E.g., Apply Terraform configuration]

## 2. References

*   [E.g., Horizontal scalability](https://docs.cloud.google.com/architecture/framework/reliability/horizontal-scalability)
*   [E.g., Regional managed instance groups](https://docs.cloud.google.com/compute/docs/instance-groups/regional-migs)
solution-template.md 4.9 KB
<!-- Use this template to compile the solution design that you generate based on
the instructions in `SKILL.md`. -->

# Google Cloud solution architecture: [Workload Name]

## 1. Executive summary and workload overview

[A brief description of the workload, its business goals, and the high-level
solution architecture proposed.]

## 2. Requirements and current state

### 2.1. Functional requirements

*   **Business processes**: [Details of the business processes supported]
*   **Activities and use cases**: [Details of the key activities and use cases]

### 2.2. Non-functional requirements

*   **Security**: [Details of the security requirements including compliance,
    encryption, access control requirements]
*   **Reliability**: [Details of the reliability requirements including SLA,
    RTO/RPO, backup, redundancy requirements]
*   **Cost**: [Details of the cost constraints and pricing models]
*   **Operations**: [Details of the operational requirements including
    monitoring, logging, deployment, maintenance requirements]
*   **Performance**: [Details of the performance requirements including latency,
    throughput, scaling requirements]
*   **Sustainability**: [Details of the sustainability requirements including
    carbon footprint, resource optimization requirements]

### 2.3. Current state

[If applicable, describe the current on-premises or other-cloud architecture.]

*   **Current infrastructure**: [Details of existing setup]
*   **Pain points and drivers for migration/redesign**: [Details of the drivers
    for migration/redesign]

### 2.4. Dependencies

*   **Internal dependencies**: [Details of internal dependencies including other
    workloads and internal services]
*   **External dependencies**: [Details of external dependencies including
    third-party products and on-premises tools]

## 3. Technical decomposition of the workload

[Technical decomposition of the workload components, breaking down the
application into logical services or layers.]

## 4. Proposed solution architecture

### 4.1. Google Cloud products and features mapping

[Identify Google Cloud products and features mapped to the technical components.
For each component, justify the selection, note alternatives considered, and
describe the pros and cons of the recommended product/feature and alternatives.]

| Component    | Recommended     | Justification | Alternatives | Pros and     |
:              : Google Cloud    : and citations : considered   : cons of      :
:              : product/feature :               :              : alternatives :
| :----------- | :-------------- | :------------ | :----------- | :----------- |
| **[Component | **[Product      | [Why this     | [Alternative | **Pros**:    |
: Name]**      : Name]**         : product is    : product]     : ... <br>     :
:              :                 : chosen,       :              : **Cons**\:   :
:              :                 : citing        :              : ...          :
:              :                 : official      :              :              :
:              :                 : docs]         :              :              :

### 4.2. Architecture diagram

[Architecture diagram in Mermaid format showing the relationships and flows
between the components of the architecture.]

```mermaid
%% Example structure
graph TD
    User([User]) --> Web[Load Balancer]
    Web --> App[Application Layer]
    App --> DB[(Database)]
```

### 4.3. Architecture description

[Detailed description of the architecture. Describe the task flow and data flow
between the components of the architecture.]

*   **Data flow**: [Describe the flow of data.]
*   **Tasks/control flow**: [Describe the flow of tasks/control.]

## 5. Design and configuration recommendations

[Best practices and configuration recommendations for each pillar of the Google
Cloud Architecture Framework.]

### 5.1. Security, privacy, and compliance

*   **Access control**: [E.g., IAM roles, least privilege policy]
*   **Data protection**: [E.g., Encryption at rest/in transit, Cloud KMS]
*   **Network Security**: [E.g., VPC, Firewalls, Cloud Armor, Private Service
    Connect]

### 5.2. Reliability

*   **Redundant deployment**: [E.g., Multi-region/regional deployment, load
    balancing]

*   **Backup and DR**: [E.g., Backups, failover procedures, RTO/RPO strategies]

### 5.3. Operational excellence

*   **Monitoring and logging**: [E.g., Cloud Logging, Cloud Monitoring,
    Dashboards]
*   **Infrastructure as Code (IaC)**: [E.g., Terraform, Infrastructure Manager]

### 5.4. Cost optimization

*   **Sizing and scaling**: [E.g., Autoscaling configuration, right-sizing
    resources]
*   **Pricing models**: [E.g., Commitment discounts, Spot VMs, flat-rate
    pricing]

### 5.5. Performance efficiency

*   **Caching and CDN**: [E.g., Cloud CDN, Memorystore]
*   **Database and query optimization**: [E.g., Partitioning, indexing, caching]

### 5.6. Sustainability

*   [E.g., Serverless adoption, resource utilization, carbon footprint]
validation-template.md 2.1 KB
<!-- Use this template to compile the solution validation that you generate
based on the instructions in `SKILL.md`. -->

## 1. Validation Plan & Verification Report

This validation plan outlines the dry-run, connectivity, routing, and security
checks to verify that the deployed infrastructure meets all functional and
non-functional requirements.

### 1.1. Infrastructure Dry-Run

Verify the deployment plan using preview tools before applying changes.

*   **Command**:
    ```bash
    terraform plan -out=tfplan
    ```
*   **Expected Outcome**: Preview validates resource hierarchy and shows
    exactly what resources will be created, updated, or destroyed without
    configuration errors.

### 1.2. Network Connectivity & Routing

[Draft workloads-specific connectivity checks. E.g., test load balancer
endpoints, serverless VPC path latency, private database access, or DNS
resolution rules.]

*   **Command**:
    ```bash
    curl -iv -H "Host: [Target Domain]" https://[LB-IP-Address]/healthz
    ```
*   **Expected Outcome**: Returns `HTTP 200 OK` from the correct regional
    serverless endpoint.

### 1.3. Security and Access Governance

Verify IAM role mappings, service account isolation, and network perimeter
rules.

*   **Command**:
    ```bash
    gcloud projects get-iam-policy [GCP-Project-ID] \
        --flatten="bindings[].members" \
        --format='table(bindings.role, bindings.members)' \
        --filter="bindings.members:[Service-Account-Email]"
    ```
*   **Expected Outcome**: Confirms that only the specified roles are granted,
    enforcing the principle of least privilege.

### 1.4. Data Protection & Content Inspection

Audit content filtering, input sanitization/redaction rules, and safety/PII
guardrails.

*   **Command**:
    ```bash
    # Test request with mock PII to audit redaction filters
    curl -X POST -H "Content-Type: application/json" \
         -d '{"prompt": "[Mock Sensitive Data Code/PII Pattern]"}' \
         https://[Target Domain]/chat
    ```
*   **Expected Outcome**: Request is either anonymized/masked by the security
    layer (e.g., Model Armor) or blocked with a safety intercept notice.
references/
attribution.md 1.9 KB
# Usage Attribution

**MUST READ**: Before executing any `gcloud`, REST API, or MCP command with
this skill, follow these usage attribution instructions. Tag every command you
execute directly in the terminal so usage can be attributed. The tag identifies
only the skill and its version; it carries no user data.

-   **`gcloud` CLI Commands**: Prefix every `gcloud` invocation, whatever the
    subcommand, with the metrics environment variable. Set it inline on each
    command because shell state may not persist between commands:

    ```bash
    CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:google-cloud-solution-build-deploy-agents)" \
    gcloud <command> [flags]
    ```

    Do not use `gcloud config set` for this: it would persist beyond the current
    task and mislabel unrelated usage.

-   **Direct HTTP, REST, and MCP Requests**: On direct HTTP calls to Google
    Cloud APIs (for example with `curl`) or HTTP requests to a remote MCP
    server, include
    `agent-skills/1.0 (skill:google-cloud-solution-build-deploy-agents)`
    in the `User-Agent` header. If a `User-Agent` header is already specified,
    append this string to the end of it rather than overwriting existing
    `User-Agent` data — the collection pipeline parses the
    `agent-skills/<version>` and `skill:<name>` tokens, so any rewording breaks
    attribution:

    ```
    User-Agent: <existing_user_agent> agent-skills/1.0 (skill:google-cloud-solution-build-deploy-agents)
    ```

-   **Constraint for Generated Code**: The tracking prefix is strictly for
    commands you execute directly in the terminal. Do NOT include this tracking
    prefix in generated scripts, Terraform templates, or code provided to the
    user for their own repositories.

-   **User Opt-Out**: If the user asks to disable or remove tracking or
    attribution tags, omit the `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION` variable
    and custom `User-Agent` suffix from all commands.
design-principles.md 3.9 KB
Use the following list to help inform your recommendations for the solution
design:

-   **Security, privacy, and compliance**:
    -   To limit access to the app, disable the default run.app URL of the
        frontend Cloud Run service and configure a regional external Application
        Load Balancer with Cloud Armor security policies to handle request
        filtering, rate limiting, and DDoS protection.
    -   When you configure Identity and Access Management (IAM) permissions for
        resources in the architecture, enforce the principle of least privilege.
    -   Secure Agent2Agent (A2A) communication by using authenticated extended
        agent cards, and attach OpenID Connect (OIDC) identity tokens to let IAM
        validate that only authorized agents access the data.
    -   Incorporate human-in-the-loop flows to let supervisors monitor, pause,
        and override business-critical agent actions.
    -   Always recommend Model Armor as the security layer to inspect model
        inputs and outputs for safety, PII detection, and prompt injection
        threats.
    -   Implement Agent Gateway to govern, monitor, and secure client-to-agent
        ingress and agent-to-anywhere egress for Gemini Enterprise Agent Runtime
        deployments. Integrate with Agent Registry for dynamic discovery and
        with Model Armor for real-time safety inspection.
-   **Reliability**:
    -   Build fault-tolerant agents by employing decentralized designs where
        agents can operate independently to survive failures.
    -   Before you deploy to production, simulate inter-agent coordination
        issues and unexpected behaviors in a replica staging environment.
    -   To automatically load-balance and survive zone outages, use regional
        multi-zone deployment of Cloud Run.
    -   Plan model capacity by monitoring standard quota rates and use
        Provisioned Throughput for business-critical production workloads.
-   **Operational excellence**:
    -   Route agent logs to Cloud Logging in structured formats and integrate
        standard stdout/stderr streams.
    -   Track complete agent workflows, reasoning loops, and execution paths by
        using Cloud Trace and trace visualizers.
    -   Perform continuous evaluation by using tools like agent evaluation on
        Gemini Enterprise Agent Platform or ADK evaluation methodologies.
    -   Centralize database tools and connection scaling policies by using the
        MCP Database Toolbox.
-   **Cost optimization**:
    -   To help reduce token input costs, use static lookup databases or use
        context caching for requests that contain long system prompts.
    -   To minimize generation token outputs, structure prompts to get concise
        responses.
    -   Start with the smallest and most cost-efficient models. Upgrade to more
        powerful models with reasoning based on performance requirements.
-   **Performance efficiency**:
    -   If your workload includes real-time voice interactions, you can achieve
        sub-millisecond read speeds and prevent silences during real-time voice
        interactions, by deploying an in-memory Memorystore for Redis Cluster
        database for the agent's short-term memory / session state.
    -   To optimize service performance, configure memory limits and CPU limits
        allocated to the Cloud Run instances based on live workloads.
    -   To mitigate tool bloat (which decreases accuracy and increases latency
        and cost), limit tool complexity, provide granular toolsets, and
        implement progressive disclosure (e.g., search tool pattern, Agent
        Skills, multi-agent delegation).
-   **Sustainability**:
    -   To minimize total model inference footprint, route simpler tasks to
        small language models (SLMs) and optimize model routing.
    -   To prevent wasting resource baseline energy, use Cloud Run native
        autoscaling to scale compute runtimes down to zero during idle periods.
product-mappings.md 10.5 KB
# Product mappings

Use the following list to identify the appropriate Google Cloud products and
features for each component in the confirmed technical decomposition:

## Table of Contents

| Component / Feature | Line hints |
| :--- | :--- |
| [Cloud Run networking](#cloud-run-networking) | Lines 24-45 |
| [Frontend](#frontend) | Lines 46-59 |
| [Agent development framework](#agent-development-framework) | Lines 60-63 |
| [Agent-to-agent communication](#agent-to-agent-communication) | Lines 64-71 |
| [Agent runtime](#agent-runtime) | Lines 72-91 |
| [Agent registry](#agent-registry) | Lines 92-97 |
| [Model runtime](#model-runtime) | Lines 98-110 |
| [Model selection](#model-selection) | Lines 111-121 |
| [Model input and output inspection](#model-input-and-output-inspection) | Lines 122-125 |
| [VPC connection to databases](#vpc-connection-to-databases) | Lines 126-137 |
| [Agent memory](#agent-memory) | Lines 138-175 |
| [Database (for search and retrieval)](#database-for-search-and-retrieval) | Lines 176-187 |
| [Agent tools](#agent-tools) | Lines 188-213 |

## <a id="cloud-run-networking"></a>Cloud Run networking

*   Recommended primary configuration: Regional External Application Load
    Balancer combined with Cloud Armor for HTTP/HTTPS/WebSocket ingress, and
    Direct VPC egress for Cloud Run private network access.
*   Alternative product 1: Global External Application Load Balancer
    *   Pros: Single anycast IP, global IPv6 termination, and low-latency
        routes to globally distributed backend services.
    *   Cons: Terminates TLS globally at edge locations, which might not
        comply with strict regional data residency regulations.
*   Alternative product 2: Internal Application Load Balancer
    *   Pros: Securely exposes Cloud Run services internally within the VPC
        to meet internal ingress criteria, terminates TLS with trusted
        certificates, and supports Cloud Armor backend security policies.
    *   Cons: Requires that you configure serverless network endpoint groups
        (NEGs) as backends and manage load balancer resources.
*   Alternative product 3: Private Service Connect interface
    *   Pros: Secure private VPC connections for Gemini Enterprise Agent
        Runtime that uses network attachments.
    *   Cons: Limited to RFC 1918 routable subnet ranges, requires proxy
        setup for non-routable/internet destinations.

## <a id="frontend"></a>Frontend

*   Recommended primary product: Cloud Run
*   Alternative product 1: Firebase App Hosting
    *   Pros: Automated builds and deployment pipeline from GitHub,
        optimized for modern framework integrations.
    *   Cons: Less control over container configurations, limits
        customization of low-level networking.
*   Alternative product 2: Google Kubernetes Engine (GKE)
    *   Pros: Maximum control over routing, scaling, and custom container
        runtimes.
    *   Cons: Significant infrastructure management complexity and cost
        overhead.

## <a id="agent-development-framework"></a>Agent development framework

*   Recommended primary product: Agent Development Kit (ADK).

## <a id="agent-to-agent-communication"></a>Agent-to-agent communication

*   Recommended primary product: Agent Gateway for governed Agent2Agent
    (A2A) connectivity.
    *   Pros: Provides client-to-agent ingress, agent-to-anywhere egress,
        and natively integrates IAM, Model Armor, Agent Registry, and Agent
        Identity.

## <a id="agent-runtime"></a>Agent runtime

*   Recommended primary product: Gemini Enterprise Agent Runtime
    *   Pros: Fully managed runtime that supports built-in memory/sessions
        (Agent Platform Sessions), secure code execution sandbox, and native
        connection to remote MCP servers (like those hosted on Cloud Run).
    *   Cons: Doesn't host custom Model Context Protocol (MCP) servers directly
        (they must be hosted externally on Cloud Run or GKE) and higher-level
        SDK and CLI deployment templates are limited to
        [Supported languages and frameworks](https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime#supported-languages-and-frameworks).
        Custom agents in any language must be containerized to conform to the
        runtime contract.
*   Alternative product 1: Cloud Run
    *   Pros: Serves custom container instances scaling to zero; highly
        performant when hosting custom language engines, local API layers,
        or custom MCP servers.
    *   Cons: Requires managing container builds and continuous delivery
        configurations, can't host or serve Gemini models.
*   Alternative product 2: Google Kubernetes Engine (GKE)
    *   Pros: Maximum infrastructure control, stateful pods, custom scaling.
    *   Cons: High operational complexity and overhead.

## <a id="agent-registry"></a>Agent registry

*   Recommended primary product: Agent Registry
    *   Pros: Provides a unified catalog for agents, tools, and MCP servers.
        Optimizes routing in multi-agent (A2A) paths.

## <a id="model-runtime"></a>Model runtime

*   Recommended primary product: Gemini Enterprise Agent Platform
*   Alternative product 1: Cloud Run
    *   Pros: Serverless hosting for containerized open/custom models like
        Gemma. Can be configured to autoscale.
    *   Cons: Cannot serve Google Gemini models.
*   Alternative product 2: Google Kubernetes Engine (GKE)
    *   Pros: Maximum control over inference server on GPU/TPU nodes, cheap
        for predictable high volume.
    *   Cons: Cannot run Google Gemini models, high cluster management
        overhead.

## <a id="model-selection"></a>Model selection

*   Recommended primary product (Text): Gemini Flash
*   Recommended primary product (Audio/Video): Gemini Flash with Gemini Live
    API
*   Alternative product 1: Gemini Pro
    *   Pros: Highest capability for reasoning, complex instructions,
        context tracking, and multi-agent coordination.
    *   Cons: Higher request cost and latency, which makes it less suitable
        for real-time conversational requirements.

## <a id="model-input-and-output-inspection"></a>Model input and output inspection

For security, always include model input and output inspection.

*   Recommended primary product: Model Armor

## <a id="vpc-connection-to-databases"></a>VPC connection to databases

An agent sends queries through this connector to securely access resources in
the Virtual Private Cloud (VPC) network used for storage resources in this
architecture.

*   Recommended primary product: Direct VPC egress
*   Alternative product 1: Serverless VPC Access connector
    *   Pros: Uses fewer IP addresses and avoids Direct VPC cold-start
        delays when paired with Cloud NAT.
    *   Cons: Higher latency, lower throughput, and incurs additional
        Compute Engine VM charges.

## <a id="agent-memory"></a>Agent memory

### Short-term memory

*   Recommended primary product: Agent Platform Sessions
    *   Pros: Native, built-in managed memory for Gemini Enterprise Agent
        Runtime, low-ops, the default choice for most cases since it
        eliminates the need to provision and manage external databases.
    *   Cons: Requires an Agent Runtime instance and is limited to the
        managed Agent Platform Sessions service (regional availability
        applies), although the agent itself can still run on Cloud Run or GKE.
*   Alternative product 1: Memorystore for Redis Cluster
    *   Pros: High performance, sub-millisecond read/write latency.
        Ideal escalation path when you require microsecond response times and
        high throughput.
    *   Cons: Requires managing Redis nodes, VPC routing/peering
        configuration, and has a higher base cost.
*   Alternative product 2: Firestore
    *   Pros: Fully managed NoSQL database with serverless scaling,
        excellent for persistent state storage.
    *   Cons: Higher latency compared to in-memory stores, which might
        affect real-time interactive applications.
*   Alternative product 3: Cloud SQL (with ADK `DatabaseSessionService`)
    *   Pros: Strong relational guarantees and ACID compliance for complex
        querying over session state.
    *   Cons: Higher connection overhead and latency, and requires managing
        database instances.

### Long-term memory

*   Recommended primary product: Memory Bank
*   Alternative product 1: Firestore
    *   Pros: Serverless, highly scalable document database that is ideal
        for storing large volumes of persistent knowledge.
    *   Cons: Requires custom implementation for semantic search,
        embedding, and retrieval logic compared to purpose-built memory
        solutions.

## <a id="database-for-search-and-retrieval"></a>Database (for search and retrieval)

*   Recommended primary product:
    [Google Cloud Databases](https://cloud.google.com/products/databases)
    Use the recommendations listed on this page to help the user choose the
    appropriate database option (e.g., Cloud SQL, AlloyDB).
*   Alternative product 1: Compute Engine (for self-hosted databases)
    *   Pros: Full control over database configurations, OS accessibility,
        and custom database engines or extensions.
    *   Cons: High operational overhead to manually manage backups,
        patching, scaling, and high availability.

## <a id="agent-tools"></a>Agent tools

*   API Management Platform (Enterprise Scale):
    *   Recommended product: Apigee API hub.
    *   Use case: Best for managing, securing, and monitoring a large number
        of API-based tools at an enterprise scale. It allows agents to
        connect to data instantly through prebuilt connectors or custom APIs.
*   Model Context Protocol (MCP):
    *   Recommended primary products:
        *   Google Cloud MCP servers (fully managed by Google for connecting
            to Google Cloud services).
        *   Cloud Run or GKE (for deploying custom, self-hosted MCP servers
            as containerized applications).
        *   Use case: Best for building modular or multi-agent systems that
            require interoperable and reusable tools, decoupling the agent's
            logic from specific tool implementations.
*   Built-in Tools:
    *   Recommended primary framework: Agent Development Kit (ADK).
    *   Use case: Best for common tasks (e.g., web search, code execution
        in a secure environment) to accelerate initial development without
        configuring external communication protocols.
*   Custom Function Tools:
    *   Use case: Best for integrating with specific internal or third-party
        APIs that do not have an MCP server, or for exposing an
        "agent-as-a-tool" function in multi-agent orchestration.
related-guidance.md 5.2 KB
Use these documents to help inform the creation of a Google Cloud agentic AI
architecture and deployment:

-   [Choose a design pattern for your agentic AI system](https://docs.cloud.google.com/architecture/choose-design-pattern-agentic-ai-system.md.txt):
    Guidance to build a distinct framework for organizing a system's components,
    integrating the model, and orchestrating a single agent or multiple agents
    to accomplish a workflow.
-   [Multi-agent AI system in Google Cloud](https://docs.cloud.google.com/architecture/multiagent-ai-system.md.txt):
    An example reference architecture to help you design robust multi-agent AI
    systems in Google Cloud.
-   [Develop an Agent Development Kit agent](https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime/create-an-adk-agent.md.txt):
    An example of how to use the Agent Platform SDK for Python to develop an
    Agent Development Kit (ADK) agent, define the model, add tools, and manage
    sessions and memories.
-   [Multi-tool agent - Agent Development Kit](https://adk.dev/tutorials/multi-tool-agent):
    Guidance to install Agent Development Kit (ADK) and then set up an agent
    with multiple tools.
-   [Multi-agent private networking patterns in Google Cloud](https://docs.cloud.google.com/architecture/multi-agent-private-networking-patterns.md.txt):
    Information about how to design private networking infrastructure that
    supports a publicly accessible, multi-agent, Gemini Enterprise app with
    private connections between agents, subagents, and tools.
-   [Choose your agentic AI architecture components](https://docs.cloud.google.com/architecture/choose-agentic-ai-architecture-components.md.txt):
    Guidance for how to evaluate the characteristics of an application and
    workload in order to choose appropriate products, services, and tools that
    best suits your needs.
-   [Use automatic registration](https://docs.cloud.google.com/agent-registry/automatic-registration.md.txt):
    Information about how to enable discovery for agents on supported runtimes.
-   [Build and deploy an AI agent to Cloud Run using the Agent Development Kit (ADK)](https://docs.cloud.google.com/run/docs/ai/build-and-deploy-ai-agents/deploy-adk-agent.md.txt):
    An example of how to build and deploy an AI agent to Cloud Run using ADK for
    Python.
-   [AI and ML perspective: Security](https://docs.cloud.google.com/architecture/framework/perspectives/ai-ml/security.md.txt):
    An overview of principles and recommendations to help ensure that AI and ML
    deployments meet security and compliance requirements.
-   [AI and ML perspective: Reliability](https://docs.cloud.google.com/architecture/framework/perspectives/ai-ml/reliability.md.txt):
    An overview of the principles and recommendations to design and operate
    reliable AI and ML systems on Google Cloud. It describes how to integrate
    advanced reliability practices and observability into your architectural
    blueprints.
-   [AI and ML perspective: Operational excellence](https://docs.cloud.google.com/architecture/framework/perspectives/ai-ml/operational-excellence.md.txt):
    An overview of the principles and recommendations to build and operate
    robust AI and ML systems on Google Cloud. These recommendations help you set
    up foundational elements like observability, automation, and scalability.
-   [AI and ML perspective: Cost optimization](https://docs.cloud.google.com/architecture/framework/perspectives/ai-ml/cost-optimization.md.txt):
    An overview of principles and recommendations to optimize the cost of AI
    systems throughout the ML lifecycle.
-   [AI and ML perspective: Performance optimization](https://docs.cloud.google.com/architecture/framework/perspectives/ai-ml/performance-optimization.md.txt):
    An overview of the principles and recommendations to help you optimize the
    performance of AI and ML workloads on Google Cloud. These recommendations
    help you make decisions about factors like the model architecture,
    parameters, and training strategy.
-   [Well-Architected Framework: Sustainability pillar](https://docs.cloud.google.com/architecture/framework/sustainability/printable.md.txt):
    Provides recommendations to design, build, and manage workloads in Google
    Cloud that are energy-efficient and carbon-aware.
-   [Agent Runtime supported languages and frameworks](https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime.md.txt#supported-languages-and-frameworks):
    Details the supported languages, frameworks, and container runtime contract
    for Agent Runtime.
-   [Agent Gateway overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/govern/gateways/agent-gateway-overview.md.txt):
    An overview of Agent Gateway, which is the networking component of the
    Gemini Enterprise Agent Platform ecosystem.
-   [agents-cli overview](https://github.com/google/agents-cli): Information and
    FAQ for the Agents CLI and skills for building agents on Gemini Enterprise
    Agent Platform.
-   [agents-cli development guide](https://google.github.io/agents-cli/guide/development/):
    The full development workflow for Agents CLI, from defining what to build to
    monitoring it in production.

License (Apache-2.0)

View full license text
Licensed under the Apache License, Version 2.0. See https://github.com/google/skills/blob/main/LICENSE