A full-stack Retrieval-Augmented Generation (RAG) system that combines PostgreSQL Full-Text Search, BM25 ranking, and a local Large Language Model (Ollama) to provide accurate, context-aware answers from PDF documents.
Vectorless-RAG is designed to demonstrate that effective Retrieval-Augmented Generation can be built using traditional information retrieval techniques instead of relying solely on vector embeddings.
The application allows users to upload PDF documents, retrieve relevant information using hybrid search, and generate grounded responses with source attribution.
- Upload and process PDF documents
- Automatic text extraction and chunking
- PostgreSQL Full-Text Search (FTS)
- BM25 keyword ranking
- Hybrid retrieval pipeline
- Local LLM integration using Ollama
- Source-based answer generation
- Modern React frontend
- FastAPI backend
- Docker support
- Evaluation framework for retrieval comparison
- React 19
- Vite
- Tailwind CSS
- Framer Motion
- Axios
- FastAPI
- SQLAlchemy
- PostgreSQL
- pdfplumber
- rank-bm25
- Ollama
- Docker Compose
- Uvicorn
vectorless-rag/
│
├── backend/
│ ├── app/
│ │ ├── api/
│ │ ├── core/
│ │ ├── db/
│ │ ├── models/
│ │ ├── schemas/
│ │ └── services/
│ ├── evaluation/
│ └── requirements.txt
│
├── frontend/
│ ├── src/
│ ├── public/
│ └── package.json
│
├── docker-compose.yml
└── README.md
- Upload a PDF document.
- Extract and clean the document text.
- Split the text into searchable chunks.
- Store the chunks in PostgreSQL.
- Perform Full-Text Search and BM25 retrieval.
- Rank the retrieved chunks.
- Build context from the top results.
- Generate an answer using Ollama.
- Return the answer along with its source documents.
git clone https://github.com/Alexrohith/vectorless-rag.git
cd vectorless-ragcd backend
python -m venv venv
# Windows
venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reloadcd frontend
npm install
npm run devRun the entire application using Docker Compose.
docker compose up --build| Method | Endpoint | Description |
|---|---|---|
| POST | /upload |
Upload PDF documents |
| POST | /query |
Ask questions about uploaded documents |
| POST | /compare |
Compare retrieval strategies |
- Dense vector retrieval
- Hybrid sparse + dense search
- Cross-encoder reranking
- Multi-document reasoning
- Authentication
- Streaming responses
- Cloud deployment
This project is intended for educational and research purposes.