A conversational AI that answers questions about the Bhagavad Gita using Retrieval-Augmented Generation (RAG). Ask anything about the Gita's teachings, verses, and philosophy — and get accurate, context-grounded answers.
- 📖 PDF-based knowledge — answers grounded strictly in the Bhagavad Gita text
- 🧠 Chat memory — remembers previous questions within a session
- 🔍 Source transparency — shows which verses/pages the answer came from
- 🚫 Hallucination guard — only answers from the document, never from general knowledge
- ⚡ Fast responses — powered by Groq's ultra-fast LLM inference
- 💾 Persistent vector store — FAISS index built once, reused every run
| Layer | Technology |
|---|---|
| UI | Streamlit |
| LLM | Groq (llama-3.3-70b-versatile) |
| Embeddings | HuggingFace (all-MiniLM-L6-v2) |
| Vector Store | FAISS (local) |
| RAG Framework | LangChain |
| PDF Loader | PyPDFDirectoryLoader |
git clone https://github.com/yourusername/BhagavadGitaGPT.git
cd BhagavadGitaGPTpython -m venv myenv
# Windows
myenv\Scripts\activate
# Mac/Linux
source myenv/bin/activatepip install -r requirements.txtCreate a .env file in the root directory:
GROQ_API_KEY=your_groq_api_key_hereGet your free Groq API key at → https://console.groq.com
Place your Bhagavad Gita PDF(s) inside the pdfs/ folder:
BhagavadGitaGPT/
└── pdfs/
└── bhagavad_gita.pdf
streamlit run BhagavadGita.pyThe app will:
- Load PDFs from the
pdfs/folder - Chunk and embed the text
- Save the FAISS index to
vector_store/ - Launch the chat interface at
http://localhost:8501
streamlit run BhagavadGita.pyNo re-ingestion needed — the vector store is reused automatically.
BhagavadGitaGPT/
│
├── pdfs/ # Place your Bhagavad Gita PDFs here
├── images/ # UI images (krishna.png, sacred_book_1.png)
├── vector_store/ # Auto-generated FAISS index (gitignored)
├── BhagavadGita.py # Main Streamlit app
├── requirements.txt # Python dependencies
├── .env # API keys (gitignored)
└── .gitignore
streamlit
langchain==0.3.15
langchain-community==0.3.15
langchain-groq
langchain-huggingface
langchain-text-splitters
langchain-core
sentence-transformers
faiss-cpu
pypdf
python-dotenv- Bhagavad Gita — the sacred text
- LangChain — RAG framework
- Groq — LLM inference
- Streamlit — UI framework