Adaptive RAG app for building per-workspace knowledge bases from uploaded documents and chatting with them.
Includes:
apps/api: FastAPI backend (auth, workspaces, uploads, chat/query)apps/web: Next.js web UI (workspaces, uploads, chat)src/ragify: core RAG pipeline (ingestion, context-aware chunking, embeddings/vector store, LangGraph routing)- Infra: Docker Compose for MongoDB, Qdrant, and Grobid
- Storage: MongoDB for users/workspaces/sessions
- Vector DB: Qdrant per workspace collection
- Ingestion:
- PDFs: Grobid-based parsing (batch) + indexing
- Markdown/other files: convert to Markdown, chunk, index
- Generation: LangGraph workflow that routes queries (
indexvsgeneralvssearch) and can optionally call Tavily search
From repo root:
./run.sh startThis uses infra/docker/docker-compose.yml with env from infra/.env.
Copy env templates and adjust values:
cp .env.example .env
cp infra/.env.example infra/.envCommon variables (see .env.example):
MONGODB_URIVECTORDB_URL(Qdrant)JWT_SECRETLLM_URL,LLM_MODEL,LLM_API_KEYTAVILY_API_KEY(optional, for web search route)
cd apps/api
./run.sh devAPI runs on http://localhost:8000 and exposes routes under /api/v1.
cd apps/web
pnpm install
pnpm devDefault UI: http://localhost:3000.
POST /api/v1/auth/register,POST /api/v1/auth/loginGET /api/v1/workspaces,POST /api/v1/workspacesPOST /api/v1/workspaces/{workspaceId}/upload(multi-file)POST /api/v1/workspaces/{workspaceId}/queryGET /api/v1/workspaces/{workspaceId}/sessions
apps/api/Dockerfile: builds and runsuvicorn apps.api.main:appapps/web/Dockerfile: builds Next.js standalone outputinfra/docker/docker-compose.yml: MongoDB, Qdrant, Grobid
- Workspace data is stored under
apps/api/storage/workspaces/<workspace_id>/. - Qdrant collections are created per
workspace_id.