◉GEMINI LABJP
●2.5 ROUTE — From today, 12/1, calls to gemini-2.5-pro and 2.5-flash are rerouted to newer models automatically●CLI 0.71.1 — Gemini CLI stable is still v0.71.1, with a 0.73 nightly published on 11/30●INTRO END — Introductory pricing for 3.8, 3.7 and 3.6 Flash ends on 12/31. 30 days left●VERTEX — Developers are asking how to run Gemini CLI with Vertex AI credentials●NEON — Gemini 4 Neon became generally available on 11/18 (paid tier only)●IMAGE TEXT — A new test shows text inside an image can sway Gemini's answer●2.5 ROUTE — From today, 12/1, calls to gemini-2.5-pro and 2.5-flash are rerouted to newer models automatically●CLI 0.71.1 — Gemini CLI stable is still v0.71.1, with a 0.73 nightly published on 11/30●INTRO END — Introductory pricing for 3.8, 3.7 and 3.6 Flash ends on 12/31. 30 days left●VERTEX — Developers are asking how to run Gemini CLI with Vertex AI credentials●NEON — Gemini 4 Neon became generally available on 11/18 (paid tier only)●IMAGE TEXT — A new test shows text inside an image can sway Gemini's answer
Articles/API / SDK
◈ API / SDK/2026-03-19Advanced

Google Personal Intelligence × Gemini API — Build Personalized AI Experiences

Personal Intelligence enables Gemini to access Gmail, Google Photos, Calendar data for personalized responses. Implement Grounding with Google Services for custom apps.

Personal IntelligenceGemini API256PersonalizationGrounding4Google Workspace24

Google Personal Intelligence × Gemini API

March 2026 brought Personal Intelligence nationwide rollout. Gemini connects to Gmail, Google Photos, Calendar for personalized answers.

How Personal Intelligence Works

Personal Intelligence provides user account data (Gmail, Google Photos, Calendar, etc.) as Gemini context. User asks "Show me business trip photos," Gemini auto-retrieves from Photos + matches Calendar travel dates + returns relevant memories.

Core technology: Grounding with Google Services — Gemini accesses Google services real-time for personalized information.

Privacy-First Design

Personal Intelligence uses opt-in model. Disabled by default; users explicitly enable. Gemini never uses accessed data for model training.

Developers must request minimum-needed OAuth scopes and secure user consent.

Gemini API Grounding Implementation

Grounding with Google Search

import google.generativeai as genai
 
genai.configure(api_key="YOUR_API_KEY")
 
model = genai.GenerativeModel(
    "gemini-3.1-pro",
    tools=[genai.Tool(google_search=genai.GoogleSearch())]
)
 
response = model.generate_content(
    "Current Tokyo weather and recommended outfit?"
)
 
# Access grounding metadata
for candidate in response.candidates:
    if candidate.grounding_metadata:
        for chunk in candidate.grounding_metadata.grounding_chunks:
            print(f"Source: {chunk.web.uri}")

Real-time Grounding with Google Search adds latest web information to Gemini responses, with source attribution.

Grounding with Google Maps

model = genai.GenerativeModel(
    "gemini-3.1-pro",
    tools=[genai.Tool(google_maps=genai.GoogleMaps())]
)
 
response = model.generate_content(
    "Suggest 3 vegetarian-friendly lunch spots near Shibuya Station"
)

Maps Grounding provides real store info, reviews, and addresses for location-based queries.

Workspace Integration Automation

Interactions API for Workspace Automation

from google.cloud import aiplatform
from google.cloud.aiplatform import interactions
 
# Define agent
agent = interactions.Agent(
    model="gemini-3.1-pro",
    tools=[
        interactions.WorkspaceTool(
            scopes=["drive.readonly", "docs.readonly", "sheets"]
        )
    ],
    system_instruction="""
    You are Workspace assistant.
    Search Drive files, read Docs/Sheets,
    create new documents as requested.
    """
)
 
# Start session
session = agent.start_session(user_id="user-123")
 
# Execute Workspace task
response = session.send_message(
    "Find last month's monthly report in Drive. "
    "Extract sales data into a spreadsheet."
)

Interactions API enables Gemini to autonomously search Drive, read Docs, modify Sheets on user's behalf.

Google AI Pro/Ultra Workspace Features

These Workspace capabilities available via:

  • Google AI Pro ($19.99/month)
  • Google AI Ultra (premium tier)

Pro includes Gemini Advanced + full Workspace AI assistance. Ultra adds Deep Think, Project Mariner, advanced features.

Pixel Actions—Mobile AI Integration

2026 Pixel Drop introduced "Pixel Actions" enabling app control via Gemini. Example: "Book restaurant reservation"→ Gemini operates reservation app.

Developers integrate via App Actions API, declaring intents apps handle.

Personalized AI App Design Principles

Minimal Privilege Principle: Request only essential data access. Unnecessary scopes damage user trust.

Transparency: Show users exactly what data AI uses. Grounding metadata includes source information—always display it.

Staged Permission Expansion: Don't request all scopes upfront. Expand permissions as features get used.

Local Processing: Process personal data on-device when possible. Gemini Nano on-device model is complementary approach.

Example: Personal Email Assistant

def build_email_context(user_id):
    """Build Gemini system prompt from Gmail data"""
 
    # Fetch unread emails
    service = gmail_service()
    results = service.users().messages().list(
        userId='me',
        q='is:unread',
        maxResults=10
    ).execute()
 
    messages = results.get('messages', [])
    email_summary = "Recent unread emails:\n"
 
    for msg in messages:
        subject = get_email_subject(msg)
        sender = get_email_sender(msg)
        email_summary += f"- From {sender}: {subject}\n"
 
    return f"""
    You are helpful email assistant.
 
    User's recent emails:
    {email_summary}
 
    Help with:
    - Suggesting responses
    - Prioritizing emails
    - Finding information in past emails
    - Auto-organizing messages
    """
 
# Usage
context = build_email_context("user-123")
response = genai.GenerativeModel(
    "gemini-3.1-pro",
    system_instruction=context
).generate_content(
    "What's the key action item from recent emails?"
)

Building Personalized Applications

Principles enabling Gemini-powered personalization:

  1. OAuth 2.0 Secure: Implement proper OAuth flows; never store credentials
  2. Minimum Scopes: Request only necessary Google API permissions
  3. User Agency: Allow easy permission revocation; respect user choices
  4. Transparent Grounding: Always disclose data sources to users
  5. Graceful Degradation: Function without personal data when access unavailable

Wrapping up

Google Personal Intelligence + Gemini API enables building truly personalized AI applications accessing user Gmail, Photos, Calendar, Drive. Proper implementation respects privacy while delivering value.

Applications properly designed become indispensable assistants understanding personal context.

Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

◈ API / SDK2026-11-14
When JSON Shapes Drift Through Gemini's OpenAI Compatibility Layer: Three Steps to response_json_schema Without Rewriting Callers
If your OpenAI SDK code points at Gemini and structured output seems ignored, here is how to check whether a schema is actually sent, and how to move to the Gemini SDK's response_json_schema while keeping the same function boundary.
◈ API / SDK2026-10-30
An 'API key expired' Error Doesn't Always Mean Expired. Check Which Key Is Actually Sent Before You Renew It
A 400 with API_KEY_INVALID from the Gemini API cannot tell you whether the key expired or something else is wrong. A small diagnostic script checks env-var precedence and stray quotes first, run here against dummy keys.
◈ API / SDK2026-10-30
My ADK Agent Never Ran and Said 'API key expired' — Reading the Reason Code Gave Me a Triage Order
When ADK returns 400 INVALID_ARGUMENT 'API key expired. Please renew the API key.' on every run, check this order before assuming the key expired: read the reason code, compare shell and .env keys by their last four characters, then test the key alone over REST.