Inspiration
We all know the frustration of shopping online when you have a specific product in mind, but the search bar only understands exact keywords. The moment a shopper starts browsing vaguely, layering on nuanced requirements, or changing their mind midway through a chat, traditional e-commerce engines fall apart. Keyword matching quickly misses the mark, while standard generative bots tend to hallucinate products that don't actually exist in the inventory. We wanted to build Shopping Copilot for TikTok TechJam to prove that an e-commerce assistant could truly listen, keep track of evolving preferences, and track down the exact item without burning costly API tokens or making wild guesses.
What it does
Shopping Copilot is a headless, conversational search agent engineered to uncover a shopper's hidden target product from a 50,000-item catalog within ten turns. Instead of bombarding the customer with generic results, the system classifies whether someone is casually browsing or ready to buy, tailoring the discovery strategy accordingly. It keeps track of confirmed details like size, color, material, and budget, while gracefully handling sudden course corrections when a shopper changes their mind. When it needs more information, it calculates exactly which question will narrow down the options fastest. Crucially, it manages recommendation sizes dynamically—starting with razor-sharp single-item picks to solve queries early and only expanding to a wider list when necessary.
How we built it
We built the entire agent directly inside standard Python, focusing on pure algorithmic efficiency without external vector databases or heavyweight machine learning frameworks. The catalog is indexed using an in-memory SQLite FTS5 table for lightning-fast lexical search, paired alongside a custom TF-IDF posting list for dense semantic retrieval. We fused these streams using learned ranking weights and introduced a conjunctive category routing layer to cut through verbose catalog noise. To make sure early discoveries weren't lost when conversations evolved, we added a candidate memory buffer and exact-evidence phrase matching. Finally, we put together an interactive Streamlit dashboard so we could monitor live evaluation metrics, inspect session logs, and watch progression in real time.
Challenges we ran into
One of our biggest early hurdles was query drift. As shoppers answered questions and provided richer descriptions, our tokenized search queries grew so bloated with boilerplate text that the true target product would occasionally slip outside our retrieval cutoff. We resolved this by building a category-anchored recall route that guarantees a clean, unpolluted path into the candidate pool. We also ran into issues with category hierarchies—matching broad taxonomy paths ended up scoring thousands of unrelated goods equally, so we shifted our scoring logic strictly to the leaf category. Handling user pivots proved equally delicate; we had to fine-tune our state tracking so the agent knew the difference between a true preference reset and a casual, non-binding comment.
Accomplishments that we're proud of
We are thrilled to have achieved a perfect 1.0 Hit Rate@10 alongside a 0.996 Mean Reciprocal Rank and an average convergence time of just 2.055 turns on the development set. What excites us most is that these results are 100% deterministic and achieving a 0.977 Technical Score without making a single model call or using any prompt tokens. Taking a baseline system that struggled at a 0.125 Hit Rate and turning it into a system that reliably solves complex, multi-turn buying, browsing, and pivot scenarios with sub-millisecond response times has been the highlight of the project.
What we learned
Our diagnostic deep dives taught us that conversational search is primarily a ranking and dialogue-control challenge, not just a retrieval problem. Early on, our candidate pool already held the target item 96% of the time, meaning widening retrieval added unnecessary noise; the real breakthrough came from sharper slot tracking and dynamic slate sizing. We also discovered that structured, information-theoretic logic can consistently outperform black-box language models in speed, reliability, and cost-efficiency when navigating rigid, grounded catalog data.
What's next for Shopping Copilot
Looking ahead, we want to tackle ultra-dense catalog clusters where dozens of items share nearly identical specs, using brand-level and variant-level entropy splits to disambiguate the trickiest cases. We are also interested in scaling our in-memory posting architecture to support millions of SKUs with lightweight vector quantization. Finally, integrating multimodal signals would allow shoppers to guide the conversation not just with text, but by referencing photos, aesthetic vibes, and visual patterns to find exactly what they are looking for.
Built With
- algorithmic-search
- bm25
- conversational-ai
- deterministic-systems
- dialogue-management
- e-commerce
- entropy-reduction
- fts5
- information-retrieval
- learning-to-rank
- natural-language-processing
- pandas
- plotly
- python
- ranking-algorithm
- recsys
- search-engine
- slot-filling
- sqlite
- state-machine
- streamlit
- tf-idf
- vector-search
- zero-shot
Log in or sign up for Devpost to join the conversation.