Blog
All posts

Building a shopping assistant with RAG and pgvector

20 June 2026 · Abdellah Bouskri

A chatbot that invents products is worse than no chatbot. For VeloStore I used retrieval-augmented generation so every recommendation comes from the real catalog.

Retrieve first

Product descriptions are embedded and stored in PostgreSQL with pgvector. A question becomes an embedding, and a similarity search returns the closest products.

Then generate

Only those products are passed to the model as context, with an instruction to recommend from them alone. The answer stays grounded and checkable.

Local or cloud

The model layer is swappable: Ollama for local development, Groq or Gemini in the cloud. That kept development free and production fast.