Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DocumentGPT Pro Banner

πŸ“„ DocumentGPT Pro

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.

Python Streamlit LangChain Ollama ChromaDB HuggingFace


πŸ“– Overview

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.


✨ Features

πŸ€– AI πŸ“„ Documents ⚑ User Experience
Retrieval-Augmented Generation PDF 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

🎯 Why DocumentGPT Pro?

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.


πŸ–ΌοΈ Application Preview

🏠 Home

The landing page provides a clean interface for uploading and processing documents.


🧠 AI Workspace

The workspace presents AI-generated summaries, suggested questions, document insights and statistics.


πŸ’¬ Intelligent Conversation

Chat naturally with your documents while viewing retrieved source references.


πŸ“Š Document Insights

Automatically generated document statistics help users quickly understand uploaded content.


πŸ—οΈ System Architecture

The application follows a modular Retrieval-Augmented Generation (RAG) architecture.

Pipeline Overview

  1. Upload document
  2. Extract document text
  3. Split into semantic chunks
  4. Generate vector embeddings
  5. Store embeddings in ChromaDB
  6. Retrieve relevant document chunks
  7. Construct contextual prompt
  8. Generate answer using Ollama
  9. Stream the response back to the user

πŸ› οΈ Technology Stack

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

πŸ“‚ Project Structure

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

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/nakul85/DocumentGPT-Pro.git

cd DocumentGPT-Pro

2. Create a Virtual Environment

Windows

python -m venv venv

venv\Scripts\activate

Linux / macOS

python3 -m venv venv

source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Install Ollama

Download Ollama from:

https://ollama.com/download

Pull the required model:

ollama pull llama3.2:3b

Verify installation:

ollama list

5. Run the Application

streamlit run app.py

The application will automatically launch in your browser.


πŸ’» Usage

Step 1

Upload a document.

Supported formats:

  • PDF
  • DOCX
  • TXT

Step 2

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

Step 3

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?

Step 4

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

🧠 RAG Pipeline

Document
    β”‚
    β–Ό
Text Extraction
    β”‚
    β–Ό
Recursive Chunking
    β”‚
    β–Ό
Sentence Transformers
    β”‚
    β–Ό
Vector Embeddings
    β”‚
    β–Ό
ChromaDB
    β”‚
User Question
    β”‚
    β–Ό
Similarity Search
    β”‚
    β–Ό
Context Builder
    β”‚
    β–Ό
Ollama (Llama 3.2)
    β”‚
    β–Ό
Streaming Response

πŸ”’ Privacy

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.


πŸš€ Future Improvements

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

πŸ“Œ Project Highlights

βœ… 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


πŸ“œ License

This project is licensed under the MIT License.

Feel free to use, modify, and distribute this project under the terms of the MIT License.


πŸ‘¨β€πŸ’» Author

Nakul Firodiya

AI Engineer | Python | Machine Learning | Generative AI | Retrieval-Augmented Generation (RAG)

Connect with Me


πŸ™ Acknowledgements

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.


⭐ If you found this project helpful, consider giving it a Star!

About

AI-powered Retrieval-Augmented Generation (RAG) document assistant built with Ollama, LangChain, ChromaDB, Sentence Transformers, and Streamlit.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages