Llama_RAG_System

Overview

The Llama_RAG_System is a robust retrieval-augmented generation (RAG) system designed to interactively respond to user queries with rich, contextually relevant answers. Built using the LLaMA model and Ollama, this system can handle various tasks, including answering general questions, summarizing content, and extracting information from uploaded PDF documents. The architecture utilizes ChromaDB for efficient document embedding and retrieval, while also incorporating web scraping capabilities to fetch up-to-date information from the internet.

Here’s a glimpse of the Gradio app interface:

🚧 Please note: This project is currently in development. Your feedback and contributions are welcome!

Features

Why Use Ollama?

Ollama is an excellent option for running machine learning models locally for several reasons:

Folder Structure

The project is organized as follows:

project/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ embedding.py             # Embedding-related functionality
β”‚   β”œβ”€β”€ document_utils.py        # Functions to handle document loading and processing
β”‚   β”œβ”€β”€ query.py                 # Query document functionality
β”‚   β”œβ”€β”€ generate.py              # Response generation logic
β”‚   β”œβ”€β”€ web_scrape.py            # Web scraping functionality
β”‚
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ run_flask.py             # Script to run Flask API
β”‚   β”œβ”€β”€ run_gradio.py            # Script to run Gradio interface
β”‚
β”œβ”€β”€ chromadb_setup.py            # ChromaDB setup and connection
β”‚
β”œβ”€β”€ README.md                    # Project documentation

Installation

To set up the Llama_RAG_System, follow these steps:

  1. Clone the repository:
    git clone https://github.com/NimaVahdat/Llama_RAG_System.git
    cd Llama_RAG_System
    
  2. Ensure that ChromaDB and any other necessary services are running as needed.

Usage

Running the Flask API

To start the Flask API, run the following command:

python -m scripts.run_flask

Running the Gradio Interface

To launch the Gradio interface, execute:

python -m scripts.run_gradio

After running either script, you will be able to interact with the system via the provided web interface.

Contributing

Contributions are welcome! If you have suggestions for improvements or features, please fork the repository and submit a pull request.

License

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

Acknowledgements

Contact

For any inquiries or support, please contact me.