An end-to-end Retrieval-Augmented Generation (RAG) application that enables Product Managers, Brand Managers, Category Managers, and E-commerce Analysts to explore Amazon Fashion products using natural language instead of manually analyzing thousands of product listings and customer reviews.
The system combines Hybrid Retrieval (Dense + BM25), Large Language Models, Monitoring, and Evaluation to generate accurate, grounded answers from Amazon Fashion product data.
π― Business Problem Product managers and brand managers often need to analyze hundreds of product listings and thousands of customer reviews to understand customer sentiment, compare competitors, identify product strengths and weaknesses, and make pricing or merchandising decisions. Manual analysis is time-consuming and difficult to scale.
The Amazon Fashion Product Intelligence System addresses this challenge by combining Retrieval-Augmented Generation (RAG) with hybrid search to provide accurate, evidence-grounded answers from product metadata and customer reviews using natural language.
- End-to-End Production-style RAG Pipeline
- Hybrid Retrieval (Dense Embeddings + BM25 + Reciprocal Rank Fusion)
- Semantic Search using Sentence Transformers
- Chroma Vector Database
- Gemini-powered Answer Generation
- Modular & Maintainable Architecture
- Prompt Strategy Framework
- LLM-as-a-Judge Evaluation
- Monitoring Dashboard with Telemetry Metrics
- Interactive Streamlit Chat Interface
This project was developed following the LLM Zoomcamp evaluation rubric. The table below maps each evaluation criterion to its implementation in this repository.
| Evaluation Criterion | Score | Repository Location | Description |
|---|---|---|---|
| Problem Description | β 2/2 | README.md |
Clearly defines the business problem and target users (Product Managers, Brand Managers, Category Managers, and E-commerce Analysts). |
| Retrieval Flow | β 2/2 | src/pipeline/src/retrieval/src/vector_store/src/context_builder/src/llm/ |
Complete Retrieval-Augmented Generation (RAG) pipeline combining a knowledge base with Google Gemini for grounded answer generation. |
| Retrieval Evaluation | β 2/2 | src/retrieval/src/evaluation/ground_truth/src/evaluation/evaluator/ |
Evaluates Dense Retrieval, BM25 Retrieval, and Hybrid Retrieval (Reciprocal Rank Fusion), selecting the best-performing approach. |
| LLM Evaluation | β 2/2 | src/evaluation/llm/ |
Compares multiple prompt strategies and evaluates generated answers using an LLM-as-a-Judge evaluation framework. |
| Interface | β 2/2 | ui/app.pyui/components/ |
Interactive Streamlit application for natural language querying of Amazon Fashion products. |
| Ingestion Pipeline | src/scripts/preprocess_data.pysrc/indexing/run.py |
Automated preprocessing and indexing through Python scripts. No orchestration framework (Airflow, Prefect, dlt, etc.) is used. | |
| Monitoring | src/monitoring/ui/monitoring.py |
Telemetry collection and interactive monitoring dashboard with multiple visualizations. | |
| Containerization | β 0/2 | β | Docker support is not included. |
| Reproducibility | β 2/2 | README.mdpyproject.tomlconfig/ |
Complete setup instructions, dependency management using uv, configuration files, and execution commands are provided. |
| Best Practice | Status | Repository Location |
|---|---|---|
| Hybrid Search (Dense + BM25 + Reciprocal Rank Fusion) | β | src/retrieval/ |
| Document Re-ranking | β | Not Implemented |
| User Query Rewriting | β | Not Implemented |
Note: This table is a self-assessment based on the published LLM Zoomcamp evaluation rubric. Final scoring is determined by the project reviewers.
amazon-product-intelligence/
β
βββ config/ # Application configuration
β
βββ data/
β βββ raw/ # Original dataset
β βββ processed/ # Cleaned dataset
β βββ chroma/ # Vector database
β
βββ docs/
β βββ architecture/ # System diagrams
β βββ adr/ # Architecture decisions
β
βββ outputs/
β βββ evaluation/ # Evaluation reports
β βββ monitoring/ # Telemetry logs
β βββ ground_truth/ # Generated benchmark dataset
β
βββ src/
β βββ preprocessing/ # Data cleaning pipeline
β βββ document_builder/ # Product document generation
β βββ chunking/ # Document chunk creation
β βββ embeddings/ # Embedding generation
β βββ indexing/ # Knowledge base indexing
β βββ retrieval/ # Hybrid retrieval engine
β βββ context_builder/ # Context assembly
β βββ prompt_builder/ # Prompt construction
β βββ llm/ # Gemini integration
β βββ pipeline/ # End-to-end RAG workflow
β βββ monitoring/ # Telemetry collection
β βββ evaluation/ # Retrieval & LLM evaluation
β βββ scripts/ # Utility & setup scripts
β βββ vector_store/ # ChromaDB management
β
βββ ui/
β βββ app.py # Chat application
β βββ monitoring.py # Monitoring dashboard
β
βββ README.md # Project documentation
git clone <repository-url>
cd amazon-product-intelligenceuv syncCreate a .env file.
GEMINI_API_KEY=YOUR_GEMINI_API_KEYpython -m src.scripts.preprocess_dataThis cleans and standardizes the raw Amazon Fashion dataset.
python -m src.indexing.runThis:
- Generates product documents
- Chunks documents
- Creates embeddings
- Builds the Chroma vector database
- Builds the BM25 index
Note: This step only needs to be run once or whenever the dataset changes.
PYTHONPATH=. uv run streamlit run ui/app.pyPYTHONPATH=. uv run streamlit run ui/monitoring.pypython -m src.evaluation.ground_truth.runpython -m src.evaluation.llm.runpython -m src.evaluation.evaluator.run| Document | Description |
|---|---|
docs/architecture/system-architecture.png |
Complete system architecture |
docs/architecture/system-design.md |
High-level design and component interactions |
docs/architecture/rag-pipeline.md |
End-to-end RAG pipeline workflow |
docs/adr/ADR-001-Hybrid-Retrieval.md |
Architectural Decision Record for Hybrid Retrieval |
docs/adr/ADR-002-Embedding-Model.md |
Embedding model selection rationale |
- Python 3.12
- Google Gemini
- Sentence Transformers
- BAAI/bge-small-en-v1.5
- ChromaDB
- BM25
- Reciprocal Rank Fusion
- Streamlit
- Pandas
- NumPy
- Plotly
- Streamlit Dashboard
- LLM-as-a-Judge
- Prompt Strategy Evaluation
- uv
- Git
- VS Code
