A production-grade ETL pipeline that scrapes e-commerce product catalogs, enriches them with AI-generated embeddings, and stores them in vector and relational databases to power semantic search for a retail chat agent.
This pipeline automates the ingestion and vectorization of product catalogs, enabling the retail chat agent to perform intelligent semantic search across millions of products. It combines web scraping, image processing, and multi-modal embeddings to create a searchable product knowledge base.
- Orchestration: Apache Airflow
- Data Storage: PostgreSQL (relational), Qdrant (vector)
- Embeddings: OpenAI CLIP (text + image)
- Object Storage: AWS S3
- Language: Python 3.11
- Containerization: Docker
The ingestion pipeline performs the following steps:
- Scraping: Extracts product URLs from collection pages
- Product Parsing: Parses product data (title, price, images, description, etc.) from product pages
- Image Upload: Uploads product images to S3
- PostgreSQL Upsert: Stores product metadata in PostgreSQL
- Embedding Generation: Creates text and image embeddings using CLIP
- Qdrant Upsert: Stores embeddings in Qdrant vector database
- Tracking: Records embedding metadata in PostgreSQL
┌─────────────────┐
│ Collection URL │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Extract URLs │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Parse Products │
└────────┬────────┘
│
┌────┴────┐
│ │
▼ ▼
┌────────┐ ┌──────────┐
│ S3 │ │PostgreSQL│
└────────┘ └────┬─────┘
│
▼
┌──────────────┐
│ Generate │
│ Embeddings │
└──────┬───────┘
│
▼
┌──────────────┐
│ Qdrant │
└──────────────┘
-
For instructions on setting up the databases, see docs/how-to/create-databases.md
-
Create an AWS S3 bucket and configure credentials in
config/settings.py -
Use the env.example file to create a
.envfile with necessary environment variables (database URLs, S3 credentials, etc.) -
Build the custom Airflow image with dependencies and DAGs baked in:
make ingestion-build
-
Start the Airflow stack with Docker Compose:
make ingestion-up
This project is for informative and educational purposes only. It is not intended for commercial use. The code, documentation, and examples provided are meant to demonstrate concepts and practices related to ETL pipelines, vector databases, and semantic search. Users are responsible for complying with applicable laws and terms of service when using or adapting this code.