A simple Matrix bot written in Rust that uses the OpenAI API to provide conversational AI. Built using the Matrix Appservice library to support end-to-end encryption using modern application service authentication mechanisms.
Conversations are tracked for direct messages with the bot. In group chats the bot only reply when explicitely mentioned and does not track context.
Note: Arguably this is server-to-appservice encryption. After all, the prompts still get sent to OpenAI just using TLS. But the storage of your conversations is encrypted!
This bot is under development. Expect additional features, documentation and cleanup in the future.
Use example.yaml as a template.
The easiest way to create this is using the docker image:
docker run -v /path/to/config.yaml:/data/config.yaml ghcr.io/bleumink/matrix-openai-bot:latest generateWhen creating the registration file manually, be sure to include the following flags in order to opt-in to the required functionality:
de.sorunome.msc2409.push_ephemeral: true
org.matrix.msc3202: true
io.element.msc4190: trueEdit your Synapse homeserver configuration to register the appservice and opt-in to several experimental features. This is using the cutting edge after all.
app_service_config_files:
- /path/to/registration.yaml
experimental_features:
msc4190_enabled: true
msc3202_device_masquerading: true
msc2409_to_device_messages_enabled: true
msc3202_transaction_extensions: trueThis can be done using Docker:
docker run -v /path/to/config.yaml:/data/config.yaml ghcr.io/bleumink/matrix-openai-bot:latestOr compiling from source:
git clone https://github.com/bleumink/matrix-openai-bot.git
cd matrix-openai-bot
cargo build --release
./target/release/matrix-openai-bot run --config /path/to/config.yamlThis project is dual-licensed under the terms of the GNU Affero General Public License v3.0 (AGPL-3.0) for open source use, and a separate commercial license for proprietary or government use. Contact info@spacebased.nl for commercial licensing.