System requirements
- Python: 3.11 or higher
- Docker: 20.10 or higher (for PostgreSQL with pgvector)
- Docker Compose: 2.0 or higher
- Memory: At least 4GB RAM recommended
- Storage: 2GB free space for Docker images and database
Installation methods
- Local development
- Docker (recommended)
Clone the repository
Create a virtual environment
Install dependencies
View key dependencies
View key dependencies
Set up PostgreSQL with pgvector
Start the database using Docker Compose:retail_rag_db with status “Up” and “(healthy)”.Configure environment variables
Create a.env file in the project root:Initialize the database
The database schema is automatically created when you first run the application:app/main.py:8 creates the pgvector extension and all necessary tables:Seed sample data
Populate the database with sample products:The seed script includes a 0.5-second delay between products to avoid hitting Google Gemini API rate limits.
Verify installation
Test that everything is working:Troubleshooting
Database connection error
Database connection error
If you see
connection refused errors:- Ensure PostgreSQL is running:
docker ps - Check the port isn’t already in use:
lsof -i :5435(macOS/Linux) - Verify the
DATABASE_URLin your.envfile matches the Docker Compose configuration
Gemini API errors
Gemini API errors
If you see embedding or generation errors:
- Verify your API key is correct in
.env - Check you haven’t exceeded the free tier quota
- Ensure your IP isn’t blocked (try from a different network)
Import errors after pip install
Import errors after pip install
If Python can’t find the
app module:- Ensure you’re in the project root directory
- Verify your virtual environment is activated
- Try reinstalling:
pip install -r requirements.txt --force-reinstall
Docker build fails
Docker build fails
If the Docker image won’t build:
- Ensure you have enough disk space:
docker system df - Clean up old images:
docker system prune -a - Check the Dockerfile for syntax errors
Next steps
Quickstart
Follow the quickstart guide to make your first API call
Environment setup
Learn about all configuration options
Database setup
Deep dive into PostgreSQL and pgvector configuration
Architecture
Understand how the system works