Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vectorless-RAG

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.


Overview

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.


Features

  • 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

Tech Stack

Frontend

  • React 19
  • Vite
  • Tailwind CSS
  • Framer Motion
  • Axios

Backend

  • FastAPI
  • SQLAlchemy
  • PostgreSQL
  • pdfplumber
  • rank-bm25
  • Ollama

Tools

  • Docker Compose
  • Uvicorn

Project Structure

vectorless-rag/
│
├── backend/
│   ├── app/
│   │   ├── api/
│   │   ├── core/
│   │   ├── db/
│   │   ├── models/
│   │   ├── schemas/
│   │   └── services/
│   ├── evaluation/
│   └── requirements.txt
│
├── frontend/
│   ├── src/
│   ├── public/
│   └── package.json
│
├── docker-compose.yml
└── README.md

How It Works

  1. Upload a PDF document.
  2. Extract and clean the document text.
  3. Split the text into searchable chunks.
  4. Store the chunks in PostgreSQL.
  5. Perform Full-Text Search and BM25 retrieval.
  6. Rank the retrieved chunks.
  7. Build context from the top results.
  8. Generate an answer using Ollama.
  9. Return the answer along with its source documents.

Installation

Clone the repository

git clone https://github.com/Alexrohith/vectorless-rag.git

cd vectorless-rag

Backend

cd backend

python -m venv venv

# Windows
venv\Scripts\activate

pip install -r requirements.txt

uvicorn app.main:app --reload

Frontend

cd frontend

npm install

npm run dev

Docker

Run the entire application using Docker Compose.

docker compose up --build

API Endpoints

Method Endpoint Description
POST /upload Upload PDF documents
POST /query Ask questions about uploaded documents
POST /compare Compare retrieval strategies

Future Improvements

  • Dense vector retrieval
  • Hybrid sparse + dense search
  • Cross-encoder reranking
  • Multi-document reasoning
  • Authentication
  • Streaming responses
  • Cloud deployment

License

This project is intended for educational and research purposes.

About

Vectorless-RAG - Quick Summary A hybrid RAG system that eliminates hallucinations through intelligent retrieval + local LLM generation.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages