Inspiration
Shopping rarely starts with a perfect search query. A user might begin with “I need something comfortable for travelling,” later add “maybe waterproof,” and then change their mind. Traditional keyword search struggles with this because it does not naturally understand evolving intent.
We built Shopping Rules! to act more like a shopping assistant than a search box: remember what matters, understand whether someone is browsing or ready to buy, ask useful questions, and improve recommendations as the conversation develops.
We chose a no LLM approach for faster deployment, and faster runtimes. There are many millions of users in the e-commerce market, hence we want to make the most cost-effective solution to reach that scale.
What it does
Shopping Rules! is a conversational recommendation agent for a catalog of 50,000 Amazon Clothing, Shoes & Jewelry products.
During a conversation, it:
- Detects Buying vs Browsing intent on every turn.
- Remembers preferences such as category, material, color, size, budget, style, and features.
- Handles changing preferences and "no preference" responses.
- Searches with both BM25 keyword retrieval and FAISS semantic retrieval.
- Detects overly broad requests and asks candidate-aware clarification questions.
- Uses historical preference tags as a lightweight personalization signal.
- Reranks products using lexical, semantic, category, phrase, IDF, and structured constraint signals.
- Uses a local CrossEncoder for final semantic reranking.
The goal is to find the right product while minimizing unnecessary conversation turns.
How we built it
We built the system as a multi-stage Python pipeline:
User + Profile
↓
Dialogue State Tracker
↓
Buying / Browsing Router
↓
BM25 + FAISS Retrieval
↓
CombMNZ Fusion
↓
Candidate Preservation
↓
Context-Aware Reranker
↓
Local CrossEncoder
↓
Top-10 Recommendations
The agent also uses the current candidate pool to decide when a request is too broad and which clarification question would be most useful.
Our main technologies include:
- Python & VS Code
- Hugging Face SentenceTransformers
- PyTorch
- FAISS
- SQLite FTS5 / BM25
- NumPy
- scikit-learn
We use the frozen TechJam dataset derived from Amazon Reviews 2023. No paid external model API or hosted vector database is required.
Challenges we ran into
Our biggest discovery was that retrieval was not the main problem.
We built a diagnostic pipeline and found that BM25 retrieved the target product in approximately 97.5% of public sessions, while BM25 + FAISS reached approximately 98%.
We shifted our focus toward candidate preservation, better context distillation, phrase matching, and semantic reranking.
Multi-turn state was another challenge. We experimented with decaying older preferences, but learned that an earlier constraint such as “waterproof” often remains important several turns later. Instead, we preserve explicit constraints until the user actually changes them.
Accomplishments that we're proud of
We improved the agent through controlled experiments rather than adding complexity all at once.
Baseline:
- 12.5% Hit Rate@10
- 0.068 MRR
- 9.81 MTTC
- 0.119 Efficiency
- 0.107 TechnicalScore
Our strongest validated full-stack version reached:
- 77.5% Hit Rate@10
- 0.413 MRR
- 4.475 MTTC
- 0.653 Efficiency
- 0.642 TechnicalScore
This complete system runs locally without requiring a paid LLM API, only Huggingface login is required.
What we learned
The biggest lesson was that conversational shopping is not just a retrieval problem.
BM25 was extremely strong for exact product attributes, FAISS helped with semantic discovery, and the CrossEncoder improved deeper semantic relevance. Dialogue context and phrase matching were crucial for turning those candidates into useful recommendations.
We also learned that more complexity is not always better. Some experiments improved our score, while others such as aggressive slot decay made it worse.
Testing each idea independently helped us understand what actually mattered.
What's next for Shopping Rules!
With more time, we would explore:
- Product-specific learning-to-rank instead of manually weighted ranking signals.
- Better structured reasoning for price and hard constraints.
- A richer ontology for free-form Amazon product features.
- A CrossEncoder trained specifically for shopping relevance.
- More detailed latency and resource optimization.
- Testing across larger and more diverse product catalogs.
Ultimately, we want Shopping Rules! to generalize beyond fashion into any large catalog where users discover what they want through conversation rather than perfect search filters. Shopping Rules! also does not require any paid LLMs to run any part of its pipeline, making it very cost-effective for large user base. Either way, it leaves a gap for a LLM to be implemented and finetuned, in order to improve its technical scores.


Log in or sign up for Devpost to join the conversation.