Examples
Chatbot
Chatbot Example
This example demonstrates how to create a simple chatbot using Quivr and Chainlit. The chatbot allows users to upload a text file and then ask questions about its content.
Prerequisites
- Python 3.8 or higher
- Rye package manager
Installation
-
Clone the repository and navigate to the
examples/chatbot
directory. -
Install the requirements using
rye
: -
Activate the venv:
Running the Chatbot
-
Define your API key as environment variable:
-
Start the Chainlit server:
-
Open your web browser and go to
http://localhost:8000
.
Using the Chatbot
- Upload a text file (max 20MB)
- Wait for processing
- Start asking questions about the content
- The chatbot will respond based on the information in the uploaded file
How It Works
The chatbot uses Quivr to create a “brain” from the uploaded text file. This brain is then used to answer questions about the file’s content. The Chainlit library provides the user interface and handles the chat interactions.
For the complete example code, visit our GitHub repository.
Was this page helpful?