An AI-powered chatbot that answers questions from your PDF documents using RAG (Retrieval Augmented Generation) architecture, powered by LangChain + Groq LLaMA3 + Streamlit.
Upload any PDF → Ask questions → Get answers strictly from your documents.
Upload PDF from UI
↓
PyPDFLoader (LangChain) extracts text
↓
PDF content → Context string
↓
PromptTemplate (context + chat history + question)
↓
Groq LLaMA3-70b (LLM)
↓
StrOutputParser → Answer displayed in Streamlit UI
- Upload multiple PDFs directly from the UI sidebar
- Context-bound answers — LLM only uses PDF content
- Chat history maintained across conversation
- Cached LLM instance — fast responses
- Clean Streamlit chat UI
- Clear chat history button
- Graceful error handling
| Layer | Technology |
|---|---|
| LLM | Groq API (LLaMA3-70b-versatile) |
| RAG Framework | LangChain |
| Document Loading | PyPDFLoader + tempfile |
| Prompt | LangChain PromptTemplate |
| Chain | LCEL (LangChain Expression Language) |
| Frontend | Streamlit |
git clone https://github.com/Prajwal4581/AskMyDocs.git
cd AskMyDocspython -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # Mac/Linuxpip install -r requirements.txtcp .env.example .env
# Add your Groq API key in .env
GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxGet free Groq key → https://console.groq.com
streamlit run app.py6. Open browser → http://localhost:8501
- Upload PDFs from sidebar
- Ask questions in chat
- Get answers from your documents 🎯
AskMyDocs/
├── app.py # Main Streamlit app + RAG chain
├── requirements.txt
├── .env.example
├── .gitignore
└── README.md
| Question | Source |
|---|---|
| "What are the tables in Residentia?" | Residentia PDF → lists all 12 tables |
| "What is Spring Boot?" | Java notes PDF → explains concept |
| "Summarize this document" | Any PDF → gives summary |
- Replace PDF concatenation with FAISS/ChromaDB vector store
- Add RecursiveCharacterTextSplitter for large documents
- Add semantic embeddings for better retrieval accuracy
- Support DOCX, TXT file formats
- Deploy on Streamlit Cloud with shareable URL
- Add source citation (which page answered the question)