"Whenever dharma declines and the purpose of life is forgotten, I manifest myself on earth." β Bhagavad Gita
This project is a GenAI RAG-based chatbot that lets you talk to Lord Krishna himself πΈ.
It uses LangChain, FAISS, and HuggingFace Inference API to provide life guidance from the Bhagavad Gita, with direct verse references.
The UI has a divine Krishna essence π¨ β with peacock feather watermark πͺΆ β so the experience feels like a spiritual conversation rather than just a Q&A bot.
- π Reference from Bhagavad Gita (PDF source)
- π§ Conversational Memory β Krishna remembers your past questions in the session
- π RAG (Retrieval-Augmented Generation) β Accurate answers grounded in scripture
- π¨ Aesthetic UI with peacock feather watermark
- β‘ Flask Backend + HTML/CSS/JS Frontend
- π Deployable on Render/Heroku/Docker
- Backend β Flask + LangChain + HuggingFace API
- Frontend β HTML, CSS, JS (chat-style interface)
- Vector DB β FAISS (local)
- PDF Loader β LangChain PyPDFLoader
- Memory β ConversationBufferMemory
π BhagavadGita-Chatbot
βββ app.py # Flask backend (RAG + Memory)
βββ requirements.txt # Dependencies
βββ .env # HuggingFace API Key
βββ /templates
β βββ index.html # Chat UI
βββ /static
β βββ style.css # Styling
β βββ script.js # Frontend logic
βββ Bhagavad-gita-As-It-Is-English.pdf # Knowledge source
git clone https://github.com/your-username/BhagavadGita-Chatbot.git
cd BhagavadGita-Chatbot
2οΈβ£ Create Virtual Environment (recommended)
python -m venv venv
source venv/bin/activate # Mac/Linux
venv\Scripts\activate # Windows
3οΈβ£ Install Dependencies
pip install -r requirements.txt
4οΈβ£ Add Environment Variables Create a .env file:
HUGGINGFACEHUB_API_TOKEN=your_api_key_here
5οΈβ£ Run the App
python app.py
Visit π http://127.0.0.1:8080/ in your browser.
Deployment with Docker (Optional)
docker build -t gita-chatbot .
docker run -d -p 5000:5000 --env-file .env gita-chatbot
Future Enhancements
- Voice-enabled chat with Krishna
- Support for additional languages (Hindi, Sanskrit, Marathi)
- Rich mobile experience (PWA)
- Persistent session storage for multi-user environments
Acknowledgments
- Bhagavad Gita β timeless source of divine wisdom
- LangChain β elegant RAG implementation
- HuggingFace β for inference APIs
- GitHub & Render β for deployment support