Yoke.sh
Conversations

Conversations

Canonical message history for agent and human chats — Postgres store with stream-backed delivery.

The conversation store provides durable, queryable message history for forums (multi-party chats) and monologues (agent-internal threads). All communication still flows through the global stream for delivery; Postgres holds the canonical transcript.

Principles

PrincipleMeaning
Everything is conversationsNo kind column, no internal table, no visibility flags
Forum vs monologueProduct roles — same tables, different participant sets
Actor ≠ participantactors is identity; participants is one stint in one conversation
No inbox tableDelivery is immediate via stream append + fan-out
Agent = actor instancesAn "agent" is composed actor instances, not one monolithic loop
Opaque bodymessages.body is jsonb; runtime does not interpret content

Quick start (SDK)

import { createChatClient, conversationEvents } from "@yoke/sdk";

const chat = createChatClient(ctx.conversations);
const room = await chat.createRoom({ title: "support" });
const human = await chat.createActor({ name: "alice" });
const humanP = await chat.addMember(room.id, human.id);
await chat.send(room.id, "Hello!", { authorParticipantId: humanP.id });

Merge conversationEvents into your defineEvents() for typed stream payloads.

Stream events

EventWhen
conversation.createdNew conversation row
conversation.participant.joinedParticipant added
conversation.participant.leftleft_at set
conversation.message.postedMessage inserted
conversation.branch.createdSoft fork created

Payloads carry ids only — handlers read full content from Postgres when needed.

Agent integration

Agents use the conversation store alongside the actor mesh:

  1. Create forum (chat room) via Chat SDK
  2. createAgent → actor + egress instance
  3. joinConversation → monologue stint + ingestion + processor per join

See Agents for the full bootstrap flow.

Headless HTTP

For apps without embedded agents, use the control plane REST API on port 8090:

import { createChatHttpClient } from "@yoke/sdk";

const chat = createChatHttpClient({
  baseUrl: "http://localhost:8090",
  tenantId: "default",
});

See HTTP API.

On this page