> ## Documentation Index
> Fetch the complete documentation index at: https://docs.augustin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Matrix & Discord Bridge

Synapse homeserver with Element Web client and mautrix-discord bridge. Discord servers are bridged into Matrix so AI agents can search and monitor channel content.

## Access

* Element Web: `https://element.augustin.ai`
* Synapse: `https://synapse.augustin.ai`
* Homeserver domain: `augustin.ai`
* Admin user: `@augustin:augustin.ai`
* Bridge bot: `@discordbot:augustin.ai`

## Services

All run on i3 via `/home/user/apps/matrix/compose.yaml`:

| Container       | Purpose                                              |
| --------------- | ---------------------------------------------------- |
| synapse         | Matrix homeserver                                    |
| matrix-db       | PostgreSQL (databases: `synapse`, `mautrix_discord`) |
| element         | Element Web client                                   |
| mautrix-discord | Discord bridge                                       |

## Discord Bridge Hierarchy

The bridge maps Discord's structure into Matrix spaces and rooms:

```
Discord (concept)          →  Matrix (concept)
─────────────────              ─────────────────
Top-level container        →  "Discord" space
  Guild (server)           →  Space (child of Discord space)
    Category               →  Sub-space (child of guild space)
      Channel              →  Room (child of category sub-space)
  Direct Messages          →  "Direct Messages" space
    DM conversation        →  Room
```

Example for the Chaptarr guild:

* **Discord** (space)
  * **Chaptarr** (space)
    * **〔 Text Channels 💬〕** (sub-space)
      * \#💬｜general-chat (room)
      * \#📖｜book-worms (room)
      * ...
    * **〔 Server Information ℹ️〕** (sub-space)
      * \#📑｜rules (room)
      * ...
    * **〔 Sponsors🪙〕** (sub-space, empty)
    * ...

Key points:

* Spaces can contain other spaces — that's how guild → category nesting works
* Only the leaf-level rooms have actual messages
* Empty sub-spaces mean the Discord category has no channels you can access
* The bridge bot (`@discordbot`) owns the spaces and rooms with power level 50

## Bridge Management

The bridge bot management room is a DM with `@discordbot:augustin.ai`. Commands:

| Command                                      | Purpose                             |
| -------------------------------------------- | ----------------------------------- |
| `!discord guilds status`                     | List all guilds and bridging status |
| `!discord guilds bridge <guild_id> --entire` | Bridge all channels in a guild      |
| `!discord guilds unbridge <guild_id>`        | Remove a guild bridge               |
| `!discord bridge <channel_id>`               | Bridge a single channel             |

## Configuration

| File                                | Purpose                                       |
| ----------------------------------- | --------------------------------------------- |
| `compose.yaml`                      | All services + Traefik labels                 |
| `homeserver.yaml`                   | Synapse config (gitignored)                   |
| `element-config.json`               | Element Web client config                     |
| `mautrix-discord/config.yaml`       | Bridge config (gitignored, owned by UID 1337) |
| `mautrix-discord/registration.yaml` | Appservice registration (gitignored)          |

## Backfill Settings

Configured for aggressive backfill (in `mautrix-discord/config.yaml`):

* Max initial channel messages: 1000
* Max initial DM/thread messages: 500
* Max missed messages: unlimited (-1)

## Bridged Guilds

All guilds from the logged-in Discord account are bridged with `--entire`:
Chaptarr, Techno Tim, Palia, Latent Space, Hardcover, The Corner, Kindle Modding Community, TechStudyDiscord, BreaTheBook 3, Oasiz, Milq.ai.
