
Building Shippyfy: How We Built an AI Co-Shopping Consensus Engine on AWS Serverless
Discover how we eliminated group shopping arguments by combining multi-objective game theory, conversational AI, and a 100% serverless AWS architecture powered by AWS Lambda, DynamoDB Single-Table Design, and AWS SAM.
The Problem: Group Shopping Is Broken
Have you ever tried buying a TV, an apartment appliance, or a gaming setup with roommates or family members? It almost always degenerates into a chaotic WhatsApp thread:
- One person wants the highest-end OLED panel.
- Another has a strict budget they are hesitant to admit publicly.
- Someone else cares strictly about high refresh rates for gaming.
The end result? Dozens of unread messages, decision fatigue, and an abandoned cart.
To solve this, we built Shippyfy, a collaborative co-shopping platform powered by Consenzo—our AI and game-theory consensus engine built entirely on AWS Serverless.
How It Works: The 3-Step Flow
Instead of forcing group members to argue in public, Shippyfy flips the script:
- Private AI Interviews: Each squad member has a quick, confidential 1-on-1 chat with our AI assistant (powered by NVIDIA Nemotron). Members can share their true budget ceilings and must-have specs without peer pressure.
- Mathematical Consensus Engine: Rather than a crude majority vote where 49% of the group ends up unhappy, our backend engine uses Nash Bargaining, Least Misery, and Pareto Frontier filtering to find the exact Amazon product that maximizes collective satisfaction.
- The Unanimous Victory Board: The squad receives a transparent ranking with plain-English trade-off explanations. Once everyone taps "Approve", the group checks out together.
The AWS Architecture
We wanted an architecture that was zero-maintenance, scaled down to zero cost when idle, and handled low-latency concurrent interactions during live shopping sessions.
[ Client Browser: React + TypeScript (Amazon S3) ]
│
▼
[ Amazon API Gateway ]
(CORS & REST Endpoints)
│
▼
[ AWS Lambda (Node.js 20) ]
├── Session State Router
└── Consensus & Scoring Engine
│ │
▼ ▼
[ Amazon DynamoDB ] [ AWS Secrets Manager ]
(Single-Table Design) (Secure LLM Key Storage)
1. High-Performance Single-Table DynamoDB
Group shopping sessions involve concurrent state: multiple people chatting, updating constraints, and voting simultaneously.
Using DynamoDB's Single-Table design pattern, we organized all entity types—Rooms, Users, Chat Messages, Extracted Constraints, and Consensus Results—under a unified table structure:
- Partition Key (
PK): Scoped to the session (e.g.,ROOM#\<roomId\>).
- Sort Key (
SK): Scoped to the entity type (e.g.,MEMBER#\<userId\>,PREFS#\<userId\>,CONSENSUS#LATEST).
- Time-to-Live (TTL): Automatically expires ephemeral session rooms after 7 days, keeping storage costs lean.
This structure allows us to fetch the entire room state—members, constraints, and current voting status—in a single read query with sub-10ms response times.
2. Zero-Idle Compute with AWS Lambda & Node.js 20
Our API business logic and math scoring engine run inside AWS Lambda functions configured with Node.js 20.x:
- We used
@aws-sdk/client-dynamodband@aws-sdk/lib-dynamodb(AWS SDK v3) to keep bundle sizes minimal and cold starts negligible (<150ms).
- AWS Lambda orchestrates the conversation pipeline, passes raw constraints into the mathematical solver, and validates unanimous room consensus.
3. Declarative Infrastructure with AWS SAM
Everything in our project is managed as code using the open-source AWS Serverless Application Model (AWS SAM).
Here is a snippet from our
template.yaml defining our serverless API and DynamoDB setup:AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Shippyfy - Serverless Consensus Shopping Engine
Globals:
Function:
Timeout: 30
MemorySize: 512
Runtime: nodejs20.x
Resources:
ConsenzoApi:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
Cors:
AllowMethods: "'GET,POST,PUT,DELETE,OPTIONS'"
AllowHeaders: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key'"
AllowOrigin: "'*'"
ConsenzoTable:
Type: AWS::DynamoDB::Table
Properties:
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: PK
AttributeType: S
- AttributeName: SK
AttributeType: S
KeySchema:
- AttributeName: PK
KeyType: HASH
- AttributeName: SK
KeyType: RANGE
TimeToLiveSpecification:
AttributeName: ttl
Enabled: true- Zero-Leak Security with AWS Secrets Manager To prevent LLM API keys or provider tokens from ever leaking into client bundles or code repositories, our Lambda functions fetch credentials dynamically from AWS Secrets Manager at execution time.
What We Learned Building on AWS
Deterministic Math + Non-Deterministic AI: LLMs are brilliant at natural dialogue and extracting user intent, but terrible at calculating multi-variable trade-offs. Delegating constraint extraction to the LLM and the scoring to deterministic algorithms on AWS Lambda gave us speed, accuracy, and predictability.
Single-Table Design Simplicity: Modeling everything in one DynamoDB table eliminated cross-table joins and race conditions when multiple squad members interacted at the same second.
Serverless Velocity: With AWS SAM CLI, local development was seamless—we could test Lambda functions locally against cloud DynamoDB instances, and deploy to production with a single sam deploy command.
Conclusion
By combining AWS Serverless technologies with modern AI and game theory, Shippyfy turns an everyday pain point—arguing about group purchases—into a fun, transparent, and frictionless 5-minute decision.
Built with passion for the Amazon Hackathon using AWS Lambda, Amazon DynamoDB, Amazon API Gateway, Amazon S3, and AWS SAM.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article