This project focuses on developing an application using the Retrieval-Augmented Generation (RAG) framework combined with FastAPI. The application is designed to handle user queries by leveraging the content of a provided PDF file. By accepting a file path as input, it processes and extracts relevant information from the PDF to generate accurate and contextually relevant answers.
- Python 3.10+
- Mistral API Access Key
- HuggingFace API Access Token
-
Clone the repository:
git clone https://github.com/suhail-chand/rag-fastapi.git cd rag-fastapi
-
Set up a virtual environment:
python -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Create a .env file and add the following variables:
HF_TOKEN='<HuggingFace_Access_Token>' MISTRAL_API_KEY='<Mistral_API_Key>'
-
Run the FastAPI server:
fastapi dev .\src\main.py
FastAPI application will be running at http://127.0.0.1:8000
and to access the Swagger UI navigate to http://127.0.0.1:8000/docs
.