A Retrieval-Augmented Generation (RAG) chatbot built with Streamlit, FAISS, HuggingFace embeddings, and Google Gemini.
It allows users to upload documents, perform semantic search, and generate accurate, context-aware answers using large language models.
This project also demonstrates RDF-like semantic triple extraction, semantic similarity scoring, and is inspired by research on LLM-powered intelligent knowledge graph construction in medical domains.
- Upload multiple documents
- Extract text from PDF / PPTX / DOCX
- Smart text chunking using
RecursiveCharacterTextSplitter - Vector embeddings with all-MiniLM-L6-v2
- High-speed semantic search using FAISS
- Google Gemini for answer generation
- Auto-generated semantic triples (demo)
- Semantic similarity scoring
- Vector store caching for fast reloads
- Fully interactive Streamlit UI
- Python 3.10+
- Streamlit
- LangChain
- FAISS
- sentence-transformers
- Google Generative AI (Gemini)
muq-bot-rag/
│
├── app.py # Main Streamlit application
├── utils.py # Loaders, chunking, FAISS helpers
├── requirements.txt # Dependencies
└── README.md # Project documentation
git clone https://github.com/mohdmuqsith/muq-bot-rag.git
cd muq-bot-ragWindows
python -m venv venv
venv\Scripts\activateMac / Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate the file:
.streamlit/secrets.toml
Add:
GOOGLE_API_KEY = "your_api_key_here"
Windows
setx GOOGLE_API_KEY "your_api_key_here"Mac / Linux
export GOOGLE_API_KEY="your_api_key_here"streamlit run app.pyOpen in your browser:
http://localhost:8501
- User uploads documents
- Text is extracted
- Text is chunked
- Chunks are embedded using HuggingFace
- Embeddings are stored in FAISS
- User asks a question
- Top-k relevant chunks are retrieved
- Gemini generates the final answer
- Semantic triples & similarity scores are displayed
- Push your repository to GitHub
- Visit: https://share.streamlit.io
- Connect your repository
- Select
app.py - Add the following in Secrets:
GOOGLE_API_KEY = "your_api_key_here"
- Deploy 🚀
Your Gemini account may not support the chosen model.
Use test.py to list available models.
Install the CPU-only version:
pip install faiss-cpuMake sure:
.streamlit/secrets.tomlexists- It is correctly indented
- No extra spaces or quotes
Inspired by research on LLM-assisted RDF knowledge graph construction, semantic retrieval workflows, and medical ontology mapping using large language models.
Research Inspiration:
- Large Language Models for Intelligent RDF Knowledge Graph Construction
- Published in Frontiers in Artificial Intelligence (2025)
- Focus: Medical ontology mapping, semantic interoperability, and explainable AI
Mohammed Abdul Muqsith
Demo Project: https://github.com/mohdmuqsith/muq-bot-rag.git