AWS Bedrock Agentic Shopping Assistant
Autonomous shopping agent on AWS Bedrock — natural-language search, tool-calling, fully Terraform-provisioned.
Highlights
- Bedrock Agent with custom action groups handles natural-language product search and tool-calling end to end.
- Full AWS infra provisioned with Terraform: DynamoDB, Lambda, API Gateway, S3, IAM roles.
- FastAPI backend integrates the Bedrock Agent runtime; Lambdas query DynamoDB on LLM-extracted parameters.
- Deployed publicly at shop.higuera.io — try it without signing up.
What it does
A natural-language shoe shopping app on AWS Bedrock. You type something like “comfortable running shoes under $80” and the agent extracts the parameters (type: running, max_price: 80), calls the right Lambda action group, queries DynamoDB, and narrates a response. No keyword search, no filter UI — the whole interface is one box and a conversational reply.
Architecture
┌─────────────┐ ┌─────────────┐ ┌─────────────────┐
│ React │────▶│ FastAPI │────▶│ AWS Bedrock │
│ Frontend │ │ Backend │ │ Agent │
└─────────────┘ └─────────────┘ └────────┬────────┘
│
▼
┌─────────────────┐
│ Lambda Action │
│ Group │
└────────┬────────┘
│
▼
┌─────────────────┐
│ DynamoDB │
│ ShoeInventory │
└─────────────────┘- User submits a natural-language query.
- FastAPI invokes the Bedrock Agent runtime.
- Agent parses the query and extracts structured parameters.
- Agent calls the Lambda action group with those parameters.
- Lambda queries DynamoDB with the right filters.
- Results flow back through the agent, which wraps them in a conversational reply.
- Frontend renders the products alongside the agent’s response.
Stack
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, Tailwind CSS, Axios |
| Backend | FastAPI, Python 3.11, boto3 |
| AI / LLM | AWS Bedrock Agent, Claude 4.5 Haiku |
| Database | Amazon DynamoDB (single-table) |
| Infrastructure | Terraform, Lambda, API Gateway, IAM |
| Deployment | S3 + CloudFront, live at shop.higuera.io |
Sample queries the agent handles
| User query | Extracted parameters |
|---|---|
| "red running shoes under $100" | type: running · color: red · max_price: 100 |
| "size 10 casual shoes" | type: casual · size: 10 |
| "comfortable boots around $150" | type: boots · min_price: 130 · max_price: 170 |
| "show me all athletic shoes" | type: athletic |
The interesting parts
Action groups, not prompt-stuffed schemas
Each capability the agent has is a Bedrock action group backed by a Lambda, with an OpenAPI schema declaring the parameters the agent can extract. The catalog schema lives in code, not in the prompt — which makes the agent cheap and predictable.
Two event formats, one handler
The Lambda has to accept both shapes: API Gateway ({ "body": "{...}" }) and Bedrock Agent ({ "actionGroup": "...", "parameters": [...] }). One handler normalizes both upstream so the query logic stays clean.
boto3 returns Decimal — not float
DynamoDB’s Python SDK hands you Decimal instances for any numeric attribute. JSON-serializing them needs a custom encoder, or every response throws. Small thing, instantly memorable the first time it breaks production.
Prompt-engineered to act, not ask
The agent instructions were iterated until it stopped asking clarifying questions and started searching with whatever parameters were available. Partial extraction beats round-trips for this UX.
Infrastructure as code
Every AWS resource — DynamoDB table, Lambda, API Gateway, IAM roles — is provisioned by Terraform. terraform apply spins up a clone end-to-end. IAM follows least-privilege; CORS is restricted, no wildcards.
The agent is live at shop.higuera.io. Hosted on AWS (S3 + CloudFront in front of the React build, API Gateway → Bedrock Agent on the backend). No signup, no card required.