A Multi-Modal Retrieval-Augmented Generation (RAG) pipeline for Warframe knowledge, built for DSAI 413 – Assignment 1. The system indexes curated PDFs (beginner guides, drop tables, fan-kit visuals) using the colSmol-500M ColPali visual-language embedding model, then answers natural-language queries by fusing visual page images, extracted text, and structured table data through Gemini 2.5 Pro.
fankit/ ──► data_prep.py ──► docs/*.pdf
└──► docs/multimodal_manifest.json
docs/*.pdf ──► indexer.py ──► docs/colsmol_index.pt
query ──► retriever.py ──► Gemini 2.5 Pro ──► answer
(hybrid retrieval: ColPali visual + keyword scoring)
app.py ──► Streamlit UI (wraps retriever)
eval.py ──► 10-question benchmark suite
| File | Role |
|---|---|
data_prep.py | Compiles fan-kit images into per-category PDFs and extracts multi-modal metadata (text, tables, image info) into a JSON manifest |
indexer.py | Encodes PDFs page-by-page with colSmol-500M (ColIdefics3) and saves tensors + base64 images + manifest metadata to a .pt index file |
retriever.py | WarframeQA class — hybrid retrieval (75% ColPali MaxSim + 25% keyword overlap) and Gemini multi-modal answer generation |
app.py | Streamlit UI — query input, generated response, and visual source citations |
eval.py | 10-question domain benchmark covering table extraction, text analysis, and visual/image reasoning |
pip install -r requirements.txt
Create a .env file in the project root:
GEMINI_API_KEY=your_api_key_here
Place Warframe PDF documents (e.g. beginner's guide, drop tables) in the docs/ directory.
For fan-kit visuals, ensure the fankit/ directory exists with the official Warframe Fan Kit assets organised by category (Images/, Key Art/, Concept Art/, etc.).
python data_prep.py
# Optional: pass a random seed for reproducible fan-kit image selection
python data_prep.py 42
This will:
docs/docs/multimodal_manifest.jsonpython indexer.py
Encodes every PDF page with colSmol-500M and saves the index to docs/colsmol_index.pt.
Run data_prep.py first for full multi-modal enrichment; otherwise the indexer falls back to visual-only mode.
streamlit run app.py
Retrieval uses a hybrid scoring approach:
final_score = 0.75 × visual_score_normalised + 0.25 × keyword_score
| Component | Description |
|---|---|
| Visual score | ColPali Late Interaction (MaxSim) over patch embeddings — captures layout, charts, and image semantics |
| Keyword score | Lightweight token-overlap ratio against extracted page text — boosts pages with strong textual/tabular coverage |
Retrieved pages are then passed to Gemini 2.5 Pro with four context layers per page: the visual page image, extracted raw text, structured table data, and embedded image/chart metadata.
Run the 10-question benchmark suite (covers table extraction, text analysis, and visual reasoning):
python eval.py
The suite tests:
Assignment 1/
├── app.py # Streamlit UI
├── data_prep.py # Fan-kit compilation + multi-modal manifest extraction
├── indexer.py # colSmol-500M page encoding + index builder
├── retriever.py # Hybrid retrieval + Gemini generation (WarframeQA)
├── eval.py # 10-question benchmark suite
├── requirements.txt
├── .env # GEMINI_API_KEY (not committed)
├── docs/
│ ├── *.pdf # Source documents (add your own PDFs here)
│ ├── multimodal_manifest.json # Auto-generated by data_prep.py
│ └── colsmol_index.pt # Auto-generated by indexer.py
└── fankit/ # Official Warframe Fan Kit assets
├── Images/
├── Key Art/
├── Concept Art/
├── Logos/
└── ...
streamlit>=1.42.0
colpali-engine
pymupdf
google-genai>=0.5.0
python-dotenv
pandas
requests
matplotlib
Pillow
lxml
accelerate
tqdm
8 commits
Python
100.0%
A Multi-Modal Retrieval-Augmented Generation (RAG) pipeline for Warframe knowledge, built for DSAI 413 – Assignment 1. The system indexes curated PDFs (beginner guides, drop tables, fan-kit visuals) using the colSmol-500M ColPali visual-language embedding model, then answers natural-language queries by fusing visual page images, extracted text, and structured table data through Gemini 2.5 Pro.
fankit/ ──► data_prep.py ──► docs/*.pdf
└──► docs/multimodal_manifest.json
docs/*.pdf ──► indexer.py ──► docs/colsmol_index.pt
query ──► retriever.py ──► Gemini 2.5 Pro ──► answer
(hybrid retrieval: ColPali visual + keyword scoring)
app.py ──► Streamlit UI (wraps retriever)
eval.py ──► 10-question benchmark suite
| File | Role |
|---|---|
data_prep.py | Compiles fan-kit images into per-category PDFs and extracts multi-modal metadata (text, tables, image info) into a JSON manifest |
indexer.py | Encodes PDFs page-by-page with colSmol-500M (ColIdefics3) and saves tensors + base64 images + manifest metadata to a .pt index file |
retriever.py | WarframeQA class — hybrid retrieval (75% ColPali MaxSim + 25% keyword overlap) and Gemini multi-modal answer generation |
app.py | Streamlit UI — query input, generated response, and visual source citations |
eval.py | 10-question domain benchmark covering table extraction, text analysis, and visual/image reasoning |
pip install -r requirements.txt
Create a .env file in the project root:
GEMINI_API_KEY=your_api_key_here
Place Warframe PDF documents (e.g. beginner's guide, drop tables) in the docs/ directory.
For fan-kit visuals, ensure the fankit/ directory exists with the official Warframe Fan Kit assets organised by category (Images/, Key Art/, Concept Art/, etc.).
python data_prep.py
# Optional: pass a random seed for reproducible fan-kit image selection
python data_prep.py 42
This will:
docs/docs/multimodal_manifest.jsonpython indexer.py
Encodes every PDF page with colSmol-500M and saves the index to docs/colsmol_index.pt.
Run data_prep.py first for full multi-modal enrichment; otherwise the indexer falls back to visual-only mode.
streamlit run app.py
Retrieval uses a hybrid scoring approach:
final_score = 0.75 × visual_score_normalised + 0.25 × keyword_score
| Component | Description |
|---|---|
| Visual score | ColPali Late Interaction (MaxSim) over patch embeddings — captures layout, charts, and image semantics |
| Keyword score | Lightweight token-overlap ratio against extracted page text — boosts pages with strong textual/tabular coverage |
Retrieved pages are then passed to Gemini 2.5 Pro with four context layers per page: the visual page image, extracted raw text, structured table data, and embedded image/chart metadata.
Run the 10-question benchmark suite (covers table extraction, text analysis, and visual reasoning):
python eval.py
The suite tests:
Assignment 1/
├── app.py # Streamlit UI
├── data_prep.py # Fan-kit compilation + multi-modal manifest extraction
├── indexer.py # colSmol-500M page encoding + index builder
├── retriever.py # Hybrid retrieval + Gemini generation (WarframeQA)
├── eval.py # 10-question benchmark suite
├── requirements.txt
├── .env # GEMINI_API_KEY (not committed)
├── docs/
│ ├── *.pdf # Source documents (add your own PDFs here)
│ ├── multimodal_manifest.json # Auto-generated by data_prep.py
│ └── colsmol_index.pt # Auto-generated by indexer.py
└── fankit/ # Official Warframe Fan Kit assets
├── Images/
├── Key Art/
├── Concept Art/
├── Logos/
└── ...
streamlit>=1.42.0
colpali-engine
pymupdf
google-genai>=0.5.0
python-dotenv
pandas
requests
matplotlib
Pillow
lxml
accelerate
tqdm
8 commits
Python
100.0%