Concepts
Core Yoke concepts — stream, actors, portals, instances, filters, and durability.
Yoke is an always-on, event-driven multi-actor runtime you embed in your own product. The kernel is Rust; the internal actor package is TypeScript running in an embedded Deno worker. End users talk to your server, not to Yoke.
This section explains the mental model behind the runtime — how pieces fit together before you dive into SDK APIs or the embed API.
Mental model
Stream spine, no targets, definitions vs instances.
Events & stream
Append-only global log, event shape, correlation.
Actors
Reactive processors with queues and durable state.
Portals
Ingress, egress, HTTP routes, start loops.
Instances
Dynamic runtime objects created from definitions.
Durability
What survives restart and when writes persist.
Three primitives
Everything in Yoke reduces to three building blocks:
EXTERNAL WORLD
│
┌───────────┴───────────┐
│ PORTALS │
│ routes · start() │
└───────────┬───────────┘
append │
▼
┌───────────────────────┐
│ GLOBAL STREAM │
│ (Postgres, sequenced) │
└───────────┬───────────┘
async fan-out
┌───────────────┼───────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Actor │ │ Actor │ │ Actor │
│ instance │ │ instance │ │ instance │
└──────────┘ └──────────┘ └──────────┘- Global stream — sequenced, append-only, durable event log
- Actors — reactive; consume events from per-instance queues
- Portals — proactive; connect to the external world
Core principles
| Principle | Meaning |
|---|---|
| Stream is the spine | All communication goes through the global event stream. No direct actor-to-actor channels. |
| No targets | Publishers emit typed events. Consumers self-select via filters. |
| No replay | The stream is history and audit, not a program to re-execute. |
| No purity enforcement | Actors are async, impure, and non-deterministic. |
| No stream read API | User code cannot read the stream directly — security boundary. |
| Definitions fixed, instances dynamic | Actor/portal types are registered at build time. Instances are created at runtime. |
Yoke is not an LLM framework. An actor is any stateful async event processor — code, LLM calls, human-in-the-loop, or a combination. Multi-agent coordination emerges from actors publishing events and listening via filters.
Technology stack
| Layer | Technology | Role |
|---|---|---|
| Product host | Your Rust server (yoke-runtime) | Public API, embed the kernel |
| Internal package | TypeScript (@yoke/sdk) | Actor definitions the worker loads |
| Worker | Deno (embedded via libdeno) | Transpile, npm, IPC bridge |
| Kernel | Rust runtime | Stream, fan-out, queues, scheduler |
| Storage | Postgres 16+ | Stream, instances, queues, conversations |
| Actor state | SQLite per instance | pg_sqlite (BYTEA in Postgres) or S3 |
Recommended reading order
Embed Yoke in your product — host vs internal package.
Mental model — how to think about Yoke systems.
Events & stream — the communication backbone.
Instances — definitions become running objects.
Durability — what persists and when.