← All projects

AI / ML

Amazon Product RAG Chatbot

A ChatGPT-style interface for asking plain-English questions about ~55K Amazon products. Questions become SQL, the results come back as data, and an LLM turns them into grounded answers.

Amazon logo Not affiliated with Amazon
Type
Team of 3
Category
AI / ML
Stack
Python · Flask · Next.js · SQLite · OpenAI API

How it fits together

Architecture diagram: Next.js chat UI and Flask API (question ⇄ answer); Flask API to generate_sql (question); generate_sql to SQLite (run_sql); SQLite to generate_answer (rows); generate_answer to Flask API (answer text)

A question becomes one read-only SQL query, the rows come back from SQLite, and a second model call writes the answer. The UI turns product mentions into Amazon links and images.

The problem

Amazon product data is huge and numeric: prices, ratings, rankings, categories. Keyword search can’t answer questions like “which budget headphones have the best rating?”, which need filtering, sorting and aggregating across the whole catalog. This project lets anyone ask those questions in plain English and get an answer backed by real data.

Approach

  • Users ask a question in a ChatGPT-style chat interface built with Next.js
  • A Flask API passes the question to OpenAI’s models, which translate it into a SQL query
  • The query runs against a SQLite database of Keepa data covering ~55K Amazon products
  • The returned rows go back to the LLM as context, so the final answer is grounded in the data (retrieval-augmented generation) rather than the model’s memory
  • Frontend and backend are separate apps: the Next.js client talks to the Flask API over HTTP, and each has its own setup and docs

Highlights

  • Text-to-SQL RAG pipeline over ~55K products
  • Product data from Keepa, stored in SQLite
  • Answers come from query results rather than model memory
  • Co-built with a team of 3 across a Flask backend and Next.js frontend