Skip to content

Add AI Transport LiveObjects docs#3423

Merged
owenpearson merged 1 commit into
mainfrom
ait-liveobjects
Jun 19, 2026
Merged

Add AI Transport LiveObjects docs#3423
owenpearson merged 1 commit into
mainfrom
ait-liveobjects

Conversation

@owenpearson

@owenpearson owenpearson commented Jun 18, 2026

Copy link
Copy Markdown
Member

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: db1f3f64-2ab6-4ec9-a8b3-942dab66a72f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ait-liveobjects

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@paddybyers

Copy link
Copy Markdown
Member

Much of this reads like Claude in smartarse mode. Can you de-claudeify the writing style?

@owenpearson owenpearson added the review-app Create a Heroku review app label Jun 19, 2026
@ably-ci ably-ci temporarily deployed to ably-docs-ait-liveobjec-d8eiea June 19, 2026 11:49 Inactive
@owenpearson owenpearson requested a review from ttypic June 19, 2026 12:39
@owenpearson owenpearson marked this pull request as ready for review June 19, 2026 12:39
import { OBJECT_MODES } from '@ably/ai-transport';
import { createAgentSession } from '@ably/ai-transport/vercel';

const session = createAgentSession({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example above used createClientSession from @ably/ai-transport. I'd prefer we stick to a single import inside one file to avoid confusion.
My preference goes to more abstract @ably/ai-transport as we do plan to introduce more codecs

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good spot, i've amended it now

@owenpearson owenpearson requested a review from VeskeR June 19, 2026 17:18
@ably-ci ably-ci temporarily deployed to ably-docs-ait-liveobjec-d8eiea June 19, 2026 17:19 Inactive
| Property | Description | Type |
| --- | --- | --- |
| presence | The Ably presence object for the session's channel. Use it to see which clients are connected — for example, to detect whether the requesting user is still online (`enter`, `leave`, `get`, `subscribe`). The session adds no semantics — it is the same instance the channel exposes — and presence operations implicitly attach, so they work without first awaiting [`connect()`](#connect). | `Ably.RealtimePresence` |
| object | The Ably LiveObjects root for the session's channel. Use it to read and write shared `LiveMap` / `LiveCounter` state on the channel the session already uses. The session adds no semantics; it is the same instance the channel exposes. Operating on it requires the client to be constructed with the `LiveObjects` plugin from `ably/liveobjects` and the object modes to be requested via [`channelModes`](#constructor-params); without both, the underlying SDK throws. See [LiveObjects State](/docs/ai-transport/features/live-objects). | `RealtimeObject` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correction: object prop is not a root for LiveObjects on the channel, it merely gives access to the LiveObjects API for a channel.

| tree | The complete conversation tree. Holds every known Run node and emits events on any change. Use `view` in most cases; reach for `tree` for low-level inspection. | <Table id='Tree'/> |
| view | The default paginated, branch-aware view for rendering. Events scope to the visible messages. | <Table id='View'/> |
| presence | The Ably presence object for the session's channel. Use it to see which clients are connected (`enter`, `leave`, `get`, `subscribe`). The session adds no semantics — it is the same instance the channel exposes — and presence operations implicitly attach, so they work without first awaiting [`connect()`](#connect). | `Ably.RealtimePresence` |
| object | The Ably LiveObjects root for the session's channel. Use it to read and write shared `LiveMap` / `LiveCounter` state on the channel the session already uses. The session adds no semantics; it is the same instance the channel exposes. Operating on it requires the client to be constructed with the `LiveObjects` plugin from `ably/liveobjects` and the object modes to be requested via [`channelModes`](#constructor-params); without both, the underlying SDK throws. See [LiveObjects State](/docs/ai-transport/features/live-objects). | `RealtimeObject` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto object is not root

<Code>
```javascript
// On the agent: react whenever the user's state changes.
const root = await session.object.get();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the docs throughout: we no longer use root term in the public facing docs.
It is simply an object on a channel.
For example, and assignment like this should read const myObject = await channel.object.get();

Generic text references instead of On the agent, resolve the root once and let it react to every change should read On the agent, resolve the object on a channel once and let it react to every change

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok didn't know that, have updated now

@ably-ci ably-ci temporarily deployed to ably-docs-ait-liveobjec-d8eiea June 19, 2026 17:32 Inactive

Shared state closes that gap. The user's current state lives on the session, the agent subscribes to it, and it reacts as the state changes instead of asking. State moves the other way too: the agent writes to the same object, and every connected client sees the update. This is what people mean by ambient state sync, the agent staying aware of what the user is doing without a round of questions. Both [`ClientSession`](/docs/ai-transport/api/javascript/core/client-session) and [`AgentSession`](/docs/ai-transport/api/javascript/core/agent-session) expose that state directly as `session.object`, the channel's Ably [LiveObjects](/docs/liveobjects) root.

Keep this to the state both sides actually need to share. The agent's private reasoning belongs on the server, and the back-and-forth of the conversation belongs in the message stream. `session.object` is the slice of state you choose to expose to the user, not a feed of everything the agent is doing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would tighten 3 paragraphs above to just a single one describing right away what LiveObjects State gives to AI gents. Skip "problem surface" from the first paragraph entirely. Reads a bit like an intro to a blog post. Other pages from "Features" don't do that, so I'd keep this aligned

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have changed this now

Comment thread src/pages/docs/ai-transport/features/live-objects.mdx Outdated
@ably-ci ably-ci temporarily deployed to ably-docs-ait-liveobjec-d8eiea June 19, 2026 17:36 Inactive
Comment thread src/data/nav/aitransport.ts Outdated
Comment thread src/pages/docs/ai-transport/api/javascript/core/agent-session.mdx Outdated
Comment thread src/pages/docs/ai-transport/api/javascript/core/agent-session.mdx Outdated
@ably-ci ably-ci temporarily deployed to ably-docs-ait-liveobjec-d8eiea June 19, 2026 17:40 Inactive
@ably-ci ably-ci temporarily deployed to ably-docs-ait-liveobjec-d8eiea June 19, 2026 17:51 Inactive
@owenpearson owenpearson enabled auto-merge June 19, 2026 17:58
@ably-ci ably-ci temporarily deployed to ably-docs-ait-liveobjec-d8eiea June 19, 2026 17:58 Inactive
@owenpearson owenpearson merged commit c0a0e39 into main Jun 19, 2026
7 checks passed
@owenpearson owenpearson deleted the ait-liveobjects branch June 19, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

4 participants