Skip to content

DabeetDas/academic-rag

Repository files navigation

Drive-RAG

A full-stack Retrieval-Augmented Generation (RAG) application with a FastAPI backend and a Vite+React frontend.

Project Structure

├── main.py   
├── utils/           # Backend API routes
├── rag_chain.py         # RAG chain implementation
├── requirements.txt     # Python dependencies
├── drive-rag/           # Frontend application
│   ├── package.json
│   └── ...
└── .env                 # Environment variables (not committed)

Backend Overview

  1. main.py: Contains all API routes exposed by the FastAPI backend & responsible for request handling, orchestration, and streaming responses.

  2. rag_chain.py: Contains the RAG chain implementation & handles retrieval, prompt construction, and LLM invocation logic.

Setup Instructions

Install Backend Dependencies

pip install -r requirements.txt

Configure Environment Variables

Create a .env file in the project root:

OPENAI_API_KEY=your_openai_api_key_here

Ensure this file is not committed to version control.

Install Frontend Dependencies

Navigate to the frontend directory and install dependencies:

cd drive-rag
npm install

Running the Application

Backend Only

From the project root:

uvicorn main:app --reload

The backend will start in development mode with hot reload enabled.

Frontend Only

From the drive-rag directory:

npm run dev

Full Application

To run the complete application start the backend and the frontend simultaneously.

Notes

  • Ensure the backend is running before initiating frontend requests.
  • API URLs and ports should align between frontend and backend configurations.
  • This setup is intended for local development.

Setting the ENVIRONMENT VARIABLES

MongoDB and Gemini API env variables must be set in a .env file in the root directory.

About

Full-stack Retrieval-Augmented Generation (RAG) system for academic documents specific to courses at IITK with scalable vector search and web deployment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors