How ifsaurabh/rag-humanitarian-risk-analysis-india works
This is a question-answering RAG application for Indian food-price and state-level poverty data. The user submits a natural-language question to the FastAPI /ask endpoint; the app embeds and retrieves context from both data collections, then asks Claude to produce an answer. The wider documented workflow fetches and prepares HDX data and ingests it into ChromaDB or Pinecone. The graph reflects the two app implementations and the README-described notebook workflow; ingestion notebook internals were not sampled.
Main entry points: app_pinecone.py RAG answer flow · 02_data_processing.ipynb Clean and convert · food_prices_final.csv Food price data · poverty_final.csv Poverty data
Components 22
Data preparation
- Fetch data
notebooks/01_data_fetch.ipynb - Clean and convert
notebooks/02_data_processing.ipynb - Food price data
data/food_prices_final.csv - Poverty data
data/poverty_final.csv
Vector indexing
- Chroma ingestion
notebooks/03_chromadb_integration.ipynb - Pinecone ingestion
notebooks/03.5_pinecone.ipynb - Chroma embeddings
src/app.py - Pinecone embeddings
src/app_pinecone.py - ChromaDB
- Pinecone
Question answering
- RAG answer flow
src/app_pinecone.py - Context retrieval
src/app_pinecone.py - Chroma RAG app
src/app.py - Chroma retrieval
src/app.py - Natural-language answer
src/app_pinecone.py
API and operations
- FastAPI endpoints
src/app_pinecone.py - Credential verification
src/app_pinecone.py - Interaction logging
src/app_pinecone.py
Other components
- Questioner
- OCHA HDX
- Claude Haiku
- Amazon S3
Connections 26
- OCHA HDX → Fetch data: provides data
- Fetch data → Clean and convert: passes records
- Clean and convert → Food price data: writes
- Clean and convert → Poverty data: writes
- Food price data → Chroma ingestion: ingests
- Poverty data → Chroma ingestion: ingests
- Food price data → Pinecone ingestion: ingests
- Poverty data → Pinecone ingestion: ingests
- Chroma ingestion → ChromaDB: writes vectors
- Pinecone ingestion → Pinecone: writes vectors
- Questioner → FastAPI endpoints: submits question
- FastAPI endpoints → Credential verification: verifies credentials
- FastAPI endpoints → RAG answer flow: calls
- RAG answer flow → Context retrieval: requests context
- Context retrieval → Pinecone embeddings: embeds query
- Context retrieval → Pinecone: queries namespaces
- RAG answer flow → Claude Haiku: sends prompt
- Claude Haiku → RAG answer flow: returns completion
- RAG answer flow → Natural-language answer: returns answer
- FastAPI endpoints → Interaction logging: logs interaction
- Interaction logging → Amazon S3: uploads log
- Questioner → Chroma RAG app: submits question
- Chroma RAG app → Chroma retrieval: calls
- Chroma retrieval → Chroma embeddings: embeds query
- Chroma retrieval → ChromaDB: retrieves documents
- Chroma RAG app → Claude Haiku: sends prompt