Internals
The wire protocol, codec architecture, conversation tree structure, and transport patterns that make up AI Transport under the hood. For curious engineers and codec implementers.
The internals section covers the wire protocol, codec architecture, conversation tree structure, and transport patterns that make up AI Transport under the hood. The audience is engineers who want to understand the system before betting on it, and contributors building custom codecs.
The internals fit together as four layers, from the application-facing model down to the SDK plumbing. The conversation tree is the highest-level structure: sessions are trees of messages joined by parent and fork-of pointers. The codec architecture sits underneath, encoding domain events into Ably operations on the publish side and decoding them back into messages on the subscribe side. The wire protocol defines what those operations look like on the channel: the transport headers, lifecycle events, and message identity that travel over Ably. The transport patterns are the SDK-internal components, including the StreamRouter, the TurnManager, the pipeStream plumbing, and the cancel routing pipeline, that hold it all together.
Topics
Wire protocol
The Ably channel wire format: transport headers, lifecycle events, content messages, and message identity.
Codec architecture
How the codec bridges domain events to Ably messages. Encoder, decoder, accumulator, and lifecycle tracker internals.
Conversation tree
The branching conversation structure. Serial ordering, sibling groups, fork chains, and the flatten algorithm.
Transport patterns
Internal transport components: StreamRouter, TurnManager, pipeStream, and cancel routing.