KartWise is an AI-powered shopping assistant that generates personalized product kits based on user prompts. It uses a multi-step agentic pipeline to clarify requests, create structured shopping kits, and find products.
This is a hackathon submission for SparkHacks 2026 at UIC.
LAB uses a multi-step agentic pipeline powered by LLaMA 3.3 70B (via Groq):
- Clarification Gate -- Decides if the request is too vague. If so, asks 1-3 follow-up questions. If the user has already provided budget or context, this step is skipped.
- Kit Generation -- Produces a structured shopping kit with categorized sections: Essential Items, Safety/PPE, Optional Upgrades, Budget-Friendly Alternatives, and Frequently Forgotten Items.
- Query Building -- Constructs optimized search queries from each item's name, specs, and synonyms.
- Product Search -- Hits the Serper API (Google Shopping) to find real products. Results are cached in MongoDB with a 24-hour TTL.
- Match & Rank -- Fuzzy string matching scores and ranks search results against kit items. The best match's image, price, and buy link are attached to each item.
The frontend is a chat interface. Users send messages, receive either clarifying questions or a rendered product card grid, and can browse past sessions in a sidebar.
| Layer | Technology |
|---|---|
| Backend | Flask, Python |
| Database | MongoDB (Flask-PyMongo) |
| Auth | Firebase Auth (Google + email/password) |
| LLM | Groq (LLaMA 3.3 70B) |
| Product Search | Serper API (Google Shopping) |
| Frontend | Bootstrap 5, vanilla JS |
- Python 3.10+
- MongoDB (local instance or Atlas)
- API keys for: Groq, Serper, Firebase
- A Firebase service account key file (
firebase-key.json)
powershell -ExecutionPolicy Bypass -File install.ps1This creates a virtual environment, installs all dependencies, and verifies project files.
python -m venv .venv
# Windows
.\.venv\Scripts\Activate.ps1
# macOS/Linux
source .venv/bin/activate
pip install -r requirements.txtCreate a .env file in the project root:
FLASK_APP=wsgi.py
FLASK_DEBUG=1
SECRET_KEY=your-secret-key
MONGO_URI=mongodb://localhost:27017/ai_shopping_kit
FIREBASE_CREDENTIALS=firebase-key.json
GROQ_API_KEY=your-groq-api-key
GROQ_MODEL_NAME=llama-3.3-70b-versatile
SERPER_API_KEY=your-serper-api-key
Place your Firebase service account JSON as firebase-key.json in the project root.
Start the server:
python wsgi.pyThe app runs at http://localhost:5000.
- Sign in with Google or create an account with email/password.
- Type a prompt describing what you want, e.g. "$200 home office setup" or "cozy winter fit under $100".
- Answer any follow-up questions if the system needs clarification.
- Browse the generated product kit -- each card shows an image, price, and a link to buy.
- Past sessions are saved in the sidebar for quick access.
wsgi.py # Entry point
app/
__init__.py # Flask app factory
extensions.py # Mongo, Flask-Login, Firebase init
config.json # Groq model config
models/user.py # User model (Firebase UID-based)
routes/
auth.py # Login, signup, logout, session
main.py # Root redirect, dashboard
kit.py # /api/kit/generate, /api/kit/history
services/
orchestrator.py # Agentic pipeline coordinator
planner_service.py # Clarification gate (LLM)
kit_service.py # Kit generation (LLM)
query_service.py # Search query builder
search_service.py # Serper API + caching
match_service.py # Fuzzy match & ranking
llm_service.py # Groq LLM client + retry logic
prompts/ # System prompts for LLM agents
schemas/ # JSON schemas for LLM output validation
templates/ # Jinja2 HTML templates
static/js/main.js # Frontend chat logic
normalization.py # String normalization for matching
Dockerfile # Container build for Aedify/cloud deploy
This project includes a Dockerfile and is ready to deploy on Aedify.ai.
-
Push the repo to GitHub.
-
Go to Aedify.ai and click Deploy App > Deploy from GitHub.
-
Select your repository. Aedify will detect the Dockerfile automatically -- check "Use Dockerfile" in the Detection section.
-
Set these environment variables in the Aedify project settings (or use "Import .env"):
Variable Value SECRET_KEYA strong random string MONGO_URIYour MongoDB Atlas connection string FIREBASE_CREDENTIALS_JSONThe full contents of your firebase-key.jsonfile, pasted as a single-line JSON stringGROQ_API_KEYYour Groq API key SERPER_API_KEYYour Serper API key -
Set resources (0.5 vCPU / 512 MB minimum recommended).
-
Click Deploy Project.
The app will build and be accessible at the URL Aedify assigns. No PORT configuration needed -- the Dockerfile reads it automatically.
Note: For Firebase credentials, copy the entire contents of
firebase-key.jsonand paste it as the value ofFIREBASE_CREDENTIALS_JSON. The container writes it to a file at startup.