AskDocs AI is a Streamlit app for working with text-based PDF documents. Upload a PDF, ask questions about its contents, generate a short summary, or build a multiple-choice quiz from the document.
The app runs locally with Ollama and Llama 3, uses FAISS for semantic search, and uses Hugging Face sentence embeddings to retrieve the most relevant PDF chunks before answering.
- PDF upload and text extraction
- Semantic question answering over uploaded PDFs
- Instant summary generation from document content
- Multiple-choice quiz generation with scoring
- Suggested questions in the sidebar
- Local Llama 3 inference through Ollama
- Cached embeddings and model resources for faster repeated use
- Python
- Streamlit
- LangChain community integrations
- LangChain Ollama integration
- FAISS
- Hugging Face Sentence Transformers
- pypdf
- Ollama with Llama 3
This project was built by Ankit Raj.
DocuMind/
├── app.py
├── assets/
│ └── styles.css
├── components/
│ ├── chat_ui.py
│ ├── loaders.py
│ ├── quiz_ui.py
│ └── sidebar.py
├── utils/
│ ├── llm_handler.py
│ ├── pdf_reader.py
│ ├── prompts.py
│ ├── quiz_generator.py
│ ├── text_splitter.py
│ └── vector_store.py
├── requirements.txt
└── README.md
- Python 3.10 or newer
- Ollama installed locally
- The
llama3model pulled in Ollama
- Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activateOn Windows:
python -m venv venv
venv\Scripts\activate- Install Python dependencies:
pip install -r requirements.txt-
Install Ollama from ollama.com.
-
Pull the Llama 3 model:
ollama pull llama3- Start Ollama if it is not already running:
ollama serve- Run the app:
streamlit run app.py- A PDF is uploaded through the Streamlit interface.
pypdfextracts readable text from the document.- The text is split into overlapping chunks.
- Sentence Transformer embeddings are created for each chunk.
- FAISS stores the embedded chunks for similarity search.
- For normal questions, the app retrieves the most relevant chunks and sends them to Llama 3 through Ollama.
- For summary requests, the app summarizes a larger slice of the document.
- For quizzes, the app asks Llama 3 to generate validated multiple-choice questions from selected chunks.
- The app is designed for text-based PDFs. Scanned or image-only PDFs may not produce readable text.
- The default local model is
llama3, configured inutils/llm_handler.py. - The embedding model is
sentence-transformers/all-MiniLM-L6-v2, configured inutils/vector_store.py. - Quiz generation depends on the quality and amount of text extracted from the PDF.


