Prepares in-stock products for search by meaning, so a phrase, a misspelling or an occasion can find the nearest colourways without a product name.
Semantic Search & RAG
Footwear retail
Pipeline
Productised
Local/private
2026
The problem
Imported products cannot be found by meaning until their text has been processed. Keyword search misses a casual garment that belongs with a casual shoe, and it misses the shoe itself when the shopper misspells it.
What it does
After each import, a batch job processes active products that are new or whose text has changed, and saves the result. In the shop, keyword matches still come first. A longer phrase, or a search with no match, is filled from the closest in-stock products, and plain style codes stay on exact match. The job does not run when a shopper visits the site.
Outcomes
New stock becomes searchable by meaning after the batch, with no manual tagging.
A misspelling or a phrase still returns in-stock colourways.
Style codes keep an exact match.
Changed product text is processed again, so the search data does not go out of date.
Simplified mockup
Interactive preview with sample data. Nothing is sent to a server.
Vectors after import
Empty vectors
12
this batch
Will store
8
active, with search text
Will skip
4
inactive, blank or unsold
Products
Style
Product
Colour
Stock
Vector
PL-220
Penny loafer
Tan
42
empty
PL-220
Penny loafer
Black
18
empty
CB-118
Country boot
Brown
27
empty
CB-118
Country boot
Olive
11
empty
SP-090
Plimsoll
White
64
empty
WC-305
Weekend chinos
Stone
33
empty
WJ-014
Waxed jacket
Olive
9
empty
OX-440
City oxford
Burgundy
15
empty
SP-091
Plimsoll
Navy
0
empty
CB-000
Country boot
none
4
empty
PL-221
Penny loafer
Tan
42
empty
SK-012
Wool scarf
Oat
20
empty
Batch
Refuses to run as a web request
Stored
0
searchable by meaning
Still pending
0
left for a reason, not dropped silently
Why four were left
SP-091
Plimsoll, navy
out of stock, so it is not a neighbour yet
CB-000
Country boot
no search text to embed
PL-221
Penny loafer
inactive, skipped with the row
SK-012
Wool scarf
text shorter than the batch allows
Shop search
Keywords did not insist on more boots. The phrase pulled clothing that belongs with a soft shoe.
Waxed jacket
WJ-014 · olive · 9 in stock
0.84
Weekend chinos
WC-305 · stone · 33 in stock
0.81
Penny loafer
PL-220 · tan · 42 in stock · not a boot
0.74
The spelling missed every keyword. Three in-stock neighbours came back from the vectors.
Country boot
CB-118 · brown · 27 in stock
0.71
Penny loafer
PL-220 · tan · 42 in stock
0.66
City oxford
OX-440 · burgundy · 15 in stock
0.63
A bare style code stays on exact match. It is not sent through the vector path.
City oxford
OX-440 · burgundy · 15 in stock
exact
Miss beside an exact code
wetherproof brouge 3 neighbours
Country boot
CB-118 · brown
0.71
Penny loafer
PL-220 · tan
0.66
City oxford
OX-440 · burgundy
0.63
OX-440 exact
City oxford
burgundy · 15 in stock
1 row
Style codes keep an exact match. Neighbours are not added.
How it works
Select active products that are new or have changed text, in batches.
Turn the search text into a numerical fingerprint of its meaning with Ollama, and store it.
Refuse to run from a web page, so shoppers cannot trigger the script.
Try keywords first on a shop search.
Match a longer phrase, or a miss, by meaning and fill it from the closest in-stock products.
Skip the search by meaning for exact style codes.
Pipeline
flowchart LR
Import[New product text] --> Batch[Embed missing vectors]
Batch --> Store[Vector on the product]
Phrase[Shopper phrase] --> Keyword[Keyword hits first]
Keyword --> Near[Nearest in-stock neighbours]
Store --> Near
Near --> Results[Colourway results]