Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

GenRAG-UI

MIT License

Improved and better version of the Terminal GenRAG tool designed to set up a Retrieval-Augmented Generation Pipeline locally from scratch, without utilizing any high-level frameworks like LangChain or vector databases. It includes features such as recursive text splitting, chunking, and building embeddings. The embeddings are stored in a CSV file,without using any Vector Databases and searching is based on cosine similarity.

Features

  • Recursive text splitting
  • Text chunking
  • Building embeddings
  • Storing embeddings in a CSV file
  • Searching based on cosine similarity
  • Inference from local LLM/API
  • UI for easier interaction and evaluation metrics (React-based)

Installation

  1. Clone the repository:

    git clone https://github.com/adityaghai07/GenRAG.git
    cd GenRAG
  2. Create and activate a virtual environment:

    python -m venv env
    source env/bin/activate  # On Windows use `env\Scripts\activate`
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

  1. Navigate to the backend folder:

    cd backend
    npm i
    npm run dev
  2. Open a new terminal and navigate to the frontend folder:

    cd frontend
    python main.py

LLM Response

You can use both a local LLM or an LLM from an API like Gemini for generating responses.

  • Local LLM: If you have the capability to run a local LLM, you can use it for generating responses. Cause mine is too slow :(

  • LLM from API: If your system is not powerful enough for local inference, you can use an API like Gemini. To do this, create a .env file and pass the Gemini API key.

Using Gemini API

  1. Create a .env file in the root directory of the project.
  2. Add your Gemini API key to the .env file:
    GEMINI_API_KEY=your_api_key_here
  3. The system will use the API key for generating responses through the Gemini API.

Credits

Special thanks to Pratik Solanki for his amazing React UI work , without him this project was not possible. Special thanks to the following YouTube channels and research papers for their invaluable resources and insights:

YouTube Channels

Research Papers

  • Patrick Lewis ., "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks" arXiv:2005.11401
  • Vaswani et al., "Attention is All You Need" arXiv:1706.03762
  • Reimers et al., "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks" arXiv:1908.10084

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages