Skip to content

Conversation

@mittulmadaan
Copy link

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

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.

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


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.

@mschristensen mschristensen force-pushed the AIT-129-AIT-Docs-release-branch branch from aebe2c1 to ea0ac8d Compare January 7, 2026 11:48
@mschristensen mschristensen added the review-app Create a Heroku review app label Jan 7, 2026
@paddybyers
Copy link
Member

This needs a rebase or a different base branch

meta_keywords: "citations, references, RAG, retrieval augmented generation, source attribution, message annotations, AI transparency, source tracking, annotation summaries, model-agnostic, LLM-neutral"
---

AI agents often draw information from external sources like documents, web pages, or databases. Citations enable users to verify information, explore sources in detail, and understand where responses came from. Ably's [message annotations](/docs/messages/annotations) provide a model-agnostic, structured way to attach source citations to AI responses without modifying the response content. It enable clients to append information to existing messages on a channel.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
AI agents often draw information from external sources like documents, web pages, or databases. Citations enable users to verify information, explore sources in detail, and understand where responses came from. Ably's [message annotations](/docs/messages/annotations) provide a model-agnostic, structured way to attach source citations to AI responses without modifying the response content. It enable clients to append information to existing messages on a channel.
AI agents often draw information from external sources such as documents, web pages, or databases. Citations to those sources enable users to verify information, explore sources in detail, and understand where responses came from. Ably's [message annotations](/docs/messages/annotations) provide a model-agnostic, structured way to attach source citations to AI responses without modifying the response content. It enable clients to append information to existing messages on a channel.


## Setup <a id="setup"/>

Message annotations require the "Message annotations, updates, and deletes" [channel rule](/docs/channels#rules) enabled for your channel or [namespace](/docs/channels#namespaces). This rule automatically enables message persistence.
Copy link
Member

Choose a reason for hiding this comment

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

and appends

3. **Aggregate summaries**: Ably automatically aggregates annotations and generates summaries showing total counts and groupings (e.g., by domain)
4. **Subscribe citations**: Clients receive citation summaries automatically and can optionally subscribe to individual annotation events for detailed citation data

Annotations are associated with a message's serial identifier. This works with:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Annotations are associated with a message's serial identifier. This works with:
Annotations are associated with a message's `serial` identifier. This works with:


### Citation payload <a id="citation-payload"/>

Each citation is carried in the Ably annotation `data` field and should include:
Copy link
Member

Choose a reason for hiding this comment

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

Are we proposing this as definitive structure, or is this just a suggestion?

Copy link
Author

Choose a reason for hiding this comment

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

This is just a suggestion and not a definitive structure. I've updated the wording to reflect that, happy to get your thoughts.

- `startOffset`: Character position in response where citation applies (optional)
- `endOffset`: End character position for citation range (optional)
- `snippet`: Short excerpt from the source (optional)
- `sourceId`: Stable identifier for deduplication (optional)
Copy link
Member

Choose a reason for hiding this comment

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

It's unclear what the purpose of this is

Copy link
Author

Choose a reason for hiding this comment

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

I've reframed this to state the intent and why for each field, happy to get your thoughts.


## Publishing citations from agents <a id="publishing"/>

After publishing the response (or during streaming, if citations are available), publish citation annotations referencing the message serial. For incremental streaming using message appends, see [message-per-response](/docs/ai-transport/message-per-response).
Copy link
Member

Choose a reason for hiding this comment

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

I can't parse this sentence. And I don't understand the purpose of this paragraph

Copy link
Author

Choose a reason for hiding this comment

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

Agree, I have reframed it now, happy to get your thoughts.


- `action`: Always `"annotation.create"` for new annotations
- `type`: The annotation type (`citations:multiple.v1`)
- `messageSerial`: The serial of the message this citation is attached to
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- `messageSerial`: The serial of the message this citation is attached to
- `messageSerial`: The `serial` of the message this citation is attached to

**Key fields in raw annotations:**

- `action`: Always `"annotation.create"` for new annotations
- `type`: The annotation type (`citations:multiple.v1`)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- `type`: The annotation type (`citations:multiple.v1`)
- `type`: The annotation `type` (`citations:multiple.v1`)

- **Individual events**: Each citation arrives as a separate Ably event

<Aside data-type="note">
Use summary view by default for efficient rendering and subscribe to raw annotations only when users need detailed citation information. This minimizes overhead while providing full transparency when required.
Copy link
Member

Choose a reason for hiding this comment

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

Should there be a mention of obtaining annotation details via the REST API instead of realtime subscription?

Copy link
Author

Choose a reason for hiding this comment

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

Good point, thanks for spotting this. I've added the details with a link to the REST API

@mittulmadaan mittulmadaan force-pushed the AIT-133-feature-documention-citations branch from a1346cc to 64bfda3 Compare January 13, 2026 13:56
@mittulmadaan
Copy link
Author

@paddybyers - thanks for reviewing this, I’ve addressed all the comments. Could you take another look when you have a moment?

@mschristensen mschristensen added review-app Create a Heroku review app and removed review-app Create a Heroku review app labels Jan 13, 2026
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.

6 participants