---
title: "Building Conversational Commerce with Multi-Agent Swarms on GCP: A Working Prototype"
description: "The post details a working prototype called HappyDelivery that implements conversational commerce with a multi-agent swarm on Google Cloud. It uses a three-layer decoupled design: an Ingress layer built with FastAPI that validates and normalizes messages from multiple chat platforms into a canonical schema and offloads them to Cloud Pub/Sub. The Session and Cart layer runs on Cloud Memorystore Redis, storing active cart and profile data keyed by phone number to support asynchronous shopping and dietary guardrails such as nut-free preferences. The Agent Swarm layer orchestrates specialized agents using LangGraph and Gemini, with a lightweight Flash supervisor routing to Profile, Inventory, and Transaction agents that use deterministic Python tools for pricing and payment. Empirical results show a three-turn shopping session consumes approximately 4,240 tokens costing $0.0061, which is 0.030% of a $20.32 basket value."
---

# Building Conversational Commerce with Multi-Agent Swarms on GCP: A Working Prototype

[Google](https://yomu.fyi/company/google) · Prateek Khushalani · Oct 27, 2026

**Type:** Explainer

## Summary

The post details a working prototype called HappyDelivery that implements conversational commerce with a multi-agent swarm on Google Cloud. It uses a three-layer decoupled design: an Ingress layer built with FastAPI that validates and normalizes messages from multiple chat platforms into a canonical schema and offloads them to Cloud Pub/Sub. The Session and Cart layer runs on Cloud Memorystore Redis, storing active cart and profile data keyed by phone number to support asynchronous shopping and dietary guardrails such as nut-free preferences. The Agent Swarm layer orchestrates specialized agents using LangGraph and Gemini, with a lightweight Flash supervisor routing to Profile, Inventory, and Transaction agents that use deterministic Python tools for pricing and payment. Empirical results show a three-turn shopping session consumes approximately 4,240 tokens costing $0.0061, which is 0.030% of a $20.32 basket value.

## Context

The authors previously published a blueprint for a three-layer decoupled architecture for conversational commerce. This post presents a working prototype of that architecture, implemented with LangGraph, Gemini, FastAPI, and Google Cloud, to demonstrate practical feasibility and measure token costs.

## Approach / What changed

The approach uses a three-layer implementation: an Ingress layer with FastAPI and Cloud Pub/Sub for multi-channel message normalization and security verification; a Session and Cart layer with Cloud Memorystore Redis for state management keyed by phone number; and an Agent Swarm layer with LangGraph and Gemini, where a low-latency Flash supervisor routes to specialized Profile, Inventory, and Transaction agents that use deterministic Python tools for pricing, stock, and payment. The prototype includes an automated verification suite.

## Takeaways

- The decoupled three-layer architecture uses an Ingress layer to normalize messages from multiple chat platforms, a Redis-powered Session and Cart layer for state, and an agent swarm with Gemini models. This design supports asynchronous shopping with pause/resume and dietary guardrails.
- Deterministic Python functions handle pricing, tax, shipping, and Stripe charges, ensuring zero arithmetic errors. The LLM only reads masked payment references, keeping raw financial data out of prompts.
- Token telemetry shows a three-turn session uses approximately 4,240 tokens at a cost of $0.0061, representing 0.030% of gross merchandise value. Context caching can further reduce costs by 75%.

## FAQ

### How does the architecture handle asynchronous shopping sessions?

The Session and Cart layer stores active cart state in Redis keyed by phone number, so when a customer pauses and resumes, the system restores their cart and preferences instantly without re-parsing chat history.

### What methods prevent LLM token waste in multi-agent workflows?

State is offloaded to Redis so only current intent and cart summary are passed to the LLM. Deterministic Python tools handle math and payments, using zero LLM tokens. High-frequency routing uses the cheaper Gemini Flash, reserving Gemini Pro for inventory and payment tasks.

### How does the prototype validate webhook security from different messaging platforms?

The Ingress layer routes incoming requests through platform-specific signature validators such as MetaHmacValidator, RcsJwtValidator, AppleJwsValidator, and TwilioHmacValidator, then normalizes payloads into a canonical schema before queuing to Pub/Sub.

**Tags:** [Conversational Commerce](https://yomu.fyi/topic/conversational-commerce), [Gemini](https://yomu.fyi/topic/gemini), [Google Cloud](https://yomu.fyi/topic/gcp), [LangGraph](https://yomu.fyi/topic/langgraph), [Multi-Agent Swarms](https://yomu.fyi/topic/multi-agent-swarms)

- Source: [Google](https://developers.googleblog.com/building-conversational-commerce-with-multi-agent-swarms-on-gcp-a-working-prototype)
- Source URL: https://developers.googleblog.com/building-conversational-commerce-with-multi-agent-swarms-on-gcp-a-working-prototype
- Ingested by Yomu: 2026-10-27T18:00:16.266Z

[Read original post](https://developers.googleblog.com/building-conversational-commerce-with-multi-agent-swarms-on-gcp-a-working-prototype)
