Skip to content
 
 

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AskDocs AI

AskDocs AI is an AI-powered Streamlit application for interacting with text-based PDF documents. Users can upload a PDF, ask questions about its contents, generate concise summaries, and create multiple-choice quizzes from the document.

The application runs locally using Ollama and Llama 3, uses FAISS for semantic search, and uses Hugging Face Sentence Transformers to retrieve the most relevant document chunks before generating responses.

Features

  • 📄 PDF upload and text extraction
  • 💬 Semantic question answering over uploaded PDFs
  • 📝 Automatic document summary generation
  • 🧪 Multiple-choice quiz generation with scoring
  • 💡 Suggested questions in the sidebar
  • 🤖 Local Llama 3 inference through Ollama
  • 🔎 Semantic search using FAISS
  • 🧠 Hugging Face Sentence Transformer embeddings
  • ⚡ Cached embeddings and model resources for faster repeated use
  • 🖥️ Interactive Streamlit user interface

Tech Stack

  • Python
  • Streamlit
  • LangChain
  • LangChain Community Integrations
  • LangChain Ollama Integration
  • FAISS
  • Hugging Face Sentence Transformers
  • pypdf
  • Ollama
  • Llama 3

My Contributions

As a collaborative contributor to AskDocs AI, I worked on the following areas:

  • 📄 Document Processing — Worked on PDF text extraction, document processing, and preparing content for the AI pipeline.
  • 💬 Question Answering Integration — Contributed to integrating document-based question answering using retrieved PDF content.
  • 📝 Summary Generation — Worked on generating concise summaries from uploaded document content.
  • 🧪 Testing & Debugging — Tested application features, identified issues, and helped debug the system.
  • 🤝 GitHub Collaboration — Collaborated on development, version control, and project updates using GitHub.

Contributors

AskDocs AI was developed collaboratively.

  • Rohit Kumar — Document Processing, Question Answering Integration, Summary Generation, Testing & Debugging
  • Ankit Raj — Core Development and Project Contributions

Project Structure

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

Requirements

  • Python 3.10 or newer
  • Ollama installed locally
  • The llama3 model pulled in Ollama

Setup

  1. Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate

On Windows:

python -m venv venv
venv\Scripts\activate
  1. Install Python dependencies:
pip install -r requirements.txt
  1. Install Ollama from ollama.com.

  2. Pull the Llama 3 model:

ollama pull llama3
  1. Start Ollama if it is not already running:
ollama serve
  1. Run the app:
streamlit run app.py

How It Works

  1. A PDF is uploaded through the Streamlit interface.
  2. pypdf extracts readable text from the document.
  3. The text is split into overlapping chunks.
  4. Sentence Transformer embeddings are created for each chunk.
  5. FAISS stores the embedded chunks for similarity search.
  6. For normal questions, the app retrieves the most relevant chunks and sends them to Llama 3 through Ollama.
  7. For summary requests, the app summarizes a larger slice of the document.
  8. For quizzes, the app asks Llama 3 to generate validated multiple-choice questions from selected chunks.

Notes

  • 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 in utils/llm_handler.py.
  • The embedding model is sentence-transformers/all-MiniLM-L6-v2, configured in utils/vector_store.py.
  • Quiz generation depends on the quality and amount of text extracted from the PDF.

Screenshots

Home

AskDocs home screen

Chat With Document

Chat with document screen

Quiz Generator

Quiz generator screen

About

AI-powered PDF assistant for document Q&A, summarization, and quiz generation using Llama 3, FAISS, and Streamlit.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages