Inspiration
Online shopping often involves comparing dozens of products individually, but choosing good products separately does not necessarily result in the best overall shopping basket. Finding the right combination while staying within a fixed budget can be challenging, especially for students and people managing limited spending.
I built CartMind to solve this problem. Instead of simply recommending individual products, CartMind helps users build an optimized shopping basket based on their requirements, priorities, brand preferences, and total budget.
What it does
CartMind is an AI-powered shopping assistant that turns natural-language shopping requirements into a budget-conscious product combination.
Users can:
- Browse a curated catalog of 28 products across five categories.
- Search, filter, and sort products by price, rating, category, and brand.
- Enter a shopping budget and describe what they need in plain English.
- Choose between lowest price, best value, and best quality priorities.
- Receive an optimized shopping basket with explanations.
- Explore alternative products and replace items.
- Track spending and remaining budget in real time.
How I built it
CartMind uses a hybrid AI and optimization architecture.
1. AI-powered understanding
I integrated Groq's API using the Llama 3.3 70B model to interpret natural-language shopping requests. It extracts structured information such as the user's budget, required categories, product preferences, and shopping priorities.
2. Deterministic budget optimization
I built a knapsack-inspired optimization engine that evaluates products from my curated catalog and selects combinations according to the user's requirements and priorities.
The optimizer enforces the budget constraint, ensuring that the final recommended combination does not exceed the user's specified spending limit.
3. AI-generated explanations
Groq generates explanations for the selected products, summarizes the recommended basket, and provides advice about possible alternatives.
The AI works with the existing product catalog rather than inventing products or prices. If the API is unavailable, the deterministic optimizer provides a fallback.
4. Interactive frontend
I developed a responsive React application with a product catalog, shopping dashboard, smart cart builder, and shopping cart. Cart information and budget settings persist using LocalStorage.
Technology Stack
- Frontend: React 19, Vite, Tailwind CSS
- Backend: Node.js, Express
- AI: Groq API, Llama 3.3 70B
- Optimization: Custom deterministic knapsack-inspired optimizer
- State management: React Context API
- Persistence: LocalStorage
Challenges
One of my main challenges was ensuring that AI recommendations remained consistent with actual catalog information and budget constraints. An LLM alone cannot reliably guarantee that a combination of products stays within a fixed budget.
I addressed this by separating natural-language understanding from product selection. The AI interprets the request and explains the result, while deterministic backend logic validates the products and calculates the final basket.
Another challenge was handling different priorities, such as lowest price versus best quality, without compromising the user's budget.
What I learned
Building CartMind helped me understand how language models can be combined with deterministic algorithms to build more reliable applications.
I learned that AI is most useful when paired with systems that enforce concrete constraints. Rather than relying entirely on generated responses, I used the LLM for language understanding and explanations while keeping product selection and budget enforcement in deterministic logic.
My goal is to make shopping decisions simpler, more transparent, and more budget-conscious.
Built With
- agents
- algorithm
- algorithms
- api
- css
- e-commerce
- express.js
- groq
- javascript
- knapsack
- localstorage
- models
- node.js
- optimization
- react
- rest
- tailwind
- vite