Skip to content

aws-samples/sample-blaize-bazaar-agentic-search-apg

Build Agentic AI-Powered Search with Amazon Aurora and Amazon Bedrock AgentCore

AWS Workshop Level 400 License

🚧 UNDER CONSTRUCTION β€” This workshop is being actively developed. Code, content, and infrastructure may change without notice.

⚠️ Educational Workshop: Demonstration code. Not intended for production deployment without proper security hardening.


What You'll Build

Blaize Bazaar β€” an e-commerce platform that starts with broken keyword search and no AI. You'll progressively add semantic search, agent tools, multi-agent orchestration, and production infrastructure by editing the real application code.

Two Formats, One Codebase

Format Duration Challenges What Participants Build
Workshop 2 hours 9 challenges (all edit) Full stack: search β†’ agents β†’ production
Builder's Session 1 hour 2 edit + 7 test/read Search + tools hands-on, rest pre-completed

Three Modules

Module Name Challenges Outcome
1 Smart Search C1: _vector_search() "Your database understands what customers mean."
2 Agentic AI C2: @tool, C3: agent, C4: orchestrator "A multi-agent team handles customer queries."
3 Production Patterns C5: runtime, C6: memory, C7: gateway, C8: observability, C9: identity "Your agent system runs on managed infrastructure."

Quick Start

Services auto-start on the workshop instance. If running locally:

# Terminal 1: Backend (auto-reloads on .py changes)
cd blaize-bazaar/backend
uvicorn app:app --reload --host 0.0.0.0 --port 8000

# Terminal 2: Frontend (HMR on .ts/.tsx changes)
cd blaize-bazaar/frontend
npm install && npm run dev

Repository Structure

blaize-bazaar/                          # The application
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ hybrid_search.py            ← Challenge 1: _vector_search()
β”‚   β”‚   β”œβ”€β”€ agent_tools.py              ← Challenge 2: get_trending_products()
β”‚   β”‚   β”œβ”€β”€ agentcore_memory.py         ← Challenge 6: AgentCore STM
β”‚   β”‚   β”œβ”€β”€ agentcore_gateway.py        ← Challenge 7: MCP Gateway
β”‚   β”‚   β”œβ”€β”€ otel_trace_extractor.py     ← Challenge 8: Observability
β”‚   β”‚   └── (12 more pre-built services)
β”‚   β”œβ”€β”€ agents/
β”‚   β”‚   β”œβ”€β”€ recommendation_agent.py     ← Challenge 3: specialist agent
β”‚   β”‚   β”œβ”€β”€ orchestrator.py             ← Challenge 4: multi-agent orchestrator
β”‚   β”‚   β”œβ”€β”€ search_agent.py             (pre-built)
β”‚   β”‚   β”œβ”€β”€ inventory_agent.py          (pre-built)
β”‚   β”‚   β”œβ”€β”€ pricing_agent.py            (pre-built)
β”‚   β”‚   └── customer_support_agent.py   (pre-built)
β”‚   β”œβ”€β”€ agentcore_runtime.py            ← Challenge 5: AgentCore Runtime
β”‚   └── app.py                          (pre-built FastAPI server)
β”œβ”€β”€ frontend/
β”‚   └── src/utils/agentIdentity.ts      ← Challenge 9: agent identity UI
β”‚
solutions/                              # Drop-in replacements (cp and restart)
β”œβ”€β”€ module1/services/                   hybrid_search.py, business_logic.py
β”œβ”€β”€ module2/services/ + agents/         agent_tools.py, recommendation_agent.py, orchestrator.py
└── module3/services/ + frontend/       agentcore_*.py, otel_trace_extractor.py, agentIdentity.ts

scripts/ # Bootstrap & provisioning β”œβ”€β”€ bootstrap-environment.sh Stage 1: Code Editor + Python setup β”œβ”€β”€ bootstrap-labs.sh Stage 2: DB seed + deps (workshop) β”œβ”€β”€ bootstrap-labs-builders.sh Stage 2: Same + pre-complete C3-C9 (builders) └── seed-database.sh Product catalog + return_policies + indexes

data/ # Product catalog (~444 products with embeddings) lab-content/ # Workshop Studio content (2 formats) β”œβ”€β”€ workshop/ 2-hour workshop lab guide └── builders/ 1-hour builder's session lab guide


---

## Technology Stack

| Layer | Technologies |
|-------|-------------|
| Database | Aurora PostgreSQL Serverless v2 (0-16 ACU), pgvector 0.8.0 (HNSW) |
| AI/ML | Amazon Bedrock β€” Claude Sonnet 4.6, Cohere Embed v4, Cohere Rerank v3.5 |
| Agent Infra | Amazon Bedrock AgentCore β€” Gateway, Memory, Observability, Runtime |
| Agent Framework | Strands Agents SDK |
| Backend | FastAPI, Python 3.13, psycopg3, boto3 |
| Frontend | React 18, TypeScript 5, Tailwind CSS, Vite |

---

## Multi-Agent Architecture

5 specialist agents + 1 orchestrator, using the "Agents as Tools" pattern:

| Agent | Domain | Tools |
|-------|--------|-------|
| Search | Product search | `search_products`, `get_product_by_category`, `compare_products` |
| Recommendation | Trending/popular | `get_trending_products`, `get_product_by_category` |
| Pricing | Price analysis | `get_price_analysis`, `search_products`, `get_product_by_category` |
| Inventory | Stock management | `get_inventory_health`, `get_low_stock_products`, `restock_product` |
| Support | Returns/support | `get_return_policy`, `search_products` |
| Orchestrator | Query routing | The 5 specialist agents (registered as tools) |

---

## Short on Time?

Every challenge has a solution file. Copy it over and the backend auto-restarts:

```bash
# Example: Skip Challenge 1
cp solutions/module1/services/hybrid_search.py blaize-bazaar/backend/services/hybrid_search.py

See solutions/README.md for all copy commands.


Database Schema

Table: blaize_bazaar.product_catalog (~444 products)

CREATE TABLE blaize_bazaar.product_catalog (
    "productId"         CHAR(10) PRIMARY KEY,
    product_description VARCHAR(500) NOT NULL,
    "imgUrl"            VARCHAR(200),
    "productURL"        VARCHAR(40),
    stars               NUMERIC(2,1),
    reviews             INTEGER,
    price               NUMERIC(8,2),
    category_id         SMALLINT,
    "isBestSeller"      BOOLEAN DEFAULT FALSE,
    "boughtInLastMonth" INTEGER,
    category_name       VARCHAR(50) NOT NULL,
    quantity            SMALLINT,
    embedding           vector(1024)    -- Cohere Embed v4
);

Table: blaize_bazaar.return_policies (21 rows)

CREATE TABLE blaize_bazaar.return_policies (
    category_name       VARCHAR(50) PRIMARY KEY,
    return_window_days  INTEGER,
    conditions          TEXT,
    refund_method       TEXT
);

Resources


License

MIT-0 License. See LICENSE.


Workshop by Shayon Sanyal β€” Principal Database Specialist SA, AWS

About

Build Agentic AI-Powered Search with Amazon Aurora and Amazon RDS

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors