An end-to-end RAG-based personal knowledge base. Upload PDFs, notes, bookmarks, and research papers. Chat naturally to query your documents. A critic agent validates responses for factual consistency.
- Upload and manage documents (PDF, text, markdown, HTML)
- Ingestion: parse, chunk, and embed content
- Vector search + RAG generation
- Critic agent that checks answers against sources
- Minimal web UI (uploads + chat)
- Dockerized deployment
- Copy
.env.example
to.env
and update keys - Install Docker and Docker Compose
- Run:
docker compose up --build
- Open the UI at
http://localhost:5173
- API docs at
http://localhost:8000/docs
- Backend (Python 3.11+):
python -m venv .venv
. .venv/Scripts/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
pip install -r backend/requirements.txt
uvicorn app.main:app --app-dir backend --reload --host 0.0.0.0 --port 8000
- Frontend:
cd frontend
npm i
npm run dev -- --host
Set environment variables in .env
:
OPENAI_API_BASE
,OPENAI_API_KEY
: OpenAI-compatible APIOPENAI_MODEL
,OPENAI_EMBED_MODEL
: chat and embedding modelsDATA_DIR
,VECTOR_DB_DIR
,UPLOAD_DIR
: storage pathsCORS_ALLOW_ORIGINS
: comma-separated or*
- Backend: FastAPI, LangChain, FAISS
- LLM: OpenAI-compatible API
- Frontend: React + TypeScript
docker-compose.yml
runs backend and frontend services- Bind mounts
storage/
for persistence
- For air-gapped or self-hosted LLMs, set
OPENAI_API_BASE
to your server - PDFs parsed with
pypdf
; HTML/Markdown withBeautifulSoup
andmarkdown-it-py