AI-Powered Document Intelligence using Retrieval-Augmented Generation (RAG)
Build a private AI knowledge assistant that understands your documents using semantic search, vector databases, and local Large Language Models.
DocumentGPT Pro is a production-inspired Retrieval-Augmented Generation (RAG) application that allows users to upload PDF, DOCX, and TXT documents and interact with them using natural language.
Instead of sending an entire document to a Large Language Model, the application retrieves only the most semantically relevant document chunks using Sentence Transformers and ChromaDB before generating responses with Llama 3.2 running locally through Ollama.
The entire pipeline runs completely offline, making the application privacy-friendly while demonstrating modern AI engineering concepts such as vector databases, embeddings, semantic search, prompt engineering, and conversational document intelligence.
| π€ AI | π Documents | β‘ User Experience |
|---|---|---|
| Retrieval-Augmented Generation | Streaming Responses | |
| Semantic Search | DOCX | Suggested Questions |
| Ollama Local LLM | TXT | Copy Answer |
| AI Summarization | Multi-page Support | Export Chat |
| Context Relevance | Source References | Modern UI |
| Conversation Memory | Document Insights | Fully Offline |
Large Language Models are powerful but cannot answer questions about your private documents unless those documents are supplied as context.
DocumentGPT Pro solves this using a complete Retrieval-Augmented Generation pipeline.
Instead of relying on the model's internal knowledge, the system:
- Parses uploaded documents
- Splits text into semantic chunks
- Generates vector embeddings
- Stores embeddings in ChromaDB
- Retrieves only the most relevant context
- Generates grounded answers using Ollama
This approach produces more accurate, explainable, and context-aware responses while keeping all data local.
The landing page provides a clean interface for uploading and processing documents.
The workspace presents AI-generated summaries, suggested questions, document insights and statistics.
Chat naturally with your documents while viewing retrieved source references.
Automatically generated document statistics help users quickly understand uploaded content.
The application follows a modular Retrieval-Augmented Generation (RAG) architecture.
Pipeline Overview
- Upload document
- Extract document text
- Split into semantic chunks
- Generate vector embeddings
- Store embeddings in ChromaDB
- Retrieve relevant document chunks
- Construct contextual prompt
- Generate answer using Ollama
- Stream the response back to the user
| Layer | Technology |
|---|---|
| Programming Language | Python 3.12 |
| Frontend | Streamlit |
| AI Framework | LangChain |
| Large Language Model | Llama 3.2 (Ollama) |
| Embeddings | all-MiniLM-L6-v2 |
| Embedding Framework | Sentence Transformers |
| Vector Database | ChromaDB |
| PDF Processing | PyPDF2 |
| DOCX Processing | python-docx |
| PDF Export | ReportLab |
The project follows a modular architecture where each module has a single responsibility, making the application easier to maintain, extend, and test.
DocumentGPT-Pro/
β
βββ assets/ # Banner, architecture diagram & custom styling
βββ chroma_db/ # ChromaDB vector database
βββ components/ # Reusable Streamlit UI components
βββ screenshots/ # README screenshots
βββ tests/ # Unit tests
βββ uploads/ # Uploaded documents
βββ utils/ # Core AI, RAG and helper modules
β
βββ app.py # Main application
βββ config.py # Application configuration
βββ requirements.txt # Python dependencies
βββ README.md
βββ .gitignore
git clone https://github.com/nakul85/DocumentGPT-Pro.git
cd DocumentGPT-ProWindows
python -m venv venv
venv\Scripts\activateLinux / macOS
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtDownload Ollama from:
Pull the required model:
ollama pull llama3.2:3bVerify installation:
ollama liststreamlit run app.pyThe application will automatically launch in your browser.
Upload a document.
Supported formats:
- DOCX
- TXT
Click π Process Document
The application automatically:
- Extracts document text
- Splits the content into semantic chunks
- Generates vector embeddings
- Stores vectors in ChromaDB
- Creates an AI-generated summary
- Generates suggested questions
- Calculates document insights
Ask questions naturally.
Example prompts:
Summarize this document.
Explain the key concepts.
Generate interview questions.
What are the important findings?
Explain the conclusion.
Compare two topics.
What is Retrieval-Augmented Generation?
The application retrieves the most relevant document chunks before querying the LLM.
The generated response includes:
- AI-generated answer
- Retrieved source references
- Context relevance score
- Streaming response
- Conversation history
Document
β
βΌ
Text Extraction
β
βΌ
Recursive Chunking
β
βΌ
Sentence Transformers
β
βΌ
Vector Embeddings
β
βΌ
ChromaDB
β
User Question
β
βΌ
Similarity Search
β
βΌ
Context Builder
β
βΌ
Ollama (Llama 3.2)
β
βΌ
Streaming Response
DocumentGPT Pro is designed with privacy as a core principle.
- β No cloud APIs
- β No external document uploads
- β Local vector database
- β Local embedding generation
- β Local LLM inference
All processing is performed entirely on your machine.
Although DocumentGPT Pro is fully functional, several enhancements can further extend its capabilities.
- π Multi-document knowledge base
- π Hybrid Search (Keyword + Semantic Search)
- πΌ OCR support for scanned PDFs
- π€ Voice-based document interaction
- π Cloud deployment (AWS, Azure or GCP)
- π₯ User authentication and document management
- π Citation highlighting within documents
- π± Responsive mobile interface
- π Multi-language document support
- π§ Support for larger local language models
β Retrieval-Augmented Generation (RAG)
β Semantic Search using Sentence Transformers
β Local LLM Inference with Ollama
β Vector Database using ChromaDB
β AI-powered Document Summarization
β Suggested Question Generation
β Context Relevance Scoring
β Source-grounded Responses
β Conversation Export
β Modular Python Architecture
β Offline & Privacy-first Design
This project is licensed under the MIT License.
Feel free to use, modify, and distribute this project under the terms of the MIT License.
Nakul Firodiya
AI Engineer | Python | Machine Learning | Generative AI | Retrieval-Augmented Generation (RAG)
- GitHub: https://github.com/nakul85
- LinkedIn: https://www.linkedin.com/in/nakulfirodiya74/
This project was built using several outstanding open-source technologies.
Special thanks to the communities behind:
- Ollama
- LangChain
- ChromaDB
- Hugging Face
- Streamlit
- Sentence Transformers
Their work makes modern AI application development accessible to everyone.





