Skip to content

sumitaryal/RAG-Project

Repository files navigation

Retrieval Augmented Generation

FastAPI-based RAG service with Postgres(database), Qdrant(vector database), Gemini OCR, and Hugging Face embeddings.

Key files:

Prerequisites

  • Docker and Docker Compose
  • Or Python 3.11 and uv (for manual setup)

1) Run with Docker Compose

This brings up Postgres, Qdrant, and the API. The API container installs deps using uv, runs Alembic migrations, then starts Uvicorn via scripts/entrypoint.sh.

  • Prepare env:

    • cp .env.example .env
    • Edit .env (set GEMINI_API_KEY, etc.)
  • Start stack:

    • docker compose up --build
  • URLs:

  • Volumes (persist data/caches):

    • pg_data, qdrant_storage, app_data, hf_cache, torch_cache

Compose sets service URLs to container hostnames in docker-compose.yml (DB at db:5432, Qdrant at qdrant:6333). Migrations are run automatically on container start.

2) Manual setup with uv

Use uv to create a virtual env and install dependencies from pyproject.toml and uv.lock.

  1. Install uv (one-time):

  2. Create venv and install deps:

    • uv venv
    • uv sync
  3. Configure environment:

    • cp .env.example .env
    • Ensure DB/Qdrant env vars point to localhost (as in .env.example)
  4. Start only infra services (Postgres + Qdrant) with Docker:

    • docker compose up -d db qdrant
  5. Run Alembic migrations (uses alembic/env.py, which reads app.core.settings):

    • uv run alembic upgrade head
  6. Start the API:

    • uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --loop asyncio

API will be available at:

Notes

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published