Local Development
Prerequisites
- Python 3.11 or newer
venv- access to Supabase, Pinecone, and OpenAI credentials
- optional
psqlaccess if you plan to apply SQL locally or against a non-production database
Environment setup
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
cp .env.example .env
Populate .env with real values for:
- Supabase URL and service-role key
- Supabase JWT secret
- Pinecone API key and index name
- OpenAI API key and model overrides if needed
Database setup
This repo does not include an active migration runner script in scripts/. Use SQL tooling directly.
Recommended order for a fresh environment:
- apply
db/bootstrap.sql - apply every file in
db/migrations/in lexical order
Example with psql:
psql "$DATABASE_URL" -f db/bootstrap.sql
for f in db/migrations/*.sql; do
psql "$DATABASE_URL" -f "$f"
done
Running the API
Option 1, directly:
Option 2, Docker:
Health check:
Validation workflow
Run the backend checks that are actually wired in this repo:
Use postman/check_sync.py whenever API routes change. CI enforces this in .github/workflows/postman-sync-guard.yml.
Local notes
- The API constructs external clients at import time, so missing env vars often fail fast.
- Rate limiting and metrics are in-memory; local restarts reset both.
- Background ingestion dispatch uses FastAPI background tasks. It does not require a separate worker process locally because the repo does not define one.