Skip to content

GalychMaks/RecipeRAG

Repository files navigation

RecipeRAG

Recipe assistant built with Retrieval-Augmented Generation, FastAPI, and Docker.

⚙️ Installation

🔧 Set Up the Python Environment

  1. Clone the repository

  2. Install uv — A fast Python package manager
    📖 Installation guide

  3. Create and activate a virtual environment

    uv venv .venv
    source .venv/bin/activate
  4. Install dependencies

    Development setup (app + dev tools):

    uv sync

    Production-only (skip dev tools):

    uv sync --no-group dev
  5. Enable pre-commit hooks [Optional]

    uv run pre-commit install

🚀 Running the App

🔹 Option A --- Run everything with Docker Compose (recommended)

All services (API, Postgres + pgvector, Ollama) can be started in one command:

docker compose up

🔹 Option B --- Run with Taskfile (local dev)

If you prefer to manage services separately:

  1. Start Ollama

    task ollama:up
  2. Start Postgres

    task db:up
  3. Run the FastAPI app

    task app:run

📄 Example .env

Create a .env file in the project root with your environment variables:

OPENAI_API_KEY=ollama
OPENAI_BASE_URL=http://ollama:11434/v1
EMBEDDING_MODEL=nomic-embed-text

POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_HOST=db
POSTGRES_DB=mydb
POSTGRES_PORT=5432

DATABASE_URL="postgresql+psycopg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"

⚠️ Inside Docker Compose, use POSTGRES_HOST=db (the service name), not localhost.

📓 Usage Example (Notebook)

Walks through creating an assistant, creating a chat, and getting completions.

Shows the same flow, but calls the /completions endpoint with ?rag=true.

✅ Prerequisite for RAG: run the offline indexer to populate the vector store

task app:index

About

Recipe assistant built with Retrieval-Augmented Generation, FastAPI, and Docker.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors