Easyrag is a small tool to perform a RAG (Retrieval-Augmented Generation) over documents which are stored locally.
- I have big, boring, important documents stored on my PC. 🗃️
- I do not want to give these documents away. 🚏
- ... yet I am not willing to waste hours reading the documents. ⏳
- Then I give these documents to Easyrag ! 🥇
- Easyrag will process the documents, without being bored. 🔍
- I ask Easyrag questions to get an insight about the documents. ❓
- I am happy: I saved a lot of time! ⏲️
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".
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 .
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.
- Clone this repo
- 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
- Activate the Python Virtual Environment:
source easyrag_venv/bin/activate
- By using Python, run the
main.py
file:
python main.py
- Follow the instructions in the GUI
- 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, ...
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.
- To stop submitting queries, click "Yes" in the window that pops up.
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 .
- Confirm with the "Submit" button to let Easyrag process the documents.
- Be patient. Your response will come soon!
- 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.
- The Ollama models of Meta llama3 and llama3.2 are supported
- Be patient at the first analysis of the documents: Easyrag has to go through all the documents, let it read them!
- 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).
- Only
.pdf
documents are supported..xls
and other spreadsheet files may come soon... - The prompts after the very first one consider the entire history of messages - the previous queries and answers.
- Do you want to contact me about collaborations? Write me to gabriele.giardino.ing@gmail.com
- Do you want to contact me about bugs? Same e-mail adress as before.