How ahmed-esso/pharma-supply-chain-intelligence works
Pharma Supply Chain Intelligence ingests regulatory and drug-catalog data into a Bronze lakehouse, with documented Silver cleaning/quality and Gold analytics stages. Its document workflow inventories sources, extracts and normalizes text, chunks and indexes it, then answers questions with grounded citations and evaluates retrieval and guardrails. README documents an Airflow schedule, FastAPI backend, and Streamlit dashboard, but the API and app directories contain no implementation files in the supplied tree; their runtime wiring therefore cannot be verified. Edges follow shown calls or README-described stages.
Main entry points: pharma_ingestion_runner.py Source ingestion · rag_pipeline.py Grounded retrieval · extractor.py Text extraction · bronze Bronze raw data
Components 17
Ingestion
- Airflow DAG
dags/airflow_pharma_pipeline_dag.py - Source ingestion
ingestion/pharma_ingestion_runner.py
Lakehouse
- Bronze raw data
lakehouse/bronze - Silver quality
lakehouse/silver - Gold analytics
lakehouse/gold
Document preparation
- Source inventory
rag/extraction/document_inventory.py - Text extraction
rag/extraction/extractor.py - Document chunking
rag/chunking/chunker.py - Hybrid index
rag/chunking/embeddings.py
RAG retrieval
- Grounded retrieval
rag/retrieval/rag_pipeline.py - RAG evaluation
rag/evaluation/evaluate_rag.py
Product interfaces
- Interactive demo
rag/interactive_demo.py - FastAPI backend
api - Streamlit dashboard
app
Other components
- Supply-chain user
- openFDA APIs
- NIH RxNav API
Connections 16
- Supply-chain user → Interactive demo: asks
rag/interactive_demo.py - Airflow DAG → Source ingestion: invokes
dags/airflow_pharma_pipeline_dag.py - Source ingestion → openFDA APIs: fetches
ingestion/pharma_ingestion_runner.py - Source ingestion → NIH RxNav API: fetches
ingestion/pharma_ingestion_runner.py - Source ingestion → Bronze raw data: writes snapshots
ingestion/pharma_ingestion_runner.py - Bronze raw data → Silver quality: clean and validate
README.md - Silver quality → Gold analytics: produce analytics
README.md - Source inventory → Text extraction: registers sources
rag/extraction/extractor.py - Text extraction → Bronze raw data: reads records
rag/extraction/extractor.py - Text extraction → Document chunking: provides extracted units
rag/chunking/chunker.py - Document chunking → Hybrid index: provides chunks
rag/chunking/embeddings.py - Hybrid index → Grounded retrieval: loads index
rag/retrieval/rag_pipeline.py - Interactive demo → Grounded retrieval: asks questions
rag/interactive_demo.py - Grounded retrieval → RAG evaluation: answers benchmark queries
rag/evaluation/evaluate_rag.py - FastAPI backend → Grounded retrieval: integrates RAG
- Streamlit dashboard → Gold analytics: presents analytics