This repository offers resources for conducting inference and assessment of state-of-the-art pipelines for Retrieval-Augmented Generation (RAG). Tailored to accommodate both specialized and general applications, these pipelines deliver sophisticated functionalities in active retrieval and the dynamics of knowledge graphs.
Pipelines:
- HybridFL- specialized pipeline for legal and financial domains.
- FLARE- Generalized active retrieval pipeline using closed source models
- DRAGIN- Generalized active retrieval pipeline using open source models
- Features
- System Design
- System Architecture
- Installation
- Usage
- Hardware Requirements
- Run Demo UI
- Contributors
- Evaluation notebooks for individual pipelines in the notebooks folder.
- Streamlit demo UI.
- Dynamic Knowledge Graph building using Pathway in the dynamic_kg_updation folder (it comes with a seperate README).
- Custom Datasets for evaluation in the datasets folder.
Step 0: Create a Python virtual environment and install dependencies.
-
Create a virtual environment:
python -m venv env
-
Activate the environment:
- Linux/Mac:
source env/bin/activate
- Windows:
.\env\Scripts\activate
- Linux/Mac:
-
Install the required packages:
pip install -r requirements.txt
- Navigate to the
DocumentStore
folder:cd DocumentStore
- Build the Docker image:
docker build -t vector_indexer .
- Run the Docker container:
docker run -v files-for-indexing -p 8000:8000 vector_indexer
- Navigate to the
DocumentStore_legal
folder:cd DocumentStore_legal
- Build the Docker image:
docker build -t vector_indexer2 .
- Run the Docker container:
docker run -v files-for-indexing -p 8001:8001 vector_indexer2
-
Make sure your current working directory is the root directory.
-
Navigate to the
notebooks
folder and execute:- Baseline evaluation:
baseline.ipynb
- FLARE evaluation:
FLARE.ipynb
- HybridFL evaluation:
HybridFL.ipynb
- Baseline evaluation:
-
For advanced evaluation using the Dragin framework:
- Ensure your system has at least 16 GB VRAM.
- Navigate to the
dragin
folder withinnotebooks
and runeval.ipynb
.
- Minimum GPU VRAM: 16 GB (for Dragin evaluation).
- Ensure Docker is installed and configured on your machine.
- Navigate to the
frontend
folder:cd frontend
- Run the Streamlit app:
streamlit run main.py