Skip to content

satvika-eda/RAG_based_document_assistant

Repository files navigation

Intelligent Document Assistant

This project implements a Retrieval-Augmented Generation (RAG) chatbot using Streamlit. The chatbot can answer user queries by retrieving context from uploaded documents (PDF or text) and generating responses using a language model. It supports processing and storing documents in a vector database, enabling efficient similarity searches.


Features

  • File Upload: Supports PDF and text files for document uploads.
  • Text Extraction: Extracts text from uploaded files and splits it into manageable chunks for vector storage.
  • Custom Embeddings: Uses a tailored embedding model for document indexing and similarity search.
  • Query Handling: Handles natural language queries with context-based responses.
  • Dynamic Interface: Interactive chat interface using Streamlit.
  • Error Handling: Alerts users about unsupported file types, empty files, and large uploads.

Technologies Used

  • Streamlit: For creating the web interface.
  • LangChain: For document processing, embeddings, and prompt management.
  • Chroma: As the vector database for similarity search.
  • PyPDF2: For PDF text extraction.
  • Custom Embeddings: For tailored representation of document text.
  • OpenAI GPT-4o: For natural language understanding and response generation.

Installation

Prerequisites

Ensure you have the following installed:

  • Python 3.11+
  • Pip

Setup

  1. Clone the repository:

    git clone https://github.com/satvika-eda/RAG_based_document_assistant.git
    cd RAG_based_document_assistant
  2. Create and activate a virtual environment:

     python -m venv venv
     source venv/bin/activate  
  3. Install dependencies:

     pip install -r requirements.txt

Execution

  1. Replace the REPLACE_ME for the OPENAI_API_KEY variable in the config.py by creating a new openai key.
  2. Execute the App using :
    streamlit run streamApp.py
  3. Start the application using the command above. The interface will open in your browser.
  4. Upload a file (PDF or text) using the "📎 Attach File" button.
  5. Once the file is processed, you can ask questions related to its content in the chat box.
  6. View responses generated by the chatbot in real-time.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages