This Chatbot is build specifically as a reusable and configurable sample app to share with enterprises or prospects.
- 🤩 It leverages DataStax RAGStack for production-ready use of the following components:
- 🚀 The Astra DB Vector Store for Semantic Similarity search to enable Retrieval Augmented Generation
- 🧠 It uses Astra DB as Short Term Memory to keep track of what was said and generated
- 🦜🔗 LangChain for linking OpenAI and Astra DB
- 👑 It uses Streamlit as the framework to easily create Web Applications
- It uses a StreamingCallbackHandler to stream output to the screen which prevents having to wait for the final answer
- It allows for new Content to be uploaded, Vectorized and Stored into the Astra DB Vector Database so it can be used as Context
- It offers a configurable localization through
localization.csv
- It offers a guided experience on-rails through
rails.csv
- First install the Python dependencies using:
pip3 install -r requirements.txt
- Then update the
OpenAI
,AstraDB
and optionallyLangSmith
secrets instreamlit-langchain/.streamlit/secrets.toml
. There is an example provided atsecrets.toml.example
.
Now it's time to customize the app for your specific situation or customers.
Define credentials by adding a new username and password in the [passwords]
section in streamlit-langchain/.streamlit/secrets.toml
.
Define the UI language of the app by adding a localization code in the [languages]
section in streamlit-langchain/.streamlit/secrets.toml
. Currently en_US
and nl_NL
are supported. However it is easy to add additional languages in localization.csv
.
Create a guided experience by providing sample prompts in rails.csv
. The convention here is that <username>
from Step 1 is used to define the experience.
Start up the app and pre-load relevant PDF and Text files so that the app has content that can be used as context for the questions/prompts in the next step. All this data will be loaded into a user specific table defined by <username>
.
Create a customized welcome page in the root folder. The convention here is to create a markdown file called <username>.md
. Ideally, list which files have been pre-loaded.
You're ready to run the app as follows:
streamlit run app.py
In addition to the pre-loaded content, a user can add additional content that will be used as context for prompts.
It's easy to upload this app to the community edition of Streamlit. As the app uses a login page it is safe to have it publicly available.
The goal of this app is to be easily shared within enterprises. Just be aware that YOUR OPENAI subscription is being used for creating embeddings and LLM calls. This WILL incur cost.