How krishnakantdev/chatbot works
This repository is a pharmaceutical-document RAG chatbot with Streamlit and FastAPI entry points. Both initialize a shared QA chain from a local drug-manual PDF, then pass user questions to it and return generated answers. The RAG module loads and chunks the manual, creates a FAISS index using Hugging Face embeddings, and configures retrieval with a Groq chat model. The graph reflects calls and configuration visible in the excerpts; the internal runtime behavior of the LangChain retrieval chain is represented only where its configuration is explicit.
Main entry points: rag.py QA chain builder · app.py Streamlit chat · api.py FastAPI endpoint · drug_manual.pdf Drug manual
Components 12
User Interfaces
- Streamlit chat
app.py - FastAPI endpoint
api.py
RAG Pipeline
- QA chain builder
rag.py - PDF loader
rag.py - Drug manual
data/drug_manual.pdf - Chunk splitter
rag.py - FAISS index
rag.py - Hugging Face embeddings
rag.py - Document retriever
rag.py - Retrieval QA
rag.py - Groq chat model
rag.py
Other components
- Chat user
Connections 17
- Chat user → Streamlit chat: asks
app.py - Streamlit chat → QA chain builder: builds chain
app.py - Streamlit chat → Retrieval QA: submits question
app.py - QA chain builder → PDF loader: loads documents
rag.py - PDF loader → Drug manual: reads PDF
rag.py - QA chain builder → Chunk splitter: splits documents
rag.py - QA chain builder → FAISS index: creates index
rag.py - FAISS index → Hugging Face embeddings: embeds chunks
rag.py - QA chain builder → Document retriever: configures retrieval
rag.py - Document retriever → FAISS index: searches index
rag.py - QA chain builder → Groq chat model: configures model
rag.py - QA chain builder → Retrieval QA: builds chain
rag.py - Retrieval QA → Document retriever: uses retriever
rag.py - Retrieval QA → Groq chat model: uses model
rag.py - Chat user → FastAPI endpoint: asks
api.py - FastAPI endpoint → QA chain builder: builds chain
api.py - FastAPI endpoint → Retrieval QA: submits question
api.py