A Retrieval-Augmented Generation (RAG) chatbot that answers questions only from provided documents, built using LangChain, Hugging Face models, FAISS vector search, and Streamlit.
- 🔍 Semantic search using FAISS
- 🧠 Hugging Face LLM (FLAN-T5)
- 📄 Answers grounded in documents
- 🔐 Input safety filtering
- 📚 Shows source documents for transparency
- 🖥️ Simple Streamlit web UI
Check out the deployed app here: GenAI RAG Chatbot
User Question
↓
Safety Check
↓
Retriever (FAISS)
↓
Relevant Context
↓
LLM (Hugging Face)
↓
Answer + Source Documents
rag_doc_assistant_genai/
│
├── scripts/
│ ├── embeddings.py # Vector store (FAISS)
│ ├── rag_pipeline.py # RAG chain logic
│ ├── safety.py # Input safety checks
│ ├── evaluation.py # RAG evaluation
│ └── finetune.py # Fine-tuning experiments
│
├── data/
│ └── sample.txt # Knowledge source
│
├── app_streamlit.py # Streamlit UI
├── requirements.txt # Dependencies
└── README.md
# Create Virtual Environment
python -m venv genai_env
# Activate it:
# On Windows:
genai_env\Scripts\activate
# On Mac/Linux:
source genai_env/bin/activatepip install -r requirements.txtPlace your documents inside:
data/sample.txt #The chatbot answers only from this file.streamlit run app_streamlit.pyQuestion:
Where was the Kalinga War fought?Answer:
The Kalinga War was fought at Dhauli, near present-day Bhubaneswar.Source:
sample.txt - LLM: Hugging Face (FLAN-T5)
- Embeddings: Sentence Transformers
- Vector DB: FAISS
- Framework: LangChain
- Frontend: Streamlit
- Language: Python
Anil Kumar Nayak
✨ Software Developer | Python, AI & Streamlit Enthusiast
-
PDF & Web-based RAG
-
Multi-document support
-
OpenAI / LLaMA integration
-
Chat memory
-
Docker deployment