Skip to content
← All projects

Letting shoppers search the catalogue in plain language

  • LLM
  • Elasticsearch
  • Spring Boot
  • React Native
  • AWS

Keyword search failed whenever a shopper didn’t know a product’s exact name. I built a conversational search layer where an LLM translates the request into a structured Elasticsearch query, so non-technical users can run searches that used to need filters.

From a sentence to a query

The examples below are illustrative — field names are simplified, not Grabbit’s real schema.

Shopper types

“cheap snacks for a party of 10, nothing spicy”

LLM extracts

category: snacks · price: low · exclude: spicy · prefer bulk packs

Generated Elasticsearch query
{
  "query": { "bool": {
    "must":     [{ "match": { "category": "snacks" } }],
    "must_not": [{ "match": { "tags": "spicy" } }],
    "should":   [{ "match": { "pack": "party" } }]
  }},
  "sort": [{ "price": "asc" }]
}

One search request

Click any stage to see what happens there.

LLM → structured query

The LLM reads the request and produces a structured Elasticsearch query instead of free text.

[Model / provider] · prompt with field schema

The hard parts of running an LLM in a live product

Risk How I handled it
The model writes an invalid or unsafe query [Describe your validation — e.g. structured output against an allow-list of fields and operators]
The model is slow or down [e.g. timeout, then fall back to plain keyword search]
It needs to know the catalogue [e.g. categories and field schema supplied in the prompt]
Cost per search [e.g. model choice, caching common queries]
Knowing it actually helped [e.g. search-to-cart or zero-result rate, before vs after]

Outcome

Non-technical users can run complex product searches, which made the catalogue noticeably easier to discover. [Add one measured number here — it is the single most persuasive line on this page.]