By default, your Chainlit app does not persist the chats and elements it generates. However, the ability to store and utilize this data can be a crucial part of your project or organization.

Once enabled, data persistence will introduce new features to your application.

Create a Chainlit Project

  1. Navigate to Chainlit Cloud and sign in.
  2. Click on the ’+’ icon to create a new project. You will see a screen similar to the one below: Project Creation Screen
  3. Click on the ‘Create API Key’ button to create a new API key.
  4. We will need this key later on. Project API Key

Activating Data Persistence

After creating a Chainlit Project and an API key for said project. You will need to pass the key via a CHAINLIT_API_KEY environment variable.

Next to your Chainlit application, create a .env file and modify it like so:

.env
CHAINLIT_API_KEY="your key"

Or inlined:

CHAINLIT_API_KEY="your key" chainlit run main.py

Once activated, your chats and elements will be persisted in Chainlit Cloud.

Deactivation

If you wish to deactivate data persistence, simply comment out or remove the CHAINLIT_API_KEY environment variable.

Data privacy & security

We prioritize your data’s privacy and security. We understand how crucial the data fed into Chainlit Cloud is for your business and handle it with utmost care.

Contact us for detailed information: contact@chainlit.io