Local AI Document Assistant: Read, Search, and Chat with PDFs Using Local AI
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle.
What I Built
I built Local AI Document Assistant, a Python-based application that combines a simple PDF reader with AI-powered document understanding.
Working with long PDF documents can be time-consuming. Finding specific information, understanding lengthy reports, and extracting invoice details often require manual effort. I wanted to build a tool that makes these tasks easier while allowing users to process documents locally.
Features
- ๐ Read PDF: Extract and view text from PDF documents.
- ๐ Search Text: Find specific words and phrases.
- ๐ค Ask AI: Ask questions about a document and get answers based on its content.
- ๐ Summarize PDF: Generate short, medium, or detailed summaries.
- ๐งพ Extract Invoice Details: Extract invoice numbers, dates, customer and seller names, subtotal, tax, total amount, and currency.
- โฌ๏ธ Download Results: Download extracted text, summaries, and invoice data.
Who Could Benefit?
Students can use it to understand study materials and reports. Freelancers and professionals can search project documents, while small businesses can experiment with extracting information from invoices.
Potential customers could include freelancers, small businesses, and professionals who regularly work with documents. Possible future business models include a premium desktop tool or a customized document-processing solution. The project is currently a prototype, and I have not yet validated a paid business model.
Demo
The application currently runs locally on my computer.
- GitHub repository: https://github.com/Samruddhipathrikar/local-ai-document-assistant
- Live demo: Not deployed yet.
The application can be launched locally using Streamlit and Ollama.
Code
GitHub: Local AI Document Assistant
The source code includes the Python application, PDF text extraction, the Streamlit interface, and integration with a locally running AI model.
How I Built It
I used Python and open-source tools to build a web interface for PDF processing and local AI inference.
Technologies
- Python โ application logic.
- Streamlit โ interactive web interface.
- PyMuPDF โ PDF text extraction.
- Ollama โ local model execution and API access.
- Qwen2.5 3B โ open-weight language model.
- Requests โ communication with the Ollama API.
- Pandas โ invoice data handling and CSV downloads.
How It Works
- A user uploads a PDF.
- PyMuPDF extracts the document's selectable text.
- The user chooses to read, search, summarize, ask questions, or extract invoice details.
- The application sends the relevant text and instructions to the local Qwen model through Ollama.
- The response is displayed in the Streamlit interface.
- Users can download supported results.
I selected a small language model to experiment with local inference on my personal computer without depending on a paid cloud AI API.
The current version works best with text-based PDFs. OCR for scanned documents is a potential future improvement.
Why Does Open Innovation Matter?
Open innovation makes AI development more accessible to individual developers and small teams.
Using an open-weight model with Ollama allowed me to experiment with local AI inference, build a practical application around an existing model, and learn how to integrate AI into a Python application without training a model from scratch.
It also gave me more control over where document processing happens. In this application, document text is processed through a locally running Ollama service rather than a cloud AI API.
This project helped me explore how open-source AI tools can be combined to solve everyday problems with limited resources.
What I Learned
While building this project, I explored:
- Integrating a local language model into a Python application.
- Extracting text from PDF documents.
- Designing prompts for question-answering, summarization, and structured extraction.
- Handling JSON responses and downloadable CSV files.
- Combining traditional document processing with AI features in one interface.
What's Next?
I would like to improve the project by adding:
- OCR support for scanned PDFs.
- Better support for long documents and multiple PDFs.
- Page references for AI-generated answers.
- More reliable extraction and validation.
- A polished interface and a public demo.
This is an ongoing project, and I look forward to improving it through testing and feedback.
Thanks for checking out my submission!
Built with Python, Streamlit, Ollama, and open-weight AI.
Top comments (0)