A stateful, multi-agent E-commerce Shopping Assistant built on LangGraph, FastAPI, Qdrant, and Supabase.
Traditional E-commerce relies on users manually clicking checkboxes (e.g., ✅ "Black", ✅ "Under $100") and scrolling through paginated SQL results. This project introduces a conversational Semantic Routing Engine. Users state their intent naturally ("I need a cheap, dark winter jacket for a ski trip"), and the intelligent LangGraph state machine handles the hybrid vector/relational querying autonomously.
graph TD
User([User Request]) --> UI[Streamlit Frontend]
UI --> Orchestrator{LangGraph State Manager}
Orchestrator --> Router[Groq LLM Llama-3.3-70B]
Router -- Extracts Constraints & Intent --> Orchestrator
Orchestrator -- Intent: Search --> Embedder[FastEmbed BAAI/bge-small]
Embedder -- Vectors --> Qdrant[(Qdrant Vector DB)]
Qdrant -- Hybrid Search --> Supabase[(Supabase PostgreSQL)]
Supabase -- Filtered Product Data --> Orchestrator
Orchestrator -- Intent: Chat --> LLM[Groq LLM Conversational]
LLM --> UI
- State Orchestrator (LangGraph): Manages conversational flow, memory, and cart state across multiple agent nodes.
- The LLM Brain (Groq): Llama-3.3-70B running at 0.0 temperature processes structured Pydantic outputs to extract exact user constraints (e.g.
max_price_inr: 100). - The Vector Engine (Qdrant + FastEmbed): Embedded high-dimensional product matrices queried for semantic similarity.
- Relational Constraints (Supabase): PostgreSQL handles the hard boundaries (e.g. strict price limits) wrapped inside Qdrant Hybrid filters.
This project uses uv, an extremely fast Python package and project manager written in Rust.
-
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh -
Clone and Setup:
git clone https://github.com/yourusername/Shopping-AI-Agent.git cd Shopping-AI-Agent uv venv source .venv/bin/activate uv pip install -r requirements.txt
-
Configure Environment: Create a
.envfile from the.env.exampleand add your Groq/Supabase keys. -
Seed the Databases (One-Time):
uv run scripts/data_seeder.py
This automatically generates realistic e-commerce data and syncs your local Qdrant vectors with your Supabase tables.
-
Run the Front-End Chat:
uv run streamlit run app.py