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".
![Screenshot 2024-11-15 at 11 04 22](https://private-user-images.githubusercontent.com/25492636/386552421-1128da71-b71d-46d7-b266-cc1f87a8bf80.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODkyNTUsIm5iZiI6MTczOTU4ODk1NSwicGF0aCI6Ii8yNTQ5MjYzNi8zODY1NTI0MjEtMTEyOGRhNzEtYjcxZC00NmQ3LWIyNjYtY2MxZjg3YThiZjgwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAzMDkxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ2NWFjMDFlMTE2ZGYwNTM0ZWM0OTAxODhkZGJkMGE1Mzc5YzNhYjljZmJiZTY4NzhjM2U1Nzc2YmQ2OGVjYmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.kBPNzQeSZOW8Aye9GO4WXh1OLimqa2xlAsrpZXbqgMM)
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](https://private-user-images.githubusercontent.com/25492636/386554205-6f698c70-b52c-43d5-b7ef-c0d60ff00185.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1ODkyNTUsIm5iZiI6MTczOTU4ODk1NSwicGF0aCI6Ii8yNTQ5MjYzNi8zODY1NTQyMDUtNmY2OThjNzAtYjUyYy00M2Q1LWI3ZWYtYzBkNjBmZjAwMTg1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDAzMDkxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWU4OWZmMmUxYmIwMDJhNDk1NjFiNWU0ZDQzNDFkYTEzMTg1ZTgyN2EwNzY1ODA2NDg5MzdlMDc3NzNkM2U4OTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.v2GStN8TQs237bqBO8hw0vjrRKjEhnFHA2dAronYTtY)
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 [email protected]
- Do you want to contact me about bugs? Same e-mail adress as before.