https://github.com/brendancsmith/simple-rag-chat
Simple retrieval-augmented generation (RAG) chat application using Chainlit, Langchain, Chroma, and OpenAI
https://github.com/brendancsmith/simple-rag-chat
chainlit chatbot chromadb langchain openai rag retrieval-augmented-generation
Last synced: 3 months ago
JSON representation
Simple retrieval-augmented generation (RAG) chat application using Chainlit, Langchain, Chroma, and OpenAI
- Host: GitHub
- URL: https://github.com/brendancsmith/simple-rag-chat
- Owner: brendancsmith
- License: gpl-3.0
- Created: 2024-09-02T22:17:32.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-02-13T09:15:28.000Z (4 months ago)
- Last Synced: 2025-02-13T10:24:15.631Z (4 months ago)
- Topics: chainlit, chatbot, chromadb, langchain, openai, rag, retrieval-augmented-generation
- Language: Python
- Homepage:
- Size: 2.85 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple-rag-chat
[](https://www.codefactor.io/repository/github/brendancsmith/simple-rag-chat)

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.
## Interface
The following is an example chat using [Gap Q1 2023 Earnings Release](samples/1Q23-EPR-with-Tables-FINAL.pdf) as the uploaded PDF:
## 🧰 Stack
- [Python](https://www.python.org/downloads/release/python-3100/)
- [Langchain](https://python.langchain.com/docs/get_started/introduction.html)
- [Chainlit](https://docs.chainlit.io/overview)
- [Chroma](https://www.trychroma.com/)
- [OpenAI](https://openai.com/)## 👉 Getting Started
We use [Python Poetry](https://python-poetry.org/) for managing virtual environments and we recommend using [pyenv](https://github.com/pyenv/pyenv) to manage Python versions.
Install and start the Poetry shell as follows.
```bash
poetry install
poetry shell
```Please create an `.env` file from `.env.sample` once the application is installed. Edit the `.env` file with your OpenAI org and OpenAI key.
```bash
cp .env.sample .env
```### ⏯️ Run the Application
Run the application by:
```bash
chainlit run app/app.py -w
```### 🛠️ Development
Install pre-commit
```bash
pre-commit install
pre-commit install-hooks
```## LICENSE
This repository is an extension of [llm-pdf-qa-workshop](https://github.com/leehanchung/llm-pdf-qa-workshop) by Hanchung Lee, licensed under GPLv3.