DocuMind AI is a Streamlit app that lets you upload one or more PDF files and ask questions about their contents. It extracts text from the PDFs, splits the text into chunks, stores embeddings in a FAISS vector index, and uses a Groq-hosted LLM for conversational question answering.
- Upload multiple PDF documents
- Extract text from each uploaded PDF
- Split document text into manageable chunks
- Create embeddings with Hugging Face sentence transformers
- Store document vectors in FAISS for retrieval
- Ask natural-language questions about the uploaded PDFs
- View the newest question/answer pair at the top of the chat
- Python
- Streamlit
- LangChain
- FAISS
- PyPDF2
- Hugging Face embeddings
- Groq LLM API
DocuMindAI/
|- app.py
|- htmlTemplates.py
|- .env
|- .gitignore
Create a .env file in the project root and add:
GROQ_API_KEY=your_groq_api_keyOptional variables if you later switch providers:
OPENAI_API_KEY=your_openai_api_key
HUGGINGFACEHUB_API_KEY=your_huggingface_api_keyFrom the project folder:
streamlit run app.pyIf streamlit is not recognized, use:
python3 -m streamlit run app.pyThen open the local URL shown in the terminal, usually:
http://localhost:8501
- Start the app.
- Upload one or more PDF files in the sidebar.
- Click
Process. - Wait until the success message appears.
- Ask questions about your uploaded documents.
- PDF files are uploaded through the Streamlit sidebar.
PyPDF2extracts text from each page.- LangChain splits the text into chunks.
HuggingFaceEmbeddingsconverts chunks into vectors.- FAISS stores the vectors for similarity search.
ConversationalRetrievalChainusesChatGroqto answer user questions with chat memory.
The app currently handles a few common edge cases:
- Empty or whitespace-only questions are ignored
- Asking a question before processing PDFs shows a warning
- Clicking
Processwithout uploading a PDF shows a warning - PDFs with no extractable text show a warning
- Empty chunk generation is handled with a warning
- The app currently uses
ChatGroq(model="llama-3.1-8b-instant", temperature=0). - Scanned/image-only PDFs may not work well unless OCR is added.
- Add a
requirements.txt - Add OCR support for scanned PDFs
- Persist the FAISS index locally
- Show source chunks used for answers
- Add automated tests
- Clean up unused imports and older LangChain imports
- Do not commit your
.envfile. - Keep API keys private.
- If any real API keys were exposed or shared accidentally, rotate them immediately.