A multi-document RAG system I built for intelligent PDF analysis and question answering.
| Component | Technology | Why I Chose It |
|---|---|---|
| Frontend | Gradio | Fast prototyping, great for AI apps |
| Document Processing | PyMuPDF, pdfplumber, Tesseract | Reliable text extraction with OCR fallback |
| Embeddings | Sentence Transformers | High-quality semantic understanding |
| Vector Search | FAISS | Lightning-fast similarity search |
| LLM | LlamaCPP (Qwen3-4B) | Efficient local model that runs on CPU |
| Document Intelligence | LlamaIndex | Excellent tools for chunking and indexing |
| Utilities | NumPy, PyPDF2, regex | Essential data processing tools |
# Install system dependencies
sudo apt-get install tesseract-ocr
# Install Python packages
pip install gradio gradio_pdf
pip install pypdf PyPDF2 pymupdf pdfplumber
pip install sentence-transformers transformers
pip install faiss-cpu
pip install llama-index llama-index-readers-file
pip install llama-index-embeddings-huggingface
pip install llama-index-vector-stores-faiss
pip install llama-index-llms-llama-cpp
pip install llama-cpp-python sentencepiece
pip install pytesseract pillow
pip install numpy pandas
The system will:
Try questions like:
Each answer shows:
Combines three methods for best results:
Uses the Qwen LLM to analyze text and decide:
You can tweak these settings in the code:
# In the IntelligentRetriever class:
chunk_size = 300 # Smaller = faster, larger = more context
chunk_overlap = 80 # How much chunks overlap
num_retrieve = 4 # How many chunks to use for answers
# In the classification function:
max_length = 800 # How much text to analyze for classification
chunk_size to 200num_retrieve to 3tesseract-ocr is installedA multi-document RAG system I built for intelligent PDF analysis and question answering.
| Component | Technology | Why I Chose It |
|---|---|---|
| Frontend | Gradio | Fast prototyping, great for AI apps |
| Document Processing | PyMuPDF, pdfplumber, Tesseract | Reliable text extraction with OCR fallback |
| Embeddings | Sentence Transformers | High-quality semantic understanding |
| Vector Search | FAISS | Lightning-fast similarity search |
| LLM | LlamaCPP (Qwen3-4B) | Efficient local model that runs on CPU |
| Document Intelligence | LlamaIndex | Excellent tools for chunking and indexing |
| Utilities | NumPy, PyPDF2, regex | Essential data processing tools |
# Install system dependencies
sudo apt-get install tesseract-ocr
# Install Python packages
pip install gradio gradio_pdf
pip install pypdf PyPDF2 pymupdf pdfplumber
pip install sentence-transformers transformers
pip install faiss-cpu
pip install llama-index llama-index-readers-file
pip install llama-index-embeddings-huggingface
pip install llama-index-vector-stores-faiss
pip install llama-index-llms-llama-cpp
pip install llama-cpp-python sentencepiece
pip install pytesseract pillow
pip install numpy pandas
The system will:
Try questions like:
Each answer shows:
Combines three methods for best results:
Uses the Qwen LLM to analyze text and decide:
You can tweak these settings in the code:
# In the IntelligentRetriever class:
chunk_size = 300 # Smaller = faster, larger = more context
chunk_overlap = 80 # How much chunks overlap
num_retrieve = 4 # How many chunks to use for answers
# In the classification function:
max_length = 800 # How much text to analyze for classification
chunk_size to 200num_retrieve to 3tesseract-ocr is installed