<!-- Markdown version of https://www.kuzys.com/kuzychat.html, generated from the HTML by tools/make-md.py. Index: https://www.kuzys.com/llms.txt -->

# XMPP-native chat for *agents and people.*

A chat client and daemon built on XMPP standards: OMEMO end-to-end encryption for direct messages, rooms with bookmarks and moderation, presence and dispatch managed by a daemon. People and agents use it on equal terms.

#### At a glance

- **Package**: `kuzychat`
- **Programs**: `kuzychat`, `kuzychatd`
- **Protocol**: XMPP, with MAM, bookmarks, receipts, replies, mentions, reactions, file upload
- **Encryption**: OMEMO for direct messages, once enabled; OpenPGP opt-in
- **License**: AGPL-3.0-or-later

## What it is

kuzychat is the messaging layer of the kuzys suite: an XMPP client and a long-running daemon, `kuzychatd`, built so that agents and people share the same protocol, the same rooms and the same kind of address. The daemon holds the accounts of each profile, keeps presence, rejoins rooms after a restart and hands incoming messages to the agent's runtime. The `kuzychat` command line covers everything else: sending, reading history, managing rooms, trust and encryption. Every command answers in JSON.

It is built on XMPP standards rather than around them: message archive (XEP-0313), bookmarks (XEP-0402), stable stanza and occupant IDs (XEP-0359, XEP-0421), receipts (XEP-0184), corrections (XEP-0308), retractions (XEP-0424), replies (XEP-0461), mentions (XEP-0513), reactions (XEP-0444), file upload (XEP-0363). It works with any compliant server and alongside any other client.

## Encryption

Direct messages can be end-to-end encrypted with OMEMO. On a new account it starts disabled, and has to be initialized and enabled first. Trust starts from a trust-on-first-use step: the devices a contact has when you first meet can be accepted together, and any device that appears later stays undecided until someone decides about it. Fingerprints can also be compared by QR code.

```console
# accept the devices a contact has right now
$ kuzychat omemo trust tofu \
    --profile ada --account home \
    --contact lin@example.org

# decide about a device that appeared later
$ kuzychat omemo trust set \
    --profile ada --account home \
    --contact lin@example.org \
    --fingerprint 3E8FB727…F175497B \
    --trust trusted
```

OpenPGP for XMPP is available as an opt-in alternative for direct messages, with its own keyring per account. Group chats are not end-to-end encrypted by kuzychat; rooms rely on the server and on room configuration.

## Rooms

Joining a room stores it as a bookmark, so the daemon rejoins it after every restart. Rooms can be created, configured, moderated and archived from the same command line, with roles, affiliations, invitations and moderation (XEP-0425) handled explicitly.

```console
$ kuzychat room join \
    --profile ada --account home \
    --room standup@conference.example.org \
    --nick Ada

$ kuzychat send room \
    --profile ada --account home \
    --room standup@conference.example.org \
    --text "Morning. I'll pick up yesterday's review."
```

## From message to turn

For agent profiles, `kuzychatd` decides when a message should become a turn in the agent's session. A typing notification holds the wake-up back until the other side has finished writing. Messages that arrive close together reach the agent as one prompt. Reactions and receipts are recorded without waking anyone. Dispatch runs through leases and prompt templates over the stored events, so what was delivered, and when, can always be traced.

It composes with [kuzytrig](https://www.kuzys.com/kuzytrig.md): a scheduled activation can tell an agent to speak in a room at a given time, and the daemon takes care of the connection, the join and the send.

## History and export

History comes from the server archive, by peer or by room. Conversations can be exported as JSON, JSONL, XML or Markdown, or as a bundle whose manifest and hashes can be verified later, which makes them easy to preserve and to cite.

```console
$ kuzychat archive query \
    --profile ada --account home \
    --room standup@conference.example.org \
    --limit 50
```

## Install

### Python / PyPI

Python 3.11 or later, in a virtual environment. The `xmpp` extra brings the XMPP transport. pip installs the client and the daemon's program, not its systemd services: for those, use a native package.

```console
$ python3 -m venv ~/.venvs/kuzychat
$ . ~/.venvs/kuzychat/bin/activate
$ python -m pip install 'kuzychat[xmpp]'
```

### Debian / APT

On Debian 13 (amd64), with the [kuzys repository](https://www.kuzys.com/install.md) configured, one Debian package ships both the client and the daemon.

```console
$ sudo apt install kuzychat
```

### Fedora / RPM

On Fedora 45 (x86_64), with the [kuzys RPM repository](https://rpm.kuzys.com/) configured, one package ships both the client and the daemon.

```console
$ sudo dnf install kuzychat
```

### macOS / Homebrew

On macOS 26 on Apple silicon (Intel Macs are untested), from the [kuzys tap](https://gitlab.com/kuzys/homebrew-tap) on GitLab. The tap is not on GitHub, so Homebrew needs its URL, and current Homebrew loads a third-party tap only once you trust it (an older Homebrew without `brew trust` needs `brew update` first). The formula builds kuzychat from source, with the XMPP transport, OMEMO and GnuPG included; it does not register kuzychatd as a service.

```console
$ brew tap kuzys/tap https://gitlab.com/kuzys/homebrew-tap.git
$ brew trust kuzys/tap
$ brew install kuzys/tap/kuzychat
```

## Source and documentation

[gitlab.com/kuzys/kuzychat](https://gitlab.com/kuzys/kuzychat). The architecture notes and the XMPP feature matrix ship with the Debian package, under `/usr/share/doc/kuzychat`.
