Chainlit Data Persistency
The Chainlit data layer allows you to persist conversations in chainlit. This project uses a dockerized fork for easier deployment and setup.
In OpenRAG, one can activate Chainlit data layer following these steps:
Step 1: Set up authentication
Section titled “Step 1: Set up authentication”In fact, chainlit authentication is necessary for data persistency. Set chainlit authentication if not already done (refer to the chainlit auth guide)
Step 2: Add the following variables
Section titled “Step 2: Add the following variables”To deploy the Chainlit data layer service, add the following variable:
# Persistency services: postgres (localstack (AWS emulator deployed locally)CHAINLIT_DATALAYER_COMPOSE=extern/chainlit-datalayer/compose.yamlThis provides 2 services:
- a postgres database to store users, feedback, chat history, etc
- “s3 bucket” emulator to store elements (files attached in the chat).
- Variables for the postgres data
DATABASE_URL=postgresql://root:root_password@rdb:5432/chainlit- Variables for chainlit to use the
S3 BucketAdd the following variables to your.envso that chainlit can use them to connect to the locally deployed S3 bucket
## S3 bucket configuration.BUCKET_NAME=my-bucketAPP_AWS_ACCESS_KEY=random-keyAPP_AWS_SECRET_KEY=random-keyAPP_AWS_REGION=eu-central-1DEV_AWS_ENDPOINT=http://localstack:4566