Skip to content

Retrieval Augment Generation, Chat with your document using lang chain and open ai.

License

Notifications You must be signed in to change notification settings

gopikrsmscs/chat-with-document-rag

Repository files navigation

Chat with the Document (RAG): Attention is All You Need, Transformer

This project provides an interactive interface to chat with documents using a Retrieval-Augmented Generation (RAG) approach. It uses the "Attention is All You Need" Transformer paper as a primary document, Chroma for vector storage, and OpenAI's language model for chat responses. The application is built using Streamlit to provide an easy-to-use chat interface.

Project Structure

  • retrieval_augment_generation_chat.py: The main application file that sets up the Streamlit interface and handles the chat logic.
  • document_indexing.ipynb: A Jupyter Notebook responsible for loading, splitting, and creating embeddings from the document.
  • Transformer.pdf: The primary document used for the chat context.
  • chromadb: Directory where the Chroma vector store persists the document embeddings.

Requirements

  • Python 3.8 or higher
  • Streamlit
  • LangChain
  • OpenAI's API key
  • Chroma
  • PyPDFLoader

Installation

  • Clone the repository:
git clone [email protected]:gopikrsmscs/chat-with-document-rag.git

cd chat-with-document-rag
  • Install the required dependencies:
pip install streamlit langchain chromadb PyPDFLoader openai
  • Set up your OpenAI API key: Export your API key to the environment variable:
export OPENAI_API_KEY='your_openai_api_key'

Chat Interface Output

Features

  • Document Interaction: Chat with the content of the Transformer paper using a retrieval-augmented generation approach.
  • Contextual Responses: The model generates responses based on specific document sections, ensuring answers are relevant.
  • Streamlit Interface: Basic interface to type queries and see responses.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

Retrieval Augment Generation, Chat with your document using lang chain and open ai.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published