A robust Retrieval-Augmented Generation (RAG) system capable of processing and answering complex queries against documents containing text, tables, and images. This project implements a cutting-edge multi-modal indexing and retrieval strategy to enhance the accuracy and grounding of generated responses.
This system addresses the limitations of traditional text-only RAG by integrating visual and tabular data into the knowledge base. It is specifically built to handle complex financial or technical documents (e.g., the included qatar_test_doc.pdf) where charts and tables contain critical information that standard language models often miss.
The core innovation lies in the Multi-Modal Indexing strategy, which combines CLIP (for visual semantics) and BGE (for textual context) embeddings into a unified vector space. This ensures high retrieval accuracy across all content modalities (text, tables, and images).
[Image of a diagram showing the fusion of text and image embeddings into a single vector space]
The conversational interface is powered by DSPy, which utilizes a declarative approach to orchestrate the retrieval and generation steps, ensuring faithful citations and providing a three-tier Fallback Mechanism for reliable answers.
app.py) for conversational QA.| Category | Technology | Purpose |
|---|---|---|
| Frameworks | Python, Flask | Backend web application and API structure. |
| RAG Orchestration | DSPy (Declarative Self-improving Python) | Defines and optimizes the RAG pipeline logic (Signatures). |
| LLM Inference | Groq | Used for high-speed, general-purpose LLM interactions. |
| Extraction | PyMuPDF, PDFPlumber, BLIP, EasyOCR | Document parsing, table conversion, image captioning, and OCR. |
| Indexing/Search | CLIP, BAAI/bge-base-en-v1.5, FAISS | Vector creation and high-speed Nearest Neighbor search (HNSW index). |
The key files pushed to the repository are:
| File / Directory | Description |
|---|---|
app.py | The main Flask application entry point, handling the web interface and initiating the RAGChatbot. |
embedding.py | Contains the MultiModalIndexer logic for content extraction, dual embedding (CLIP + BGE), and FAISS indexing. |
Templates/ | Contains the HTML files for the web interface (chat.html and login.html). |
.env | Environment file for storing API keys (e.g., Groq API key) and configuration variables. |
faiss_index.bin | The pre-built FAISS HNSW vector index for immediate search capability. |
faiss_index.bin.meta | Metadata file associated with the FAISS index (e.g., chunk content, page numbers, original source links). |
qatar_test_doc.pdf | The source document used for demonstration and evaluation (IMF Article IV Report for Qatar). |
golden_dataset.* | Test data used for RAGAS evaluation (ground truth queries and answers). |
git clone https://github.com/sujanboseb/big_air_project.git
cd big_air_project
It is highly recommended to use a virtual environment for dependency isolation:
python -m venv venv
# On Windows
.\venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
Install all necessary dependencies (assuming they are listed in a requirements.txt file):
pip install -r requirements.txt
Create and populate the .env file at the root of the project with your necessary API keys and configuration parameters.
# .env file content example
GROQ_API_KEY="your_groq_api_key_here"
# ... other model configurations if needed
Start the Flask web server:
python app.py
The login interface (Templates/login.html) is configured to accept the following credentials:
| Field | Value |
|---|---|
| Username | sujan |
| Password | bose |
Use these credentials to access the RAG Chat interface.
The application will typically start on http://127.0.0.1:5000. Navigate to this address in your browser to begin conversing with the Multi-Modal RAG system.
A robust Retrieval-Augmented Generation (RAG) system capable of processing and answering complex queries against documents containing text, tables, and images. This project implements a cutting-edge multi-modal indexing and retrieval strategy to enhance the accuracy and grounding of generated responses.
This system addresses the limitations of traditional text-only RAG by integrating visual and tabular data into the knowledge base. It is specifically built to handle complex financial or technical documents (e.g., the included qatar_test_doc.pdf) where charts and tables contain critical information that standard language models often miss.
The core innovation lies in the Multi-Modal Indexing strategy, which combines CLIP (for visual semantics) and BGE (for textual context) embeddings into a unified vector space. This ensures high retrieval accuracy across all content modalities (text, tables, and images).
[Image of a diagram showing the fusion of text and image embeddings into a single vector space]
The conversational interface is powered by DSPy, which utilizes a declarative approach to orchestrate the retrieval and generation steps, ensuring faithful citations and providing a three-tier Fallback Mechanism for reliable answers.
app.py) for conversational QA.| Category | Technology | Purpose |
|---|---|---|
| Frameworks | Python, Flask | Backend web application and API structure. |
| RAG Orchestration | DSPy (Declarative Self-improving Python) | Defines and optimizes the RAG pipeline logic (Signatures). |
| LLM Inference | Groq | Used for high-speed, general-purpose LLM interactions. |
| Extraction | PyMuPDF, PDFPlumber, BLIP, EasyOCR | Document parsing, table conversion, image captioning, and OCR. |
| Indexing/Search | CLIP, BAAI/bge-base-en-v1.5, FAISS | Vector creation and high-speed Nearest Neighbor search (HNSW index). |
The key files pushed to the repository are:
| File / Directory | Description |
|---|---|
app.py | The main Flask application entry point, handling the web interface and initiating the RAGChatbot. |
embedding.py | Contains the MultiModalIndexer logic for content extraction, dual embedding (CLIP + BGE), and FAISS indexing. |
Templates/ | Contains the HTML files for the web interface (chat.html and login.html). |
.env | Environment file for storing API keys (e.g., Groq API key) and configuration variables. |
faiss_index.bin | The pre-built FAISS HNSW vector index for immediate search capability. |
faiss_index.bin.meta | Metadata file associated with the FAISS index (e.g., chunk content, page numbers, original source links). |
qatar_test_doc.pdf | The source document used for demonstration and evaluation (IMF Article IV Report for Qatar). |
golden_dataset.* | Test data used for RAGAS evaluation (ground truth queries and answers). |
git clone https://github.com/sujanboseb/big_air_project.git
cd big_air_project
It is highly recommended to use a virtual environment for dependency isolation:
python -m venv venv
# On Windows
.\venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
Install all necessary dependencies (assuming they are listed in a requirements.txt file):
pip install -r requirements.txt
Create and populate the .env file at the root of the project with your necessary API keys and configuration parameters.
# .env file content example
GROQ_API_KEY="your_groq_api_key_here"
# ... other model configurations if needed
Start the Flask web server:
python app.py
The login interface (Templates/login.html) is configured to accept the following credentials:
| Field | Value |
|---|---|
| Username | sujan |
| Password | bose |
Use these credentials to access the RAG Chat interface.
The application will typically start on http://127.0.0.1:5000. Navigate to this address in your browser to begin conversing with the Multi-Modal RAG system.