chahir.dev
Back to blog

Blog

🤖

AI-Powered WooCommerce Search with OpenSearch

AI WooCommerce OpenSearch WordPress PHP

Building SamiAI: a streaming AI shopping assistant with hybrid BM25/k-NN search deployed across multiple e-commerce stores.

When a client asks for 'smart product search', they usually mean autocomplete. When I deliver SamiAI, I mean something else entirely.

SamiAI is a WordPress plugin that streams AI-generated answers grounded in real product catalog data, using a hybrid retrieval strategy combining BM25 keyword matching with k-NN semantic similarity via OpenSearch and the all-MiniLM-L6-v2 embedding model.

The trickiest engineering challenge: SSE `data:` lines split across cURL read callbacks causing dropped tokens mid-stream. I'll show you the exact fix.