YafRAG is a simplified, memory-optimized Retrieval-Augmented Generation (RAG) implementation. It enables querying and chatting with uploaded documents easily.
- Frontend: React, built with Vite and TailwindCSS v4, featuring a beautiful interface using HeroUI v3.
- Backend: Python (FastAPI), providing endpoints for document ingestion and real-time streaming LLM chats. Uses
MarkItDownfor deep document parsing underneath LanceDB. - Infrastructure: Standardized with
docker-composefor easy deployment and container constraints suited for small VPS environments.
- Clone the project.
- Ensure you create a
.envfile at the root by copying.env.exampleand filling in yourGEMINI_API_KEY:cp .env.example .env
- Run the application:
docker-compose up -d --build
The client will be available at http://localhost:5173/ and the backend will start at http://localhost:8080/.
If developing locally without Docker:
- For Backend:
cd server && pip install -r requirements.txt && uvicorn main:app --reload --port 8080 - For Frontend:
cd client && npm install && npm run dev
The project contains a GitHub Action Workflow in .github/workflows/deploy.yml which is configured for manual deployment (workflow_dispatch). It attempts to connect to your remote VPS via SSH, pull the latest code, and spin up docker-compose up -d --build automatically.
You will need to configure the following GitHub Repository Secrets:
HOST: Server IP AddressUSERNAME: SSH UsernameSSH_PRIVATE_KEY: Your SSH Private KeyGEMINI_API_KEY: API Key for the Gemini LLM
