This is a demo project showcasing a Large Language Model (LLM) integrated with Retrieval-Augmented Generation (RAG). The project demonstrates how to utilize LLMs for advanced document retrieval and text generation tasks.
- Python >= 3.10
- SQLite >= 3.35
- Ollama
To set up this project on your local machine, follow these steps:
Make sure you have Python 3.10 or greater installed. You can download Python from the official Python website. Additionally, ensure you have SQLite version 3.35 or higher. SQLite is typically pre-installed with Python, but you can check your version by running:
sqlite3 --version
Make sure you have installed all these dependencies.
pip install ollama chromadb sentence-transformers streamlit pymupdf langchain-community
ollama pull llama3.2:3b
ollama pull nomic-embed-text
Run this application using the following command:
ollama run llama3.2
streamlit run app.py
We have provided three example review papers in the papers folder to help you explore the application's capabilities.
- Paper Title: "Ecological restoration in Brazilian biomes: Identifying advances and gaps"
- Sample Question:
- "What were the advances identified regarding the ecological restoration in Brazilian biomes in this paper?"
- What to Expect:
- View the response generated by the application.
- Check the "See retrieved documents" section to understand how the retrieval component functioned.
- Examine the "See most relevant document IDs" section to see how the reranker prioritized the retrieved content.
- Paper Title: "Seed germination traits can contribute better to plant community ecology"
- Important: The system should now have indexed both Paper 1 and Paper 2.
- Sample Question:
- "What methods were used in Paper 1?"
- Objective:
- Test whether the reranker can correctly select the relevant content chunks from Paper 1.
- What to Expect:
- Review the answer provided by the application.
- Check the "See retrieved documents" section to analyze retrieval.
- Look at the "See most relevant document IDs" section to verify the reranker's performance. Here it should have selected only the chunks corresponding to paper 1.
- Sample Question:
- "What methods were reported in the paper?"
- Expected Behavior:
- If multiple papers are uploaded and the query lacks specificity, the application should not return a response.
- Sample Question:
- "Do seed germination traits contribute better to plant community ecology?"
- What to Expect:
- Review the application's response.
- Check the retrieval insights in "See retrieved documents."
- Analyze the re-ranking behavior in "See most relevant document IDs."
By following these steps, you can evaluate how well the application handles document retrieval, reranking, and response generation based on your queries.
This project is licensed under the MIT License.
You are free to use, modify, and distribute this software in accordance with the terms of the license.