bartlebot

Bartlebot

Bartlebot is a demonstration of an AI Agent for the legal domain with a Slack integration. It is in early development.

bartlebot

Repository

See the Bartlebot repository on GitHub.

PyPI version PyPI - Downloads Unit Tests Integration Tests License Issues GitHub stars

Quickstart (on Google Colab)

To be guided through installation, configuration, data build, message handling, and attaching to chat server Open In Colab


Quickstart (Running Locally)

Install Bartlebot

git clone git@github.com:The-AI-Alliance/bartlebot.git
python -m venv venv
. venv/bin/activate
python -m pip install .

Copy Configuration File

In the root of the repository is a default bartlebot.yml file. Peruse it to get a sense of the layout and options available.

This file can be edited in place, or copied elsewhere and then provided to the bartlebot command line interface via the --config-file parameter.

Configure Inference

Bartlebot is configured to use Llama 4 models hosted by Together.AI by default. To use inference on Together.AI, you will need to obtain and set the TOGETHER_API_KEY. New accounts come with a small amount of free credit to get started.

Any provider supported by AI Suite will work. To use another provider, change the model id strings.

Configure Knowledge Graph

Bartlebot is configured to use a Neo4j graph database. Neo4j provides free sandbox instances.

Enter your Neo4j URI in graph.neo4j_uri in bartlebot.yml

Set the values for NEO4J_USERNAME and NEO4J_PASSWORD as either environment variables or in the graph section of the configuraiton file (lower-cased).

Configure Slack App

Bartlebot is implemented as a Slack application. See the Proscenium Slack setup document. Provide the bot and app tokens in the environment varaibles SLACK_BOT_TOKEN and SLACK_APP_TOKEN, respectively.

Configure Slack Channels

The main channel for the law librarian feature is set by name in the configuration file as the key production.scenes.law_library.channel. Be sure that the Prosceinum app has been invited to that channel.

Bartlebot requires a channel to be designated as the administration channel. Configure this by setting the slack.admin_channel value in the configuration file.

Build Data Dependencies

The vectors and knowledge graph derived from case law the first time Bartlebot runs.

bartlebot build --verbose

Test Bartlebot message handling

bartlebot handle --verbose

Attach Bartlebot to the Slack App

bartlebot --verbose

Case Law Research

Bartlebot implements question-answering related to large, public-domain legal datasets including U.S. case law.

legal kg

The questions chosen highlight categories of questions where the ability to traverse a Knowledge Graph provides advantages over a naive RAG approach.

legal kg

Benchmarks

Existing legal benchmarks today are very narrow and/or do not map well to customer value.

Bartlebot will demonstrate creating and monitoring domain-specific benchmarks.

Resources

To find the Bartlebot community, see the discussions

Bartlebot is built with Proscenium (site, repo )