✨ Inspiration

Every week, my wife and I shop at a large supermarket in town. Like many shoppers, I’d stand in front of shelves — shampoos, noodles, snacks — and struggle to pick the right product. Most of us only know a few familiar brands, but the shelves are packed with dozens of options, and comparing across them quickly becomes overwhelming.

I often thought: what if I could just snap a photo of the shelf and an app told me the best product — and why? That idea stayed with me for years. This hackathon finally gave me the chance to make it real: a smart shopping assistant that makes shopping faster, smarter, and personal. 🛒🤖


🛍️ What it does

The Agentic Shopping Assistant helps shoppers make smarter, faster, personalized choices.

  • 📸 Shelf Scanning – Take a photo of a shelf → the app detects products, checks your preferences, and suggests the best pick (with reasons). If info is missing, it asks you quick multiple-choice questions to refine the choice.
  • 📝 Smart Shopping List – Add items manually or just speak/type what you need. The app extracts items and facts about you. Example: “I play football with my son” → adds football to your suggestion list + saves “likes football” + “has a son” as preferences.
  • 🔄 Continuous Learning – With every use, it builds a richer profile so recommendations get better and more personal over time.

⚙️ How I built it

  • Backend: Python FastAPI + LangGraph workflows for product recs, interrupts, and quizzes.
  • Database: TiDB for both SQL + vector search. Three tables: Categories, Shopping Items, Preferences (with vector embeddings).
  • Prompts: Markdown + Jinja2 templates → easy to version and tweak.
  • Infra: Deployed on a DigitalOcean Linux droplet.

This stack powers an agentic AI workflow that ties shelves, preferences, quizzes, and lists into one system. 🚀


🧩 Challenges I ran into

Managing user preferences was one of the trickiest parts. Since the app learns new preferences continuously from user input, it’s common to see overlaps or near-duplicates. For example, one user entry might say “likes playing football” while another says “enjoys soccer”. These mean the same thing, but a simple string search would treat them as different preferences — leading to clutter and inconsistency.

This is where TiDB came in as the solution. TiDB’s hybrid model let me treat preferences like a normal SQL table (so users can list, edit, and delete them) while also running vector similarity search to detect when a new preference is semantically close to an existing one. That combination kept the preference database clean, deduplicated, and still easy for users to manage.


🏆 Accomplishments I’m proud of

  • Built a working end-to-end system from scratch — backend, frontend, AI, database.
  • Tested it in real shopping trips 🛒 → it’s already showing stable, consistent results.
  • Finally brought to life the app I always wanted to build. 🎉

📚 What I learned

  • Learned LangGraph hands-on: from zero → building workflows with interrupts & checkpoints.
  • Discovered TiDB’s hybrid search → combine SQL + vectors in one place.
  • Hackathon learnings even carried into work: I recommended TiDB in real discussions! 💡

🔮 What’s next

  • 🧪 Test across more products & optimize prompts.
  • 🔍 Add search agent: auto-fetch product details (e.g., ingredients) online → store in TiDB with freshness checks.
  • 🕸️ Explore GraphRAG with TiDB: build graphs of preferences + purchases to answer abstract Qs like “What flavors do I enjoy most?”.
  • 🤖 Build towards an agentic chatbot that understands lifestyle, not just lists.

The vision: a truly intelligent shopping companion that grows with you. 🌱

TiDB Cloud Account:

haseebpvt@gmail.com

Built With

Share this project:

Updates