Gaia PDF RAG is a Retrieval-Augmented Generation (RAG) application that allows users to ask questions about PDF documents using a local Gaia node and Qdrant vector database. It combines the power of local LLMs with efficient vector search to provide accurate, context-aware answers.
- 📑 PDF document processing and chunking
- 🔍 Semantic search using Qdrant vector database
- 🤖 Local LLM integration through Gaia node
↗️ Cross-encoder reranking for improved relevance- 💨 Streaming responses for better UX
- 🎯 Smart source citation
- ⚡ Relevance filtering to prevent hallucinations
Before running GaiaRAG, ensure you have:
- A local Gaia node running (Check this link to learn how to run your own local LLM: https://docs.gaianet.ai/node-guide/quick-start)
- Qdrant server running
- Python 3.8+
- Required system libraries for PDF processing
- Clone the repository:
git clone https://github.com/harishkotra/gaia-pdf-rag.git
cd gaiarag
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
Start your local Gaia node:
gaianet init
gaianet start
Start Qdrant using Docker:
docker run -d -p 6333:6333 -p 6334:6334 \
-v $(pwd)/qdrant_storage:/qdrant/storage \
qdrant/qdrant
-
Make sure both Gaia node and Qdrant are running
-
Start the Streamlit app:
streamlit run app.py
- Open your browser at
http://localhost:8501
- Upload a PDF document using the sidebar
- Click "Process Document" to index it
- Ask questions in the main input field
- View answers and relevant source documents
You can modify the following parameters in app.py
:
GAIA_NODE_URL
: URL of your local Gaia nodeQDRANT_HOST
: Qdrant server hostQDRANT_PORT
: Qdrant server portVECTOR_SIZE
: Embedding dimension sizeCOLLECTION_NAME
: Name for vector database collection
gaia-pdf-rag/
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── .gitignore # Gitignore file
├── README.md # This file
Contributions are welcome! Please feel free to submit a Pull Request.
Inspired by this example.