This is a simple retrieval-augmented generation (RAG) chat application using OpenAI, Chainlit, Langchain, and Chroma.
The app provides an chat interface that asks user to upload PDF or text documents and then allows the user to ask questions against the provided documents. It uses OpenAI's API for the chat and embedding models, Langchain for the framework, Chainlit as the fullstack interface, and Chroma for the vector database.
The following is an example chat using Gap Q1 2023 Earnings Release as the uploaded PDF:
We use Python Poetry for managing virtual environments and we recommend using pyenv to manage Python versions.
Install and start the Poetry shell as follows.
poetry install
poetry shellPlease create an .env file from .env.sample once the application is installed. Edit the .env file with your OpenAI org and OpenAI key.
cp .env.sample .envRun the application by:
chainlit run app/app.py -wInstall pre-commit
pre-commit install
pre-commit install-hooksThis repository is an extension of llm-pdf-qa-workshop by Hanchung Lee, licensed under GPLv3.
