Beginner

Google Cloud GenAI Offerings

Google Cloud’s GenAI advantage: prebuilt offerings, Gemini, Vertex AI agents and exam preparation.

Table of Contents

  1. Module 1 — Google Cloud’s GenAI Advantage
  2. Module 2 — Prebuilt GenAI Offerings for AI-powered Work
  3. Module 3 — Improving Customer Experience with GenAI
  4. Module 4 — Building with AI and Agents on Google Cloud
  5. Module 5 — Exam Preparation
  6. Python Code Examples — Vertex AI SDK
  7. Gemini Model Comparison
  8. Google Cloud AI vs AWS AI vs Azure AI
  9. Google Cloud GenAI Pricing
  10. Architecture Diagrams
  11. Key Concepts and Terminology

Module 1 — Google Cloud’s GenAI Advantage

Why Google Cloud for GenAI?

Google’s AI evolution spans more than 25 years. Here are the foundational milestones:

YearEvent
2001Google transforms its search engine into a machine learning environment (“Did you mean” feature)
2014Acquisition of DeepMind — first breakthrough: AI that learns to play Atari games from raw pixels
2015Open source release of TensorFlow — worldwide democratization of AI
2016Sundar Pichai announces the “AI first” strategy (replacing “mobile first”)
2017Publication of “Attention Is All You Need” — introduction of the Transformer architecture
2021Launch of LaMDA (Language Model for Dialogue Applications)
2023Launch of Bard, then Duet AI for Workspace
2024Gemini 1.0 then Gemini 1.5 with a 1M token context window
2025Gemini 2.0 — Flash, Pro, Ultra with native agentic capabilities

The significance of TensorFlow:

  • Democratized AI at a global scale
  • Created an ecosystem around Tensor Processing Units (TPUs)
  • TPUs are the gold standard for training and inference of foundation models

The Transformer Architecture: The “Attention Is All You Need” paper introduced the attention mechanism, allowing models to understand relationships between tokens regardless of their distance. This is the foundation of all modern LLMs (GPT, Gemini, Claude, LLaMA).

$$\text{Attention}(Q,K,V) = \text{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V$$


Enterprise-ready AI at Scale

For AI to be enterprise-ready, it must meet several critical requirements:

The Four Pillars of Enterprise-Readiness

graph TD
    ERA["Enterprise-Ready AI"]
    ERA --> RA["Responsible AI\nEthical principles\nTransparency\nAccountability"]
    ERA --> EG["Enterprise Governance\nAccess policies\nCompliance guardrails\nAudit trails"]
    ERA --> DP["Data Privacy\nData isolation\nOrganizational control\nNo public training exposure"]
    ERA --> SEC["Security\nEncryption in transit and at rest\nGranular IAM\nContinuous monitoring"]

Reliability at Scale — Evidence by Example

Google ServiceProof of Reliability
GmailContinuous availability for 3+ billion users
Google SearchProcessing 8.5+ billion queries/day with consistent performance
YouTube500+ hours of video uploaded per minute — global streaming
Google MapsBillions of real-time navigation queries

The same infrastructure that powers Gmail and Google Search underpins Google Cloud AI for enterprises — a guarantee of SLA, scalability, and resilience.


A Unified and Open AI Ecosystem

Google’s strategy is “AI everywhere”: Gemini serves as the reasoning engine integrated throughout the entire Google stack.

Gemini in Google Workspace

graph TD
    Gemini["Gemini\n(Foundation Model)"]
    Gemini --> Gmail["Gmail\nComposing, summarizing,\nprioritization"]
    Gemini --> Drive["Google Drive\nIntelligent search\nFile summarization"]
    Gemini --> Docs["Google Docs\nContent generation\nClarity improvement"]
    Gemini --> Sheets["Google Sheets\nTrend interpretation\nFormula recommendations"]
    Gemini --> Slides["Google Slides\nContent structuring\nPresenter notes"]
    Gemini --> Calendar["Google Calendar\nAssisted scheduling"]
    Gemini --> Meet["Google Meet\nAutomatic summaries\nDecision capture"]

Gemini Integrated into Google Cloud Services

Google Cloud ServiceIntegrated Gemini Capability
BigQueryNatural language data exploration, SQL query generation, insight summarization
LookerReport creation, trend explanation, narrative insights
Security Operations (SecOps)Threat summarization, incident investigation, AI prioritization
FirebaseCode generation, debugging, intelligent application experiences
Cloud Spanner / AlloyDBNatural language queries, schema optimization
Colab EnterpriseCode generation, debugging, notebook explanation

Vertex AI Model Garden — Open Ecosystem

Model Garden is Google Cloud’s centralized AI model catalog:

mindmap
  root((Model Garden))
    Google Models
      Gemini Pro / Flash / Ultra
      Imagen 3
      Codey
      Chirp 2 (Speech)
      MedPaLM 2
    Open Source
      Llama 3 / 3.1 / 3.2
      Mistral / Mixtral
      Falcon
      Gemma 2 / 3
      Phi-3
    Third Party
      Anthropic Claude
      AI21 Labs Jamba
      Cohere Command

The ecosystem is intentionally open — Google Cloud is not limited to internally developed models. This is a major differentiator versus a closed ecosystem.


Infrastructure Optimized for GenAI

graph TB
    subgraph "Google Cloud GenAI Infrastructure Stack"
        L4["AI Platforms & Models\nVertex AI · Gemini · Foundation Models\nAgent Builder · AutoML"]
        L3["Hypercomputer Orchestration\nDistributed Training · Large-scale Inference\nSeamless Scaling · No manual management"]
        L2["Custom TPU & GPU Accelerators\nGoogle TPUs v4/v5 · High-performance GPUs A100/H100\nSuperior cost-efficiency vs generic solutions"]
        L1["Global Data Centers\nHigh availability · Low latency\nEnergy efficiency · 35+ regions worldwide"]
    end
    L4 --> L3
    L3 --> L2
    L2 --> L1

TPUs vs GPUs — When to Use Which?

CriterionTPU (Tensor Processing Unit)GPU (Graphics Processing Unit)
DesignCustom Google hardware for MLGeneral purpose + ML
Optimal forTraining large models, batch inferenceVaried ML workloads, fine-tuning
ParallelismMassive matrix multiplicationGeneral CUDA cores
Cost efficiencySuperior for large-scale LLMsFlexible, more universal
AvailabilityGoogle Cloud exclusivelyMulti-cloud
Current generationTPU v4, v5e, v5pA100, H100 available

Module 2 — Prebuilt GenAI Offerings for AI-powered Work

From Models to Everyday Work with Gemini

The transformation of Gemini into business value follows a logical 4-step progression:

graph LR
    A["Model\n(Foundation)"] --> B["Integration\n(Into Workspace\nand Cloud tools)"]
    B --> C["Interface\n(User UI/UX\nDocs, Gmail, BigQuery...)"]
    C --> D["Data\n(Organization data\nInternal knowledge base)"]

    style A fill:#4285f4,color:#fff
    style B fill:#34a853,color:#fff
    style C fill:#fbbc04,color:#000
    style D fill:#ea4335,color:#fff

Analogy: Gemini is like an engine — powerful on its own, but it only creates real value when integrated into a complete vehicle (with its interface and fuel — the data).

Real Multimodal Use Cases

ScenarioInput TypesGenAI Output
Executive briefingMeeting transcripts + slides + spreadsheetsExecutive brief with risks and recommendations
Customer supportCustomer history + knowledge base + audioContextual real-time resolution
Product analysisDefect images + technical reports + historical dataAnomaly report with corrective recommendations
RecruitingResumes + job descriptions + recorded interviewsCandidate ranking and comparative insights
Financial analysisAnnual reports + market data + newsRisk and opportunity synthesis

Gemini App and Gemini Advanced

Gemini App — Three Adaptive Roles

graph TD
    User["User"]
    User -->|"Inbox management\nand priorities"| RA["Research Assistant\nCondenses email threads\nSurfaces key actions\nPrioritizes attention"]
    User -->|"Content creation\nand analysis"| WP["Writing Partner\nStructures ideas\nRefines tone\nClarifies message\nAdapts to audience"]
    User -->|"Presentation\npreparation"| RC["Reasoning Collaborator\nOrganizes thoughts\nIdentifies logic gaps\nImproves arguments\nStrengthens conclusions"]

Gemini Gems — Customization by Use Case

Gems are customizable versions of Gemini designed for specific tasks, roles, or workflows.

Key characteristics:

  • Created once with clear instructions → consistent behavior on each use
  • Two types: Google premade Gems + user-created custom Gems

Example HR Gem:

Name: Technical Recruiter
Instructions: You are a specialized technical recruiter.
              For each submitted resume, systematically identify
              and list cloud and coding certifications present.
              Format output as: NAME / CERTIFICATION / LEVEL
              Assign a score from 1 to 10 based on alignment
              with the Senior Cloud Architect position.

Other useful enterprise Gems:

GemRoleExample Instructions
Code ReviewerCode reviewAnalyze code, identify OWASP Top 10 vulnerabilities, suggest performance improvements
Legal SummarizerLegal summaryCondense contracts to key points, identify risky clauses
Data AnalystData analysisInterpret tables, propose visualizations, explain trends
Customer EmailCustomer communicationDraft professional responses adapted to escalation level

Gemini Access Level Comparison

FeatureGemini App (free)Gemini AdvancedGemini BusinessGemini Enterprise
Basic chat
Multimodal (image, audio)✅ limited
Custom GemsLimited✅ Full
Workspace integrationPartial
Model usedGemini FlashGemini Pro/UltraGemini ProGemini Ultra
Enterprise governance
Data isolation
NotebookLM Enterprise
Configurable agents

Enterprise Capabilities of Gemini

Security and Data Control

Data isolation — Everything teams submit remains isolated from public model training:

  • Proprietary source code
  • Customer data and medical records
  • Legal documents and contracts
  • Internal financial projections
  • Product plans and roadmaps

Integrated Google Cloud security architecture:

graph LR
    subgraph "Gemini Enterprise Security"
        IAM["IAM\nIdentity and Access\nManagement"]
        DLP["DLP\nData Loss\nPrevention"]
        ENC["Encryption\nAt rest and in transit\nCMEK supported"]
        AUDIT["Audit Logging\nWho · What · When\nCompliance trails"]
        CERTIF["Certifications\nSOC 2 · ISO 27001\nHIPAA · PCI DSS"]
    end

NotebookLM — AI Workspace Anchored in Your Sources

NotebookLM is an AI workspace designed for thinking, researching, and synthesizing information based on curated sources.

Fundamental difference from a generic chatbot:

Generic ChatbotNotebookLM
General internet knowledgeAnchored in YOUR documents only
Potentially off-context responsesResponses traceable to exact sources
Possible hallucinations on internal dataGrounded in approved materials
No editorial controlSources controlled by the user
No citationInline citations with reference to the source document

Supported source types:

  • PDFs, Google Docs, Google Slides
  • Websites (URLs)
  • Copied text and transcriptions
  • Audio files (up to 8 hours)
  • YouTube videos

NotebookLM Interface:

  • Sources panel (left): source management and addition — max 50 sources / 25M tokens per notebook
  • Work area (center): interaction, anchored Q&A
  • Studio panel (right): synthesis generation, Audio Overview (podcast), case studies

Gemini for Google Workspace

Capabilities by Application

graph TD
    subgraph Gmail["Gmail"]
        G1["Composing contextual replies"]
        G2["Summarizing long email threads"]
        G3["Surfacing next steps"]
        G4["Adapting tone by recipient"]
    end
    subgraph Docs["Google Docs"]
        D1["Generating initial drafts"]
        D2["Improving clarity and style"]
        D3["Adapting content by audience"]
        D4["Reformatting and restructuring"]
    end
    subgraph Sheets["Google Sheets"]
        S1["Interpreting trends"]
        S2["Recommending formulas"]
        S3["Summarizing numerical data"]
        S4["Projection and predictive analysis"]
    end
    subgraph Slides["Google Slides"]
        SL1["Structuring slide content"]
        SL2["Refining key messages"]
        SL3["Creating presenter notes"]
        SL4["Transforming docs into decks"]
    end
    subgraph Meet["Google Meet"]
        M1["Automatic meeting summaries"]
        M2["Capturing key decisions"]
        M3["Generating action items"]
        M4["Catch-up for absentees"]
    end

End-to-end Workflow Example

Scenario: Leadership team meeting

1. DURING THE MEETING (Meet)
   └── Gemini automatically captures the discussion, transcribes and analyzes

2. AFTER THE MEETING (automatic — within seconds)
   └── Summary generated with decisions, actions, and owners

3. DRAFTING THE MEETING NOTES (Docs)
   └── Gemini structures the document from the Meet summary + past context

4. SENDING TO STAKEHOLDERS (Gmail)
   └── Gemini adapts tone and detail level by recipient
       (detailed version for team / executive version for the board)

5. TRACKING ACTIONS (Sheets)
   └── Automatic dashboard with statuses, owners, and deadlines

Module 3 — Improving Customer Experience with GenAI

How GenAI Transforms Customer Experience

The Three Pillars of Modern CX

graph TD
    CX["Modern Customer\nExperience"]
    CX --> Search["Search\nImmediate answers\nIn business context"]
    CX --> Conv["Conversation\nNatural interactions\nHuman-like without friction"]
    CX --> Pers["Personalization\nExperiences adapted\nto history and preferences"]

Before vs After GenAI in the Contact Center

DimensionBefore GenAIWith GenAI
Resolution time8–15 minutes (manual search)1–3 minutes (automatic suggestions)
Customer satisfactionFrustration from waitingFirst-contact resolution
Agent workloadManual document lookupFocus on empathy and added value
ConsistencyVaries by agentStandardized on approved knowledge base
AnalyticsManual sampling (5–10% of calls)100% of interactions analyzed
MultilingualismDedicated agents per languageIntegrated real-time translation

GenAI Flow in the Contact Center

sequenceDiagram
    participant C as Customer
    participant VA as Virtual Agent
    participant AA as Agent Assist
    participant H as Human Agent
    participant CI as Insights

    C->>VA: Asks a question (chat/voice)
    VA->>VA: Understands intent (NLU)
    VA->>C: Autonomous resolution (simple cases 70%)
    C->>H: Transfer for complex cases
    AA->>H: Real-time suggestions + relevant docs
    H->>C: AI-assisted response
    H->>CI: Automatic interaction log
    CI->>CI: Analyzes trends and sentiment

AI-powered Search Experiences

graph LR
    A["Traditional Search\n- Keyword matching\n- Results: list of links\n- Effort on user side\n- Intent not understood"] -->|"AI Revolution"| B["AI-powered Search\n- Natural language understanding\n- Direct synthesized answer\n- Anchored in enterprise content\n- Intent understood = Discovery"]

Vertex AI Search — Multimodal Capabilities

Input TypeEnterprise Use ExampleOutput
Natural language text”What is our reimbursement policy for international orders?”Direct answer citing the policy
Speech and audioSearch through 10,000h of call transcriptionsRecurring complaints, sentiment trends
ImagesUpload a product defect photoDefect identification + corrective procedure
VideoAnalysis of training recordingsKey point extraction, timestamps
Structured documentsAnalysis of invoices, contracts, HR formsEntity extraction, automatic classification

Dialogflow CX and Agent Assist

Contact Center AI (CCAI) Architecture

graph TD
    Customer["Customer"] --> |"Phone call\nChat / Email"| ENTRY["Entry point\nCCAI Platform"]

    subgraph CCAI["Contact Center AI — Google Cloud"]
        VA["Virtual Agent\n(Dialogflow CX)\n- Autonomous resolution\n- Multi-turn conversations\n- CRM integration\n- Intelligent escalation"]
        AA["Agent Assist\n- Real-time suggestions\n- Document snippets\n- Smart reply\n- Automatic summary"]
        CI["Conversational Insights\n- 100% interaction analysis\n- Sentiment detection\n- Recurring topics\n- Operational KPIs"]
    end

    ENTRY --> VA
    VA -->|"Complex cases"| Human["Human Agent"]
    AA --> Human
    Human --> CI
    VA --> CI

    subgraph "Backend Integrations"
        CRM["CRM\n(Salesforce, SAP)"]
        KB["Knowledge\nBase"]
        DB["Databases"]
    end

    VA & AA --> CRM & KB & DB

Dialogflow CX vs Dialogflow ES

CriterionDialogflow ES (Essentials)Dialogflow CX (Customer Experience)
ComplexitySimple conversationsComplex multi-turn conversations
Context managementLinearVisual flowchart (pages/flows)
Versioning/environmentsLimitedFull versioning + A/B testing
Use caseSimple chatbots, FAQEnterprise contact centers, complex journeys
IntegrationsStandardAdvanced webhooks, persistent state
AnalyticsBasicAdvanced with Conversational Insights

Agent Assist — Real-time Assistance

FeatureDescriptionImpact
Smart ReplyContext-based response suggestions-40% drafting time
Knowledge AssistKB snippets surfaced automaticallyResolution without hold time
Call SummaryAuto-generated summary after the call-60% post-call work time
Article SuggestionRelevant articles based on current conversationConsistent responses
CSAT PredictionReal-time satisfaction predictionProactive intervention

Module 4 — Building with AI and Agents on Google Cloud

Developer Choice, Control, and Accessibility

Data Protections — Always-on vs Configurable

graph TD
    subgraph "Always-On Protections"
        P1["Proprietary data isolation\n(excluded from public model training)"]
        P2["Encryption in transit (TLS 1.3)"]
        P3["Encryption at rest (AES-256)"]
        P4["Interception protection"]
    end

    subgraph "Configurable Protections"
        C1["Data Sovereignty Controls\n(storage and processing location)"]
        C2["IAM Policies\n(granular roles and permissions)"]
        C3["VPC Service Controls\n(security perimeters)"]
        C4["CMEK — Customer-Managed Encryption Keys"]
        C5["Audit Logging\n(complete traceability)"]
    end

Audit Logging — Governance and Compliance

Audit logging systematically records:

  • Who accessed the data (user / service account)
  • What requests were submitted (prompt content)
  • How outputs were generated (model, version, context)
  • When each interaction took place (precise timestamp)

Vertex AI Platform Essentials

Vertex AI sits in the platform layer of the AI stack. It provides a managed environment to traverse the entire machine learning lifecycle.

The ML Lifecycle in Vertex AI

graph LR
    subgraph "Prepare Data"
        PD1["Dataset management\nLabeling · Versioning"]
        PD2["Feature Store\nReusable features"]
    end
    subgraph "Model Development"
        MD1["Model Garden\nModel selection"]
        MD2["Training / AutoML\nCustom training"]
        MD3["Evaluation\nMetrics and benchmarks"]
        MD4["Vertex AI Studio\nPrompt experimentation"]
    end
    subgraph "Deploy and Use"
        DU1["Deployment\nManaged endpoints"]
        DU2["Monitoring\nModel drift · Performance"]
        DU3["Lifecycle Management\nVersions · Rollback"]
    end

    PD1 & PD2 --> MD1
    MD1 --> MD2
    MD2 --> MD3
    MD3 --> MD4
    MD4 --> DU1
    DU1 --> DU2
    DU2 --> DU3

Model Garden — Centralized Catalog

Model categories in Model Garden:

CategoryKey ModelsUse Cases
Text GenerationGemini Pro/Flash/UltraChat, summarization, Q&A, reasoning
CodeGemini Code, CodeyCode generation, review, debugging
ImageImagen 3Text-to-image, editing, variation
SpeechChirp 2Speech-to-text, transcription
Embeddingtext-embedding-004Semantic vectorization, RAG
VisionGemini VisionImage and video analysis
MedicalMedPaLM 2Medical Q&A, clinical summarization
Open-sourceLlama 3.1, Gemma 2, MistralCustom fine-tuning

AutoML — Training Without Deep ML Expertise

What AutoML completely abstracts:

  • Automatic feature engineering
  • Model architecture selection
  • Hyperparameter tuning (Neural Architecture Search)
  • Compute infrastructure (auto-scaling)
  • Evaluation and selection of the best model

AutoML supported problem types:

TypeInputOutputExample
Tabular classificationCSV tableClassesPredict customer churn
Tabular regressionCSV tableNumeric valuePredict inventory needs
Image classificationLabeled imagesClassesProduct defect detection
Object detectionAnnotated imagesBounding boxesVisual inventory
Text classificationLabeled textClassesTicket categorization
Video classificationLabeled videosClassesBehavior analysis

Retrieval-Augmented Generation (RAG) on Google Cloud

The Gap Between Public Models and Enterprise Needs

graph TD
    subgraph "Public Foundation Models"
        PUB1["Strong general knowledge"]
        PUB2["Good for common low-risk tasks"]
        PUB3["No access to internal data"]
        PUB4["Hallucinations on specific data"]
        PUB5["Potentially outdated training data"]
        PUB6["Not aligned with organizational governance"]
    end

    RAG["RAG\n(Retrieval-Augmented Generation)\nBridges the enterprise gap"]

    subgraph "Enterprise Needs Addressed by RAG"
        ENT1["Responses aligned with verified information"]
        ENT2["High accuracy for critical decisions"]
        ENT3["Secure access to internal knowledge bases"]
        ENT4["Traceable, evidence-based responses"]
        ENT5["Up-to-date policies and products"]
        ENT6["Compliance with access rules"]
    end

    PUB1 -.->|"Augmented by"| RAG
    RAG -.->|"Produces"| ENT1

Complete RAG Pipeline — Step by Step

sequenceDiagram
    participant U as User
    participant R as Retriever
    participant VDB as Vector Database
    participant EMBED as Embedding Model
    participant LLM as Gemini LLM
    participant KB as Knowledge Base

    Note over KB,EMBED: Ingestion phase (offline)
    KB->>EMBED: Document chunks
    EMBED->>VDB: Vectors (embeddings)

    Note over U,LLM: Query phase (real-time)
    U->>R: Submits a question
    R->>EMBED: Vectorizes the question
    EMBED->>VDB: Semantic search (cosine similarity)
    VDB-->>R: Top-K relevant chunks
    R->>LLM: Question + augmented context
    LLM-->>U: Response anchored in internal sources

Detailed RAG pipeline steps:

StepActionGoogle Cloud Technology
1. IngestionInternal documents split into chunksCloud Storage + Document AI
2. VectorizationEach chunk converted to an embeddingtext-embedding-004
3. StorageVectors stored in a vector databaseVertex AI Vector Search
4. QueryUser asks a questionVertex AI Studio / API
5. SearchNearest chunks retrievedCosine similarity search
6. AugmentationQuestion + chunks = final promptPrompt Management
7. GenerationLLM generates an anchored responseGemini Pro / Flash

Building Agents with Tools and Studios

Cloud Services at the Foundation of Agents

graph TD
    Agent["AI Agent\n(Vertex AI Agent Builder)"]

    subgraph "Data Services"
        CS["Cloud Storage\nDocuments and policies"]
        DB["Cloud SQL / Spanner\nCustomer history · Transactions"]
        FS["Firestore\nReal-time data"]
    end

    subgraph "Compute Services"
        CR["Cloud Run\nContainer-based runtime\nBusiness logic"]
        CF["Cloud Functions\nEvent-driven\nPoint-in-time actions"]
    end

    subgraph "Language Services"
        TTS["Text-to-Speech\nNatural audio responses"]
        STT["Speech-to-Text (Chirp)\nReal-time transcription"]
        TR["Cloud Translation\n130+ language support"]
    end

    subgraph "Media Intelligence"
        VA["Vision AI\nImage interpretation"]
        DP["Document AI\nInvoice/contract extraction"]
        VID["Video Intelligence\nVideo analysis"]
    end

    Agent --> CS & DB & FS
    Agent --> CR & CF
    Agent --> TTS & STT & TR
    Agent --> VA & DP & VID

Vertex AI Agent Builder — Key Components

ComponentFunctionCode Level
Agent Builder ConsoleNo-code interface for building agentsNo-code
GroundingAnchor responses to specific sourcesConfiguration
Tool use (Function Calling)Connect agents to external APIsLow-code
ExtensionsIntegration with Google services (Gmail, Calendar)No-code
Multi-agent orchestrationCoordination of multiple specialized agentsLow-code
EvaluationTest and measure response qualityConfiguration

Complete example of a customer support agent:

E-COMMERCE CUSTOMER SUPPORT AGENT FLOW

1. Customer: "I haven't received my order #54321"
   NLU result: Intent = track_order, Entity = order_id:54321

2. Function Call → Cloud SQL
   SELECT status, estimated_delivery FROM orders WHERE id='54321'
   Result: "In transit, estimated delivery tomorrow"

3. Function Call → Knowledge Base (RAG)
   Retrieves the late delivery policy
   Includes tracking number and carrier

4. Gemini generates the contextualized response:
   "Your order #54321 is currently in transit with
    UPS (tracking: 1Z999...). Delivery is expected
    tomorrow before 6 PM. If you don't receive it,
    contact us and we'll open a dispute immediately."

5. Customer satisfaction: question resolved in 3 seconds
   Automatic log in Conversational Insights

Module 5 — Exam Preparation

Approach Strategy for the Google Cloud Generative AI Leader Exam

Recommended elimination methodology:

  1. Identify clearly wrong answers first (quick elimination)
  2. Look for the keyword that reveals the intent in the question
  3. Compare remaining answers against the use case context
  4. Choose the most efficient solution — Google Cloud rewards efficiency and managed services

Question 1 — Google Cloud’s GenAI Advantage

Question: A developer team wants to build a specialized application. They prefer Vertex AI but need to use a specific open-source model alongside Gemini. Which feature satisfies this requirement?

OptionVerdictReason
B. “Locked Ecosystem” policyIncorrectGoogle Cloud is intentionally open, not closed
C. Manual porting to TPUsIncorrectVertex AI abstracts infrastructure management
D. Text models onlyIncorrectVertex AI supports text, image, audio, video, code
A. Vertex AI Model GardenCorrectSingle catalog for Google, open-source, and third-party models

Question 2 — Prebuilt GenAI for AI-powered Work

Question: An HR manager wants to create a reusable version of Gemini pre-programmed to always act as a “technical recruiter” with persistent instructions. Which feature is most appropriate?

OptionVerdictReason
C. NotebookLMIncorrectFor source document analysis — not reusable personas
A. Gemini Advanced SearchIncorrectImproves retrieval — doesn’t create persistent behaviors
D. Gemini ExtensionsIncorrectConnects to external tools — doesn’t define a constant role/tone
B. GemsCorrectCustomized versions with persistent, reusable instructions

Question 3 — Improving Customer Experience with GenAI

Question: During a critical call, a representative struggles to find a warranty clause. Which GenAI capability would provide real-time suggested responses and document snippets during the call?

OptionVerdictReason
D. Vertex AI PipelinesIncorrectOrchestrates ML workflows — not live assistance
B. Vertex AI Model GardenIncorrectModel selection — not real-time assistance
A. Conversational InsightsIncorrectPost-interaction — analyzes after the call, not during
C. Agent AssistCorrectReal-time suggestions + snippets during the active call

Key distinction: Conversational Insights = post-interaction. Agent Assist = real-time during the interaction.


Question 4 — Building with AI and Agents on Google Cloud

Question: A retail team has excellent data but lacks ML expertise. They want to predict inventory needs based on weather patterns. Which Vertex AI capability should they use?

OptionVerdictReason
A. Managed PipelinesIncorrectAssumes a team capable of writing training code
C. Vertex AI StudioIncorrectFor foundation models and prompts — not tabular prediction models
D. Model Garden + local fine-tuningIncorrectLocal fine-tuning requires significant ML expertise
B. AutoMLCorrectAutomatically trains and optimizes — “no-code” approach

Revealing keyword: “lacks deep machine learning coding expertise” → no-code solution = AutoML.


Python Code Examples — Vertex AI SDK

Installation and Setup

# pip install google-cloud-aiplatform

import vertexai
from vertexai.generative_models import GenerativeModel, Part, GenerationConfig

# Initialize the project and region
PROJECT_ID = "my-gcp-project"
LOCATION = "us-central1"  # or europe-west1, us-east1, etc.

vertexai.init(project=PROJECT_ID, location=LOCATION)

Gemini — Text Generation

from vertexai.generative_models import GenerativeModel, GenerationConfig

# Initialize the model
model = GenerativeModel("gemini-2.0-flash-001")

# Generation configuration
gen_config = GenerationConfig(
    temperature=0.3,         # 0.0 = deterministic, 1.0 = creative
    top_p=0.90,              # Nucleus sampling
    top_k=35,                # Top-K sampling
    max_output_tokens=1024,  # Max response length
)

# Simple generation
response = model.generate_content(
    "List five advantages of using Vertex AI in an enterprise setting.",
    generation_config=gen_config
)
print(response.text)

# With system instructions
model_with_system = GenerativeModel(
    "gemini-2.0-flash-001",
    system_instruction=[
        "You are a cloud computing expert specializing in Google Cloud.",
        "Always respond in English.",
        "Be precise and concise. Maximum 3 sentences per point."
    ]
)

response = model_with_system.generate_content(
    "What are the differences between Vertex AI and AI Studio?"
)
print(response.text)

# Structured JSON generation
import json

response_json = model.generate_content(
    """Analyze this text and return structured JSON:
    "Customer Alice Johnson ordered 4 items on March 5, 2025.
     The order is in transit. Expected delivery on March 9."
    
    Expected JSON format:
    {
      "customer": string,
      "item_count": number,
      "order_date": string,
      "status": string,
      "estimated_delivery": string
    }""",
    generation_config=GenerationConfig(
        response_mime_type="application/json"
    )
)

data = json.loads(response_json.text)
print(f"Customer: {data['customer']}")
print(f"Status: {data['status']}")

Gemini — Multimodal (image + text)

from vertexai.generative_models import GenerativeModel, Part

# Multimodal model
model = GenerativeModel("gemini-2.0-pro-001")

# Analyze an image from a GCS bucket
image_part = Part.from_uri(
    uri="gs://my-bucket/images/product-defect.jpg",
    mime_type="image/jpeg"
)

response = model.generate_content([
    image_part,
    "Identify the type of defect visible in this product image. "
    "Classify it from these categories: [scratch, crack, deformation, contamination]. "
    "Rate the severity from 1 to 5. Suggest a corrective action."
])
print(response.text)

# Analyze multiple images in a single request
response_multi = model.generate_content([
    "Compare these two product images and identify the differences:",
    Part.from_uri("gs://bucket/imageA.jpg", mime_type="image/jpeg"),
    Part.from_uri("gs://bucket/imageB.jpg", mime_type="image/jpeg"),
])
print(response_multi.text)

# Analyze a video
video_part = Part.from_uri(
    uri="gs://my-bucket/videos/onboarding.mp4",
    mime_type="video/mp4"
)
response_video = model.generate_content([
    video_part,
    "Summarize the key takeaways from this onboarding video in 5 bullet points."
])
print(response_video.text)

Embeddings and RAG

from vertexai.language_models import TextEmbeddingModel
import numpy as np

# Generate embeddings
embed_model = TextEmbeddingModel.from_pretrained("text-embedding-004")

# Batch embeddings (efficient for ingestion)
documents = [
    "Gemini is Google's multimodal foundation model.",
    "RAG anchors LLM responses in verified sources.",
    "AutoML simplifies custom model training.",
]
batch_embeddings = embed_model.get_embeddings(documents)
vectors = [e.values for e in batch_embeddings]

# Cosine similarity calculation
def cosine_similarity(v1, v2):
    v1, v2 = np.array(v1), np.array(v2)
    return np.dot(v1, v2) / (np.linalg.norm(v1) * np.linalg.norm(v2))

query_embedding = embed_model.get_embeddings(["How does RAG work?"])[0].values
scores = [cosine_similarity(query_embedding, v) for v in vectors]
best_match = np.argmax(scores)
print(f"Most relevant chunk: {documents[best_match]}")
print(f"Similarity score: {scores[best_match]:.4f}")

# Complete RAG pipeline
from vertexai.generative_models import GenerativeModel

def rag_query(user_question: str, knowledge_base: list[dict], top_k: int = 3) -> str:
    """
    Simplified RAG pipeline:
    1. Vectorize the question
    2. Search for relevant chunks (cosine similarity)
    3. Augment the prompt
    4. Generate the anchored response
    """
    # Step 1: Vectorize the question
    query_vector = embed_model.get_embeddings([user_question])[0].values

    # Step 2: Semantic search
    ranked = []
    for item in knowledge_base:
        score = cosine_similarity(query_vector, item["vector"])
        ranked.append((score, item["text"]))
    ranked.sort(reverse=True)
    top_chunks = [text for _, text in ranked[:top_k]]

    # Steps 3 + 4: Augment and generate
    context_str = "\n\n".join([f"[Source {i+1}] {chunk}" for i, chunk in enumerate(top_chunks)])
    model = GenerativeModel("gemini-2.0-flash-001")

    augmented_prompt = f"""You are an enterprise assistant. Answer ONLY based on the
provided sources. If the answer is not in the sources, state that clearly.

SOURCES:
{context_str}

QUESTION: {user_question}

ANSWER (with source citations):"""

    return model.generate_content(augmented_prompt).text

# Usage
kb = [
    {"text": "The standard return policy is valid for 30 days after receipt.", "vector": vectors[0]},
    {"text": "International orders qualify for a 45-day return window.", "vector": vectors[1]},
]
for item in kb:
    item["vector"] = embed_model.get_embeddings([item["text"]])[0].values

answer = rag_query(
    "How many days do I have to return an international order?",
    kb
)
print(answer)

Vertex AI Search (code) {#vertex-ai-search-code}

from google.cloud import discoveryengine_v1 as discoveryengine

def search_enterprise_docs(query: str, project_id: str, data_store_id: str) -> dict:
    """
    Vertex AI Search — Search through an enterprise document corpus
    with synthesized responses and citations.
    """
    client = discoveryengine.SearchServiceClient()

    serving_config = client.serving_config_path(
        project=project_id,
        location="global",
        data_store=data_store_id,
        serving_config="default_config",
    )

    request = discoveryengine.SearchRequest(
        serving_config=serving_config,
        query=query,
        page_size=5,
        content_search_spec=discoveryengine.SearchRequest.ContentSearchSpec(
            summary_spec=discoveryengine.SearchRequest.ContentSearchSpec.SummarySpec(
                summary_result_count=5,
                include_citations=True,
                language_code="en",
            ),
            extractive_content_spec=discoveryengine.SearchRequest.ContentSearchSpec.ExtractiveContentSpec(
                max_extractive_answer_count=3,
            ),
        ),
    )

    response = client.search(request)

    results = []
    for result in response.results:
        doc = result.document
        results.append({
            "id": doc.id,
            "title": doc.derived_struct_data.get("title", ""),
            "snippet": doc.derived_struct_data.get("snippets", [{}])[0].get("snippet", ""),
        })

    return {
        "synthesized_answer": response.summary.summary_text,
        "sources": results
    }

# Usage
result = search_enterprise_docs(
    query="What is our PTO policy for part-time employees?",
    project_id="my-gcp-project",
    data_store_id="my-hr-document-store"
)
print(f"Synthesized answer: {result['synthesized_answer']}")
print(f"Number of sources: {len(result['sources'])}")

Vertex AI Agent Builder (code) {#vertex-ai-agent-builder-code}

from google.cloud import dialogflowcx_v3 as dialogflow

PROJECT_ID = "my-gcp-project"
LOCATION = "us-central1"
AGENT_ID = "my-agent-id"

def create_agent_session_handler(agent_id: str):
    """
    Creates a handler to interact with a Dialogflow CX agent.
    Returns a detect_intent function for multi-turn conversations.
    """
    session_client = dialogflow.SessionsClient(
        client_options={"api_endpoint": f"{LOCATION}-dialogflow.googleapis.com"}
    )
    import uuid
    session_id = str(uuid.uuid4())
    session_path = session_client.session_path(
        project=PROJECT_ID,
        location=LOCATION,
        agent=agent_id,
        session=session_id
    )

    def detect_intent(text: str, language_code: str = "en") -> dict:
        text_input = dialogflow.TextInput(text=text)
        query_input = dialogflow.QueryInput(
            text=text_input,
            language_code=language_code
        )
        request = dialogflow.DetectIntentRequest(
            session=session_path,
            query_input=query_input,
        )
        response = session_client.detect_intent(request=request)
        query_result = response.query_result

        return {
            "response_text": " ".join([
                msg.text.text[0]
                for msg in query_result.response_messages
                if msg.HasField("text")
            ]),
            "intent": query_result.intent.display_name,
            "confidence": query_result.intent_detection_confidence,
            "parameters": dict(query_result.parameters),
            "session_id": session_id,
        }

    return detect_intent

# Usage — multi-turn conversation
agent = create_agent_session_handler(AGENT_ID)

turn1 = agent("I haven't received my order number 98765")
print(f"Bot: {turn1['response_text']}")
print(f"Intent: {turn1['intent']} ({turn1['confidence']:.0%})")

turn2 = agent("It was supposed to arrive yesterday")
print(f"Bot: {turn2['response_text']}")

Streaming and Multi-turn Chat

from vertexai.generative_models import GenerativeModel, ChatSession

# Multi-turn chat with automatic history
model = GenerativeModel("gemini-2.0-flash-001")
chat: ChatSession = model.start_chat(history=[])

# Turn 1
response1 = chat.send_message("What is Vertex AI?")
print(f"Turn 1: {response1.text[:200]}...")

# Turn 2 — Turn 1 context included automatically
response2 = chat.send_message("What are its main services?")
print(f"Turn 2: {response2.text[:200]}...")

# Turn 3 — implicit reference thanks to context
response3 = chat.send_message("Which one is best suited for RAG?")
print(f"Turn 3: {response3.text[:200]}...")

# Streaming the response (real-time UX)
print("\nStreaming response:")
for chunk in model.generate_content(
    "Explain machine learning in simple terms.",
    stream=True
):
    print(chunk.text, end="", flush=True)
print()

Gemini Model Comparison

Gemini 2.0 Family — Comparison Table

CriterionGemini 2.0 FlashGemini 2.0 ProGemini 2.0 UltraGemini Nano
Use caseHigh volume, low latencyGeneral enterprise useUltra-complex tasksOn-device, mobile
Intelligence⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Speed⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡
Context window1M tokens2M tokens2M tokens32K tokens
MultimodalText, image, audio, videoText, image, audio, videoText, image, audio, videoText, image
Relative priceLowModeratePremiumVery low
ReasoningGoodExcellentExceptionalBasic
CodeGoodVery goodExceptionalLimited
DeploymentCloud + EdgeCloudCloud onlyOn-device
Function Calling✅ limited
Grounding

When to Choose Which Model?

graph TD
    Start["Which Gemini model to use?"]

    Start --> Q1{"On-device\nor mobile deployment?"}
    Q1 -->|Yes| Nano["Gemini Nano\n(Pixel, Android)"]
    Q1 -->|No| Q2{"Very high volume\nor critical latency?"}

    Q2 -->|Yes| Flash["Gemini 2.0 Flash\n- High-volume chatbots\n- Batch summarization\n- Classification"]
    Q2 -->|No| Q3{"Ultra-complex task?\n(research, deep analysis,\nmulti-step reasoning)"}

    Q3 -->|Yes| Ultra["Gemini 2.0 Ultra\n- Scientific analysis\n- Complex code\n- Advanced reasoning"]
    Q3 -->|No| Pro["Gemini 2.0 Pro\n- General enterprise use\n- RAG pipelines\n- Conversational agents"]

Specialized Google Cloud Models

ModelSpecialtyPrimary Use Case
Imagen 3Image generationMarketing, design, visual content
Codey (code-bison)Code generationIDE assistance, automated code review
Chirp 2Speech-to-textTranscription, subtitling, voice bots
text-embedding-004Semantic embeddingsRAG, semantic search, clustering
MedPaLM 2Medical AIMedical Q&A, clinical summarization
Sec-PaLMCybersecurityThreat analysis, AI SIEM
Gemma 2Lightweight open-sourceCustom fine-tuning, edge deployment

Google Cloud AI vs AWS AI vs Azure AI

Main Platforms

CriterionGoogle Cloud (Vertex AI)AWS (SageMaker + Bedrock)Azure (Azure AI + OpenAI)
ML PlatformVertex AIAmazon SageMakerAzure Machine Learning
Managed GenAI serviceVertex AI (Gemini)Amazon BedrockAzure OpenAI Service
Flagship modelGemini 2.0 Pro/UltraClaude 3.5 (Anthropic) + TitanGPT-4o (OpenAI)
Model catalogModel Garden (100+ models)Bedrock (30+ models)Azure AI Model Catalog (100+ models)
Open source supportLlama, Mistral, GemmaLlama, MistralLlama, Mistral, Phi
AutoMLVertex AI AutoMLSageMaker AutopilotAzure AutoML
RAG infrastructureVertex AI Search + Vector SearchKnowledge Bases (Bedrock)Azure AI Search
Agent frameworkVertex AI Agent BuilderBedrock AgentsAzure AI Agent Service
Voice/SpeechChirp 2Amazon TranscribeAzure Speech
Image generationImagen 3Amazon Titan ImageDALL-E 3 (Azure OpenAI)
Workplace integrationGoogle Workspace (native)Microsoft 365 Copilot (native)
Custom TPUTPU v4/v5 (Google exclusive)❌ (Trainium, Inferentia)❌ (standard GPU)
Max context window2M tokens (Gemini 2.0)200K (Claude 3.5)128K (GPT-4o)
Pricing modelPay-per-tokenPay-per-tokenPay-per-token
Native multimodalText, image, audio, videoVaries by modelGPT-4o

Specialized CX Services

FeatureGoogle CloudAWSAzure
Contact Center AICCAI (Dialogflow CX + Agent Assist)Amazon Connect + LexAzure Communication Services + Bot Service
Virtual AgentDialogflow CXAmazon LexAzure Bot Service
Agent AssistAgent Assist (CCAI)Amazon Connect WisdomAzure Contact Center (via Nuance)
Conversation AnalyticsConversational InsightsContact Lens (Amazon Connect)Azure Metrics Advisor
Enterprise SearchVertex AI SearchAmazon KendraAzure Cognitive Search

Google Cloud GenAI Pricing

Note: Prices are indicative. Check cloud.google.com/vertex-ai/pricing for current rates.

Gemini on Vertex AI — Per-token Rates

ModelInput (per 1M tokens)Output (per 1M tokens)Context > 128K
Gemini 2.0 Flash~$0.075~$0.30+50%
Gemini 2.0 Pro~$1.25~$5.00+50%
Gemini 1.5 Flash~$0.075~$0.30+50%
Gemini 1.5 Pro~$1.25~$5.00+50%
text-embedding-004~$0.025N/AN/A

Other GenAI Services

ServicePricing
Vertex AI Search~$2.50 / 1,000 queries
Imagen 3~$0.04 / generated image (1024x1024)
Chirp 2 Speech-to-Text~$0.016 / minute of audio
Dialogflow CX~$0.007 / session (text), ~$0.06 / session (voice)
Agent Assist~$0.06 / assisted session
Vector Search~$0.10 / 1,000 queries + storage

Cost Optimization Strategies

graph TD
    OPT["GenAI Cost Optimization"]
    OPT --> M1["Choose Flash for high-volume\nworkloads instead of Pro"]
    OPT --> M2["Batch requests for\nnon-real-time processing"]
    OPT --> M3["Cache responses\nfor recurring queries"]
    OPT --> M4["Context window management\n(truncate long conversations)"]
    OPT --> M5["Quotas and budgets\nvia Cloud Billing alerts"]
    OPT --> M6["Committed Use Discounts\nfor predictable volumes"]

Architecture Diagrams

Complete Google Cloud GenAI Ecosystem Architecture

graph TD
    subgraph "Users and Applications"
        U1["Workspace Users\nGmail · Docs · Sheets · Meet"]
        U2["Developers\nAPI · SDK · Vertex AI Studio"]
        U3["End Customers\nApps · Contact Centers · Web"]
    end

    subgraph "Gemini Model Family"
        G1["Gemini Ultra\nComplex tasks\nAdvanced reasoning"]
        G2["Gemini Pro\nGeneral enterprise use"]
        G3["Gemini Flash\nHigh volume · Low latency"]
        G4["Gemini Nano\nOn-device · Mobile"]
    end

    subgraph "Vertex AI Platform"
        MG["Model Garden\n100+ model catalog"]
        VAS["Vertex AI Studio\nNo-code experimentation"]
        VAB["Agent Builder\nAgent construction"]
        PIPE["Managed Pipelines\nML orchestration"]
        AML["AutoML\nNo-code training"]
        VS["Vector Search\nManaged vector database"]
    end

    subgraph "Specialized AI Services"
        VSearch["Vertex AI Search\nIntelligent enterprise search"]
        Dialogflow["Dialogflow CX\nAdvanced conversational agents"]
        AA["Agent Assist\nReal-time human agent support"]
        CI["Conversational Insights\nPost-interaction analysis"]
        NLM["NotebookLM\nCurated source analysis"]
        Imagen["Imagen 3\nImage generation"]
        Chirp["Chirp 2\nSpeech-to-Text"]
    end

    subgraph "Optimized Infrastructure"
        TPU["TPU v4/v5\nGoogle custom accelerators"]
        GPU["High-perf GPUs\nA100, H100"]
        DC["Global Data Centers\n35+ regions"]
        SEC["Security Layer\nIAM · Encryption · DLP · CMEK"]
    end

    U1 & U2 & U3 --> G1 & G2 & G3 & G4
    G1 & G2 & G3 --> MG & VAS & VAB
    VAB --> VSearch & Dialogflow & AA
    Dialogflow --> CI
    MG & AML & PIPE --> VS
    VS --> TPU & GPU
    TPU & GPU --> DC
    SEC --> DC

Key Concepts and Terminology

TermDefinition
GeminiGoogle’s multimodal foundation model (text, image, audio, video, code) — the reasoning engine integrated throughout the entire Google stack
Vertex AIGoogle Cloud’s managed ML platform covering the complete ML lifecycle, from data preparation to deployment
Model GardenCentralized catalog of 100+ AI models in Vertex AI: Google, open-source (Llama, Mistral, Gemma), third-party (Claude, Cohere)
AutoMLVertex AI capability for training custom models (tabular, image, text, video) without deep ML expertise
RAG (Retrieval-Augmented Generation)Technique anchoring LLM responses in verified document sources via vectorization + semantic search
Vertex AI Vector SearchManaged vector database service (ANN search) for RAG pipelines and semantic search
GemsCustomizable versions of Gemini with persistent instructions and personas for specific roles
NotebookLMAI workspace anchored in user-curated sources (up to 50 sources / 25M tokens) with inline citations
Agent AssistCCAI service providing real-time suggestions, document snippets, and summaries to human agents during active calls
Dialogflow CXEnterprise platform for building advanced conversational agents with visual flow management and multi-turn context
Conversational InsightsPost-interaction analysis service for 100% of conversations — sentiment, topics, trends, operational KPIs
Vertex AI SearchAI-powered enterprise search service: NLU, multimodal, synthesized responses anchored in approved corpus
TPU (Tensor Processing Unit)Google custom hardware accelerator optimized for ML/AI workloads — superior to general-purpose GPUs for LLMs
Vertex AI Agent BuilderNo-code/low-code environment for building AI agents (search, conversational, reasoning) on Google Cloud
Transformer ArchitectureFundamental deep learning architecture for LLMs (“Attention Is All You Need” paper, 2017, Google Brain)
Foundation ModelLarge model pre-trained on massive, heterogeneous data, adaptable to multiple use cases via prompting or fine-tuning
GroundingProcess of anchoring AI responses in verified data sources to reduce hallucinations
IAM (Identity and Access Management)System for managing identities and granular permissions on Google Cloud
DLP (Data Loss Prevention)Automatic policies preventing the leakage of sensitive data (PII, PHI, PCI)
CMEK (Customer-Managed Encryption Keys)Customer-managed encryption keys for full control of data at rest
MultimodalCapability to process and generate multiple media types in a single request (text, image, audio, video, code)
Context WindowMaximum number of tokens a model can process in a single request (Gemini 2.0: up to 2M tokens)
Function CallingModel capability to call external APIs and functions in a structured way for agents
EmbeddingDense vector representation of text capturing its semantic meaning, used for search and RAG
Imagen 3Google Cloud’s text-to-image generation model available in Vertex AI
Chirp 2Google’s speech recognition (ASR) model — supports 100+ languages with high accuracy
Vertex AI StudioNo-code web interface for experimenting with Gemini models, adjusting prompts, and exporting to code
HypercomputerGoogle’s orchestration layer that connects and coordinates thousands of compute resources for distributed training

Search Terms

google · cloud · genai · offerings · ai · foundations · artificial · intelligence · generative · gemini · vertex · agent · agents · model · question · search · services · ai-powered · architecture · capabilities · center · comparison · contact · customer

Interested in this course?

Contact us to book it or get a custom training plan for your team.