Inspiration
We have all been in the following situation: you are interested in starting a new hobby, fixing an appliance, or setting up a workstation, but you do not know where to start. You start searching and get buried in blogs, YouTube videos, and extensive threads. You need a complete system of compatible parts, tools, and safety gear, rather than just one item.
Existing AI chatbots are great at providing lists of text, but they fall short of being truly useful. They give you a list, and you still have to copy and paste every item into Amazon or Google.
Therefore, KartWise was built to solve the issue of Analysis Paralysis. We wanted an agent that doesn't just chat, but orchestrates, converting a vague intent like "I need to build a square table" into a structured, sourced, and cart-ready purchase kit in seconds.
What it does
KartWise is a full-stack Shopping Orchestrator. It takes one natural language prompt and autonomously performs the following complex workflow:
- It analyzes your request. For example, if you say, "I need a laptop," it clarifies by asking, "Mac or Windows? Budget?" Instead, if you say, "I need a $500 Windows laptop for school," it will skip the questions and get to work straight away.
- It uses a Large Language Model (LLM) to architect a JSON-structured "Kit" containing:
- Essentials
- Safety / PPE
- Upgrades
- Forgotten items
- It converts AI specs into optimized search queries and hits live APIs to find real products.
- It ranks the search results against the AI's requirements to ensure the product found actually matches the need.
How we built it
We decided to architect KartWise as a modular Flask application that is backed by MongoDB, coupled with a Python pipeline that chains multiple AI tasks and uses Groq (running Llama 3) for high-speed inference.
MongoDB stores the complex, nested JSON structure of the kits and user sessions. This allowed us to iterate on the schema rapidly without performing migrations, enabling us to implement a SearchService that uses the Serper API, a Google Search wrapper, to fetch real-time pricing and availability.
Bridged Firebase Auth, which is the frontend with Flask-Login, the backend, to create a secure and persistent session state for saving user kits for possible future use.
Lastly, one of our more interesting features is the match_service system. As we did not want to blindly trust the API's search results, we implemented a custom scoring algorithm using Python's difflib for its specific comparison tools.
Challenges we ran into
Early versions of our planner got stuck in an infinite loop of asking clarifying questions. We had to implement strict Aggression Rules in our system prompts and a hard logic override in Python to force the model to build once it had enough context.
Moreover, getting an LLM to output strict, parseable JSON 100% of the time is difficult. We built a validation layer using jsonschema that automatically retries and heals malformed JSON responses from the API.
Synchronizing client-side Firebase ID tokens with server-side Flask sessions was tricky. We encountered several 401 Unauthorized errors until we standardized our User model to strictly map Firebase UIDs to MongoDB documents.
Accomplishments that we're proud of
We stepped away from the standard chatbot interface and built a Style Lab dashboard. It feels like a professional engineering tool, not just a text window.
By optimizing our prompt chain and using Groq, we reduced the kit generation time from ~20 seconds to ~4 seconds.
The system successfully remembers constraints (like "Budget: $500") across the conversation history, so it doesn't nag the user for information they've already provided.
What we learned
We learned a handful of things over the course of the project creation:
- The prompts are not about English; they are about the logic behind them. Therefore, we had to structure our system with strict constraints, such as "OUTPUT JSON ONLY" and "NO PROSE", to ensure a reliable backend.
- Handling a conversation state in a RESTful environment required careful planning, teaching us how to serialize chat history effectively to keep the AI in the loop.
- Relying on external APIs has led to systems breaking constantly, causing us to learn to build robust fallback mechanisms so that the app does not crash in case a search fails.
What's next for KartWise
We want to add a "Team Mode" where users can share a kit URL, and friends can vote on items or split the cost, and integrate a cron job to check the prices of saved kits daily and alert users of price drops. Additionally, a price-comparison system that gives users more freedom would be beneficial.
Log in or sign up for Devpost to join the conversation.