Skip to content

TomH1004/Local-PDF-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Chat Tool

An interactive tool that allows users to chat with their PDF documents using advanced language models and semantic search. Built with Angular frontend and Flask backend.

pdf-chat

Features

  • PDF Document Processing

    • Upload and process PDF files
    • Automatic text extraction
    • Smart table detection and formatting
    • Real-time processing status updates
  • Intelligent Chat Interface

    • Natural language question answering
    • Context-aware responses
    • HTML-formatted answers with proper styling
    • Support for tables and structured data
    • Image upload and analysis capabilities
  • Advanced Search & Retrieval

    • Semantic search using FAISS vector store
    • Multi-query retrieval for better results
    • Automatic question rephrasing
    • Table-aware search optimization

Technology Stack

Frontend

  • Angular 15
  • Angular Material UI
  • RxJS for reactive programming
  • PDF.js for PDF rendering

Backend

  • Flask
  • FAISS for vector search
  • PyMuPDF for PDF processing
  • Ollama for embeddings and chat
  • LangChain for document processing

Getting Started

Prerequisites

  • Python 3.12+
  • Node.js and npm
  • Ollama installed and running locally

Backend Setup

  1. Navigate to the backend directory
  2. Create a virtual environment:
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:
    pip install -r requirements.txt
  4. Run the backend server:
    python backend.py
    The server will start at http://localhost:5000

Frontend Setup

  1. Navigate to the frontend directory
  2. Install dependencies:
    npm install
  3. Start the development server:
    ng serve
    The application will be available at http://localhost:4200

Usage

  1. Upload PDF

    • Click "Select PDF" to upload your document
    • Wait for processing to complete
    • Progress indicators will show current status
  2. Ask Questions

    • Type your question in the chat input
    • Get HTML-formatted responses
    • View tables and structured data
    • Upload images for visual context
  3. View Results

    • See PDF preview in the right panel
    • Get context-aware answers
    • View formatted tables and lists
    • Track processing stages

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published