How pranavkumarpk01/multimodal-rag works
This repository implements a multimodal PDF question-answering system: PDFs are ingested into searchable text and image chunks, indexed in Qdrant, then retrieved to ground answers and optionally generate diagrams. The graph follows the documented API and ingestion/retrieval calls. Several internal details and UI wiring are unsampled, so uncertain connections are omitted; optional external model providers are shown separately.
Main entry points: llm.py LLM and embeddings · api.py HTTP API · ingest.py PDF ingestion · answer.py Answer composition
Components 13
PDF ingestion
- PDF ingestion
app/ingest.py - Image enrichment
app/enrich.py - Chunk schemas
app/models.py
Search and storage
- Vector collection
app/store.py - Hybrid retrieval
app/retrieve.py
Grounded responses
- Answer composition
app/answer.py - Diagram intent
app/diagram.py
Shared runtime
- LLM and embeddings
app/llm.py - Configuration
app/config.py
Other components
- Questioner
- Model providers
Connections 17
- Questioner → HTTP API: submits questions
api.py - Questioner → Web UI: uses
- HTTP API → Answer composition: answers queries
api.py - HTTP API → PDF ingestion: starts ingestion
api.py - PDF ingestion → Image enrichment: enriches images
app/ingest.py - PDF ingestion → Chunk schemas: creates chunks
app/ingest.py - Image enrichment → LLM and embeddings: requests vision
app/enrich.py - PDF ingestion → Configuration: reads settings
app/ingest.py - Answer composition → Hybrid retrieval: retrieves context
app/answer.py - Answer composition → Diagram intent: checks diagram intent
app/answer.py - Answer composition → LLM and embeddings: generates response
app/answer.py - Diagram intent → LLM and embeddings: generates diagrams
app/diagram.py - Hybrid retrieval → Vector collection: dense search
app/retrieve.py - Hybrid retrieval → LLM and embeddings: embeds query
app/retrieve.py - Vector collection → LLM and embeddings: embeds stored chunks
app/store.py - LLM and embeddings → Model providers: calls models
app/llm.py - HTTP API → Configuration: reads settings
api.py