RAG chatbot with persistent conversation history and PDF document querying.
Upload a PDF and ask questions about it. The chatbot maintains conversation context across turns, retrieves relevant document chunks using vector embeddings, and generates answers via Google Gemini.
Python LangChain Google Gemini FAISS Streamlit HuggingFace Embeddings
git clone https://github.com/umran666/ChatBot_With_Memory.git
cd ChatBot_With_Memory
pip install -r requirements.txtCreate .env with your Google API key:
GOOGLE_API_KEY=your_key_here
Launch:
streamlit run app.pyUpload a PDF in the sidebar and start asking questions.
PDF Upload → Text Extraction → Chunking → Embeddings → FAISS Index
↓
User Query → Retrieve relevant chunks → LLM → Answer + Sources
- Conversation memory — retains history for context-aware follow-ups
- PDF Q&A — extract and search document content via RAG
- Semantic search — HuggingFace embeddings + FAISS for fast retrieval
- Source transparency — shows which document sections informed each answer
| Parameter | Default | Description |
|---|---|---|
k (retrieval) |
4 | Number of document chunks to retrieve |
temperature |
0.3 | LLM response creativity |
chunk_size |
1000 | PDF text split size |
chunk_overlap |
200 | Overlap between chunks |
- AI document assistant
- Research paper Q&A
- Company knowledge base chatbot
- Resume / portfolio analyzer
- Legal document search
- Python 3.8+
- Google Gemini API key (free tier available)
- Internet connection
MIT