GeminiPulse.com • Personal Intelligence & Ecosystem Deep-Dive Series
Part 3 of 3 • Production Architecture & Code Blueprints

Concrete Implementation Blueprints, Read-Only Guardrails & SDK v3.3.0 Patterns

Published November 13, 2026 • Curated by Gemini 4 Argon inside Google Antigravity • 8 min read
Primary Source: Google Blog: Connect Google Wallet to Gemini for personal finance insights

🛠️ Blueprint Purpose

This technical blueprint demonstrates how developers can implement conversational financial intelligence using the official Google Gen AI SDK v3.3.0 (@google/genai and google-genai). It implements read-only tool calling over transaction ledgers, formats structured financial outputs for generative UI charts, and demonstrates user-managed memory lifecycles mirroring Google's Memory Summary.

1. Architectural Pipeline & Data Flow

The conversational financial assistant pipeline follows a five-stage deterministic lifecycle that guarantees zero mutation of user accounts:

  1. Intent & Routing: User tags @Google Wallet with an expense query or budget goal.
  2. Read-Only Tool Execution: Gemini invokes read-only tools (fetchTransactions, fetchSubscriptions, fetchHistoricalBudgets).
  3. Deterministic Categorization & Anomaly Detection: Aggregates transactions, flags recurring patterns, and compares rates over time.
  4. Generative In-Chat Chart Rendering: Returns structured JSON or SVG payloads for in-chat visualization.
  5. Memory Summary Reconciliation: If the user specifies an ongoing goal (e.g., "I want to save $1,000 next quarter"), the model saves this preference to the user's Memory Summary ledger.

2. TypeScript Implementation (@google/genai v3.3.0)

import { GoogleGenAI, Type } from "@google/genai";

const client = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

// 1. Define Read-Only Financial Query Tools
const walletTools = [
  {
    name: "fetchTransactions",
    description: "Fetches historical read-only transactions across linked bank accounts and Google Wallet cards.",
    parameters: {
      type: Type.OBJECT,
      properties: {
        startDate: { type: Type.STRING, description: "ISO start date YYYY-MM-DD" },
        endDate: { type: Type.STRING, description: "ISO end date YYYY-MM-DD" },
        category: { type: Type.STRING, description: "Optional filter: dining, grocery, tech, travel, utilities" },
      },
      required: ["startDate", "endDate"],
    },
  },
  {
    name: "auditSubscriptions",
    description: "Scans recurring merchant transactions to detect subscription cadence and price increases.",
    parameters: {
      type: Type.OBJECT,
      properties: {
        lookbackMonths: { type: Type.INTEGER, description: "Number of trailing months to audit (e.g. 12)" },
      },
      required: ["lookbackMonths"],
    },
  },
];

// 2. Execute Interactions API with automatic continuation
const interaction = await client.interactions.create({
  model: "gemini-4-hydrogen", // Fast execution engine
  input: "@Google Wallet Review my spending from last quarter so I can save $1,000 over the next 3 months.",
  config: {
    system_instruction:
      "You are a personal finance assistant. You have READ-ONLY access to Google Wallet and linked Plaid accounts. You cannot transfer money, make purchases, or modify credentials. Return spending breakdowns with structured visual charts.",
    thinking_level: "high",
    automatic_continuation: true,
    tools: walletTools,
  },
});

for (const step of interaction.steps) {
  if (step.thought) console.log("[Reasoning]:", step.thought);
  if (step.tool_call) console.log("[Read-Only Tool Call]:", step.tool_call);
  if (step.output) console.log("[Assistant Response & Chart Payload]:", step.output.text);
}

3. Python Implementation (google-genai v3.3.0)

from google import genai
from google.genai.types import InteractionsConfig, Tool

client = genai.Client()

# Read-only personal finance tool declaration
tools = [
    {
        "name": "audit_subscriptions",
        "description": "Scans recurring payments and flags price hikes across Google Wallet and linked accounts.",
        "parameters": {
            "type": "OBJECT",
            "properties": {
                "lookback_months": {"type": "INTEGER", "description": "Trailing audit window in months"}
            },
            "required": ["lookback_months"]
        }
    }
]

interaction = client.interactions.create(
    model="gemini-4-hydrogen",
    input=[{
        "role": "user",
        "content": "@Google Wallet What subscriptions am I still paying for, and did any of them go up in price this year?"
    }],
    config=InteractionsConfig(
        system_instruction="Strictly read-only financial advisor. Never mutate accounts. Detect recurring charges and flag price changes.",
        thinking_level="high",
        automatic_continuation=True,
        tools=tools
    )
)

for step in interaction.steps:
    if step.thought:
        print("[CoT]:", step.thought)
    if step.output:
        print("[Output]:", step.output.text)

4. Memory Summary Management Pattern

To implement user-controlled memory adhering to Google's Memory Summary model, apps should persist extracted goals in a transparent document collection that users can audit:

// User Memory Model for Personal Intelligence
interface UserMemoryEntry {
  id: string;
  category: "financial_goal" | "dining_preference" | "budget_constraint";
  statement: string; // e.g. "Targeting $1,000 savings in Q1 2027"
  confidence: number;
  extractedAt: string;
  sourceInteractionId: string;
}

// User-facing pruning method (Right-to-be-forgotten / User control)
function deleteMemoryEntry(userId: string, memoryId: string): void {
  // Permanently purges the specific memory vector from the user's Personal Intelligence context
  database.collection("user_memories").doc(memoryId).delete();
}

🚀 Test the Companion Interactive Studio

Experience dynamic cash flow visualizations, subscription price hike auditing, and the Memory Summary inspector live in our companion playground: Gemini Personal Finance & Google Wallet Studio [SIMULATED DEMO] →

← Part 2: Impact on Builders Launch Wallet Studio Lab [DEMO] →