Case study

A RAG product recommendation engine grounded in live data

The situation

A consumer-facing product recommendation system with a familiar failure mode to avoid: ask an LLM for product suggestions and it will happily invent products that don't exist, at prices nobody charges. The goal was a recommendation engine that understood natural-language requests but only ever answered from real, current product data. I built it end-to-end.

What I built

A RAG pipeline with three moving parts.

First, structured query extraction. User requests go through OpenAI function calling with anti-hallucination constraints: tool-forcing so the model must answer through the defined function, and bounded output schemas so what comes back is a typed query object rather than prose. The model's job is narrowed to understanding intent. It never gets to make up an answer.

Second, live product search. The extracted query runs against a product API backed by a searchable database, so every recommendation traces back to a real product record with a real price.

Third, the part that gets underestimated: data ingestion. Batch pipelines download and normalise product data from multiple affiliate networks, in CSV and JSON, each with its own schema quirks and refresh cadence, and load it into the search database. Stale or malformed product data poisons every answer downstream, so the pipeline does the unglamorous work of validation and normalisation before anything reaches retrieval.

The outcome

A production recommendation system where the LLM does what it's good at, interpreting messy human requests, and the database does what it's good at, being right about facts. Recommendations are grounded in live product data from multiple affiliate sources, and the structured extraction layer means business logic deals in typed queries rather than parsing model prose.

The transferable lesson for teams planning RAG work: the retrieval and ingestion layers decide whether the system is trustworthy. Model choice matters far less than the quality of the data you ground it in, and the discipline of keeping the model's output structured.

The model interprets the request. The database answers it. Keeping those jobs separate is what makes RAG dependable.

Built with: OpenAI function calling, batch ingestion pipelines (CSV/JSON), searchable product database, live product search API.