Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG Bot: Document Q&A

Document Q&A using RAG with OpenAI API, Docling, and LanceDB.

Overview

RAG Bot is a Streamlit-based application that allows users to ask questions about uploaded documents. It uses Retrieval Augmented Generation (RAG) using the OpenAI API, Docling, and LanceDB to provide accurate and contextually relevant answers.

Note: An OpenAI API key is required for this tool to function. Without a valid API key, the tool will not be able to connect to the OpenAI services.

Features

  • Upload documents in PDF or DOCX format.
  • Process and store documents in a LanceDB database.
  • Ask questions about the uploaded documents.
  • Retrieve relevant context from the documents.
  • Generate responses using the OpenAI API.

Installation

  1. Clone the repository:

    git clone https://github.com/rj-price/ragbot.git
    cd ragbot
  2. Install the required dependencies:

    pip install -r requirements.txt
  3. Set up your .env file with your OpenAI API key and model of choice:

    cp .example.env .env

Usage

  1. Run the Streamlit application:

    streamlit run ragbot.py
  2. Open your web browser and navigate to http://localhost:8501.

  3. Use the sidebar to upload a document and select a database.

  4. Ask questions about the document using the chat input.

File Structure

  • ragbot.py: Main application file.
  • utils/: Directory containing utility functions for processing documents, retrieving context, and generating chat responses.
  • data/: Directory where document databases are stored.

Acknowledgements

About

Document Q&A using RAG with OpenAI API, Docling and LanceDB

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages