genai / README.md
gauravprasadgp's picture
readme
de4f1b7
metadata
title: Modular-RAG
emoji: πŸ“
colorFrom: blue
colorTo: indigo
sdk: docker
app_file: main.py
pinned: false

Modular RAG

A hybrid approach to implement RAG inspired by Advance RAG. Usually implemeted with modules acting as plug and play.

Documentation

Generator:

Core component of RAG, responsible for transforming the retrieved information into natural and human sense.

Retriever:

The word "R" in RAG, serving the purpose of retrieving the top K element from knowledge base.

ReRank:

As the name suggest a model used to re-rank the relevant documents. It indexes the documents based on the similariy score between question and the retrieved documents post vector search.

Run Locally

Clone the project

  git clone https://github.com/gauravprasadgp/modular-rag

Go to the project directory

  cd modular-rag

Install dependencies

pip install -r requirements.txt

Run postgres locally

cd pgvector
docker compose -d up

Start the server

  python main.py

API Reference

Upload file to create embedding

  POST /create
Parameter Type Description
file file Required. File to upload

Get answer from user query

  POST /answer
Parameter Type Description
query string Required. user query

License

MIT