Agents need to collaborate with humans. CRDTs give you real-time, offline-capable, conflict-free data structures. This post covers how to build a collaboration layer that both agents and humans can use.

The goal

The stack

CRDT library: Yjs

Yjs for the data layer. It gives you:

Chat: Matrix + Matrix-CRDT

Matrix for chat protocol. Matrix-CRDT bridges Yjs documents into Matrix rooms.

Kanban: Build it

No great off-the-shelf CRDT kanban exists. Build it using:

Architecture

TODO: Describe the architecture

┌─────────────────┐     ┌─────────────────┐
│  Human (browser)│     │  Agent (Temporal)│
└────────┬────────┘     └────────┬────────┘
         │                       │
         ▼                       ▼
┌─────────────────────────────────────────┐
│           Yjs Document (CRDT)           │
└─────────────────────────────────────────┘
         │
         ▼
┌─────────────────────────────────────────┐
│  WebSocket Server / y-websocket         │
└─────────────────────────────────────────┘
         │
         ▼
┌─────────────────────────────────────────┐
│  Persistence (Postgres, IndexedDB)      │
└─────────────────────────────────────────┘

Agent subscriptions

TODO: How agents subscribe to CRDT changes

The agent needs tools that let it:

Notification routing

TODO: How to route notifications

When a CRDT change happens:

  1. Determine who should be notified
  2. Determine their preferred channel (email, Slack, SMS)
  3. Send the notification

Building the kanban UI

TODO: Step-by-step guide

  1. Set up Yjs with a shared array for columns
  2. Each column has a shared array of cards
  3. Build drag-and-drop UI
  4. Connect to WebSocket provider
  5. Add persistence

Code

TODO: Include working code examples