Retrieval-Augmented Generation that actually works. RAGify is a modern chat experience that answers questions from your documents, cites its sources, and admits when it does not know. Try it live: https://ragify-sqhu4om4aq-ew.a.run.app/
- Grounded answers with inline citations and “I don’t know” fallbacks
- Multiple assistants tied to different knowledge bases and model presets
- 100+ AI models via OpenRouter (OpenAI, Anthropic, Google, Meta, etc.)
- Hybrid retrieval (semantic vectors + keyword search) running locally on SQLite or remotely on PostgreSQL
- Modern UI built with Tailwind and vanilla JS
- Cloud-ready: single-container Cloud Run deploy with the embedded SQLite database—no external services required
The public Cloud Run deployment runs the same configuration described below. Feel free to explore it, upload a PDF, and ask questions:
- Chat + Knowledge Base UI:
https://ragify-sqhu4om4aq-ew.a.run.app/
Uploads made to the demo instance are purged periodically. Bring your own OpenRouter key for local/private deployments.
| Layer | Default | Optional |
|---|---|---|
| API | FastAPI + SQLAlchemy | – |
| Database | SQLite (ragify.db) via SQLAlchemy Async + StaticPool |
PostgreSQL + pgvector |
| Cache | In-memory LRU | Redis (auto-disabled when unavailable) |
| Models | OpenRouter (configurable in UI or .env) |
Other providers via shared/models |
| Frontend | Static HTML/CSS/JS (Tailwind) served by FastAPI or Vite dev server | – |
SQLite is now the recommended default for local development and Cloud Run. PostgreSQL/Redis remain fully supported—flip the switch at runtime if you need them.
git clone https://github.com/OthmaneBlial/RAGify.git
cd RAGify
cp .env.example .env # add your OPENROUTER_API_KEY
python -m venv venv && source venv/bin/activate
pip install -e .
./startup.sh # choose option 1 for SQLite when prompted
# Backend → http://localhost:8000, Frontend → http://localhost:5173What the helper does:
- Lets you choose SQLite or PostgreSQL at runtime.
- Creates/updates
ragify.db(SQLite) or warms up the Postgres pool. - Boots FastAPI on
:8000and serves the static frontend on:5173.
Stop it with Ctrl+C. Delete ragify.db anytime for a clean slate.
Still prefer containers? The repo keeps the base ML dependencies in a reusable image so rebuilds stay quick:
./startupdocker.sh --build # builds base + app images, starts API, frontend, Postgres, Redis
./startupdocker.sh --down # stop the stackHost ports:
- Backend API:
http://localhost:18000 - Frontend:
http://localhost:15173 - PostgreSQL (pgvector):
localhost:15432 - Redis:
localhost:16379
The Docker option mirrors the legacy Postgres/Redis architecture. For most workflows, the lighter SQLite mode above is enough.
Deploy the exact image that powers the public demo:
PROJECT_ID=my-gcp-project \
REGION=us-central1 \
OPENROUTER_API_KEY=... (inside .env) \
./build.shbuild.sh now:
- Builds/pushes the shared dependency base image (if needed).
- Builds the FastAPI+frontend image.
- Generates a Cloud Run–friendly env file from
.env, overridesDATABASE_URLwithsqlite+aiosqlite:///tmp/ragify.db, and disables Redis. - Deploys a single container (no sidecars) with the new env file and prints the service URL.
See DEPLOYMENT.md for the full breakdown or to customize memory/CPU.
examples/ ships with seeds and documents you can import:
- API Documentation Assistant
- Customer Support Bot
- HR & Onboarding Assistant
- Legal Review Assistant
- Research/Study Guides
Load them with:
python examples/scripts/load_examples.pyEach application binds to specific knowledge bases and model presets so you can see how per-assistant configuration works.
Minimum setup (SQLite mode):
- Python 3.8+
- OpenRouter API key (or other provider credentials)
Optional services:
- PostgreSQL 12+ with
pgvectorfor large-scale or shared deployments - Redis 6+ if you want distributed caching (RAGify automatically falls back to the in-memory cache when Redis is absent)
- Copy
.env.example→.env. - Add your
OPENROUTER_API_KEY,SECRET_KEY, etc. - Override
DEFAULT_MODEL,DEFAULT_TEMPERATURE, or other knobs as needed. - For PostgreSQL: set
DATABASE_URL=postgresql+asyncpg://...before runningstartup.sh(choose option 2). - Redis is optional—set
REDIS_URL=(empty) to disable it entirely.
- API docs:
http://localhost:8000/docs - Setup guide: docs/setup.md
- Deployment details: DEPLOYMENT.md
- Frontend pages:
/chat.html,/knowledge.html,/settings.html
pytest # run tests
black . && isort . # formatting
uvicorn backend.main:app --reload -p 8000Happy hacking! Upload a PDF, ask a question, and watch RAGify stay grounded.