The 3GPP-RAG-chat project is a weekend project for processing, analyzing and chatting with documents from the ETSI and 3GPP standards LOCALLY. I utilized libraries for Retrieval Augmented Generation (RAG)-powered Large Language Models (LLMs) such as Ollama and llama-index. This project needs a NVIDIA GPU with at least 12 GB VRAM.
demo.mp4
Ensure you have Python 3.x installed on your system. Then, follow these steps to install the necessary dependencies:
Install PyMuPDF, ChromaDB, llama-index and its related packages using pip:
pip install llama-index PyMuPDF chromadb
pip install llama-index-core llama-index-readers-file llama-index-llms-ollama llama-index-embeddings-huggingfaceInstall Ollama using the provided script and pip:
curl -fsSL https://ollama.com/install.sh | sh
pip install ollamaWe will be utilizing int8 quantized mistral 7b-instruct model. Use the ollama_pull.py script to pull the model:
python3 ollama_pull.py -m mistral:7b-instruct-v0.2-q8_0All you need to start querying is to download the index data 3gpp_db from here, and go to step 4. Or you can start from scratch and begin the document scraping and processing workflow with the following steps:
-
Downloading Documents: Execute the
download.pyscript to initiate the download of all PDF files from the ETSI website. Note that this process may take several hours to complete.python download.py
-
Cleaning Documents: Run the
clean.pyscript to remove any duplicate files and older versions of documents, ensuring that only the most relevant and up-to-date documents are kept for analysis. To save time, documents and folders are made available here.python clean.py
-
Indexing Documents: Use the
index.pyscript to index all documents. This step is crucial for efficiently searching and retrieving information from the documents later on. To save time, the index is available available here.python index.py
-
Querying Documents: Finally, execute the
query.pyscript to start querying the indexed documents. This allows you to search for specific information within the vast collection of ETSI and 3GPP documents.python query.py
- Wrap the code within a Dockerfile for containerized deployment.
- Improve the retrieval process, possibly integrating late interaction mechanisms such as ColBERT for enhanced efficiency and accuracy.
- Add UI, possibly with Gradio or Streamlit.
Contributions are welcome! If you'd like to improve the project or suggest new features, please feel free to submit a pull request or open an issue.