Expanding Search: Moving beyond Narrow Matches
A case study for food delivery app item search capabilities
Enriching Jahez's Narrow Search with Themes and Exploration
Jahez’s current item search system focuses on delivering exact matches for user queries, which works well for specific requests but falls short in supporting broader exploration or discovery. For instance, a search for “pepperoni pizza” might miss out on showcasing related options like other pizza varieties or complementary items that align with the user’s preferences.
To solve this, we’re introducing a dynamic, category-based item search system built from the ground up. Products are first grouped into smaller, meaningful clusters based on shared characteristics like names and descriptions using semantic embeddings. These clusters are then merged into broader categories through hierarchical clustering, capturing diverse themes like “Classic Pizzas” or “Cheesy Favorites.” At the final stage, Retrieval-Augmented Generation (RAG) is used to create intuitive and user-friendly names for these categories, ensuring clarity and alignment with user expectations.
This dynamic system enhances item search results by offering precise matches while encouraging discovery through related categories. It transforms the search experience into one that not only delivers what users want but also inspires them to explore more relevant options effortlessly.
The key to enhancing the search experience is how we present the results. As shown in the previous example, we display product options in easy-to-understand cards, each labeled with clear names derived from the content of the products—using information from products names and descriptions. By using Large Language Models (LLMs), these labels help make the categories more intuitive, allowing users to quickly understand and explore relevant options that match their query.
Moving Beyond Narrow Matches: Helping Users Discover More
The goal isn’t just to give users what they asked for—it’s to help them discover new options they didn’t even think about. By broadening the scope of search results to include related products or alternatives, users get a better selection of choices that could match their intent, even if they didn’t phrase their query perfectly. This improves the user experience by not just offering precision, but also the opportunity for discovery.
How This Approach Works: Two Layers of Search for Better Results
Rather than sticking to one way of searching, this approach combines two layers:
Layer 1: Direct Product Matching
The system starts by finding products that match the query closely. This ensures that users still get exactly what they want.Layer 2: Related Category Matching
Once a match is found, the system looks at the product’s broader category. From here, it expands the search to find related products from similar categories. This way, users can find relevant alternatives that they may not have considered.
Organizing Products: Grouping Them Into Meaningful Categories
To make this work, products are grouped into categories that make sense. Here’s how:
Step 1: Group Similar Products
Products like “Chicken Pizza” are grouped together based on shared similarities in product names and descriptions, leveraging embeddings to semantically cluster the most similar products.Step 2: Broader Groupings, Creating categories
As products tend to have a hierarchical structure with different flavors or sizes of options for the same product, we performed hierarchical clustering on the small clusters obtained in Step 1. We targeted groups that are most similar to each other and merged them into one category. Ideally, this category aims to capture the many flavors or themes in its smaller groups.
By grouping products, we’re able to understand what broader categories of products are offered and identify niche products. This can be utilized in many ways—one of them is expanding the search and recommending similar but themed results. An indirect benefit is identifying the broader categories customers are typically interested in, allowing us to optimize ad promotions for restaurants targeting those customers.
This shows how we managed to create categories from smaller groups to broader category.
Making Sense of Categories and Groups with Clear Names
While grouping products works well, category names can still be confusing. For instance, a category might just be labeled “fresh mango, mango juice, mango,” which doesn't help in conveying its content. To make this clearer, we use LLM models to automatically label each category with names that make sense to the customer, like “Mango Juice.” This makes the system much more user-friendly.
To ensure the labels convey the content of their groups and products, we built a RAG system to retrieve the most representative products and names in a group and passed it to the LLM to generate a human-readable label.
Using Category Embedding to Expand Discovery
Each category we generate also has a vector embedding to facilitate search at a higher level. These embeddings are the average of all product content embeddings that belong to it, allowing the system to find similar categories from the retrieved products.
How it works in production:
Match the Query
The system first identifies which category the user’s query fits into.Find Related Categories
It then finds categories that are most similar to the original one, broadening the search results with related products.Expand the Search
By recommending products from related categories, the user gets more options without the system deviating from their original search matches.
This ensures that recommendations are still relevant while offering more variety to choose from.
Why Category-Level Matching Makes Sense
By focusing on category-level matching instead of just individual products, the system benefits in two key ways:
Relevance: Grouping by category helps ensure that the recommendations still align with the user’s original intent.
Diversity: The broader category approach offers more variety in results without overwhelming users with irrelevant options.
A Practical, Flexible Solution for Any Domain
This approach integrates simple yet effective techniques like similarity-based grouping, hierarchical clustering, and RAG for intuitive labeling. By doing so, it provides a scalable, adaptable solution that enhances search results with more relevant and diverse recommendations. Its practicality ensures easy implementation across various fields, delivering a superior and user-friendly search experience.