Spaces:
Runtime error
Runtime error
File size: 1,592 Bytes
e0078a7 980ba1d e0078a7 de4f1b7 d132e19 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
---
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
```bash
git clone https://github.com/gauravprasadgp/modular-rag
```
Go to the project directory
```bash
cd modular-rag
```
Install dependencies
```bash
pip install -r requirements.txt
```
Run postgres locally
```bash
cd pgvector
```
```bash
docker compose -d up
```
Start the server
```bash
python main.py
```
## API Reference
#### Upload file to create embedding
```http
POST /create
```
| Parameter | Type | Description |
|:----------|:-------|:-----------------------------|
| `file` | `file` | **Required**. File to upload |
#### Get answer from user query
```http
POST /answer
```
| Parameter | Type | Description |
|:----------| :------- |:-------------------------|
| `query` | `string` | **Required**. user query |
## License
[MIT](https://choosealicense.com/licenses/mit/) |