Skip to content

ChatWithPDF is a Retrieval-Augmented Generation (RAG) application that leverages LangChain to enable AI-powered interactions with PDF documents. It uses LangChain's tools for text processing and retrieval to provide context-aware responses based on the content of the documents.

Notifications You must be signed in to change notification settings

ELEF-TQ/ChatWithPDFs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG Application: ChatWithPDFs

Overview

ChatWithPDF is a Python application that enables AI-powered interactions with multiple PDF documents. Using LangChain for advanced text processing and Retrieval-Augmented Generation (RAG) for context-aware responses, this application provides intelligent answers based on the content of your PDFs.

Features

  • AI-Powered Chat:: Users can ask questions about the content of multiple uploaded PDF documents.
  • Contextual Responses:: Delivers accurate answers based on the documents' text using LangChain and RAG.
  • Efficient Document Processing:: Reads multiple PDFs, extracts text, and embeds it for seamless interactions.
  • Text Chunking:: Divides text into manageable chunks for effective processing and retrieval.

Technologies Used

  • LangChain: Framework for linking the various components of the RAG system.
  • Streamlit: For creating the interactive web interface.
  • OpenAI API: For generating AI-driven responses.
  • Hugging Face (hkunlp/instructor-xl): Embedding functions for accurate information retrieval and Text generation model.

Installation

To run this project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/your-username/chatwithpdfs.git
    cd chatwithpdfs
  2. . Install dependencies:

    pip install -r requirements.txt
  3. Start the development server:

    streamlit run app.py

Configuration

Ensure you have the following environment variables set up:

  • OPENAI_API_KEY
  • HUGGINGFACEHUB_API_TOKEN

You can set these environment variables in a .env file at the root of your project.

Usage

  1. Load multiple PDF documents into the app by following the provided instructions.
  2. Ask questions in natural language about the loaded PDFs using the chat interface.

Project Structure

PDF-LangChain

Demo video

ChatWithPdf.mp4

About

ChatWithPDF is a Retrieval-Augmented Generation (RAG) application that leverages LangChain to enable AI-powered interactions with PDF documents. It uses LangChain's tools for text processing and retrieval to provide context-aware responses based on the content of the documents.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages