Skip to content

Simple tool for RAG (Retrieval Augmented Generation) applications to be run over locally stored files

License

Notifications You must be signed in to change notification settings

gabripo/easyrag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easyrag - The one-click minimal solution to analyze documents locally

What is it? 🤯

Easyrag is a small tool to perform a RAG (Retrieval-Augmented Generation) over documents which are stored locally.

Typical use case 💻

  1. I have big, boring, important documents stored on my PC. 🗃️
  2. I do not want to give these documents away. 🚏
  3. ... yet I am not willing to waste hours reading the documents. ⏳
  4. Then I give these documents to Easyrag ! 🥇
  5. Easyrag will process the documents, without being bored. 🔍
  6. I ask Easyrag questions to get an insight about the documents. ❓
  7. I am happy: I saved a lot of time! ⏲️

Prerequisites 🏠

  1. Ollama 🦙
  2. Python 🐍

Usage 🖱️

Docker version 🐳📦 (recommended)

A Dockerfile has been configured to access the Ollama installation on the host. The Docker container will use a web-interface base on Flask as starting point for the usage. To build a container and run it, run the prepared scripts:

chmod +x docker_build.sh
sh docker_build.sh
chmod +x docker_run.sh
sh docker_run.sh

A web application to upload your files will be available at the url http://localhost:3000 .

Drop your files and/or click on "Drag & Drop PDFs Here" to make them available for the application.

The model to use can be selected with a drop-down menu. It is possible to download it (if not yet available) by clicking on "Download model".

Screenshot 2024-11-15 at 11 04 22

After having started the application with "Start Easyrag", the Streamlit chat will be available at the url http://localhost:8501 .

To stop using it and come back to the files uploading, click on "Kill Streamlit" at the url http://localhost:3000 .

Screenshot 2024-11-15 at 11 09 58

Docker Compose 🎵

Ollama can be run from another Docker container by using Docker Compose : a configuration is already provided within the project and, to start it, run the command:

docker compose up

Please note that the performance of Ollama will be affected, as the GPU acceleration for the Ollama container is not enabled by default.

Local GUI 🪟 (the old way, yet there)

Installation from source

  1. Clone this repo
  2. Move to the folder with a shell, then create a Python Virtual Environment and install the dependencies by running:
pip install virtualenv
virtualenv easyrag_venv
source easyrag_venv/bin/activate
pip install -r dependencies/requirements.txt
  1. Activate the Python Virtual Environment:
source easyrag_venv/bin/activate
  1. By using Python, run the main.py file:
python main.py
  1. Follow the instructions in the GUI
  • Screenshot 2024-05-24 at 16 06 35
  • Select the folder with documents by using the Browse button.
  • Edit the System prompt as you wish: it will be the preamble for all your following queries - you can ask Easyrag to behave as a scientist, as a teacher, as your cousin, ...

Chatbot in the browser - requires streamlit

Tick the "Use web interface" and click on the "Submit" button to use the web interface (please note that this functionality requires streamlit to be installed!):

  • A web interface with your web browser will start: provide it with one query and press "Enter" to submit a question.
  • Screenshot 2024-05-25 at 10 45 45
  • To stop submitting queries, click "Yes" in the window that pops up.
  • Screenshot 2024-05-24 at 16 16 54

Queries using the GUI

Click on the "Submit" button without ticking "Use web interface" to proceed using the GUI for queries and answers:

  • Edit the text to talk to Easyrag .
  • Screenshot 2024-05-23 at 21 24 00
  • Confirm with the "Submit" button to let Easyrag process the documents.
  • Be patient. Your response will come soon!
  • Screenshot 2024-05-23 at 21 26 51
  • After closing the window, it is possible to provide Easyrag with other queries by clicking on the "Yes" button. To abort, click on the "No" button, instead.
  • Screenshot 2024-05-23 at 21 29 29

Current status and limitations 🕶️

  1. The Ollama models of Meta llama3 and llama3.2 are supported
  2. Be patient at the first analysis of the documents: Easyrag has to go through all the documents, let it read them!
  3. If the documents have been already analyzed, then the following queries after the first one are faster (TLDR: the Chroma database is loaded and not re-generated).
  4. Only .pdf documents are supported. .xls and other spreadsheet files may come soon...
  5. The prompts after the very first one consider the entire history of messages - the previous queries and answers.

Contacts 📫

  1. Do you want to contact me about collaborations? Write me to gabriele.giardino.ing@gmail.com
  2. Do you want to contact me about bugs? Same e-mail adress as before.

About

Simple tool for RAG (Retrieval Augmented Generation) applications to be run over locally stored files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published