Skip to content

Comments

Add external data processing and storage section#3033

Merged
splindsay-92 merged 53 commits intomainfrom
chat/external-data-processing
Feb 20, 2026
Merged

Add external data processing and storage section#3033
splindsay-92 merged 53 commits intomainfrom
chat/external-data-processing

Conversation

@splindsay-92
Copy link
Contributor

@splindsay-92 splindsay-92 commented Dec 15, 2025

Description

FTF-443

Originally this was just about adding a guide on data processing, but it's since expanded into a rework of the existing data-storage use-case guide into an expanded feature set under the Chat document root directory.

We now have a seperate section that deals with external storage and processing, under which data extraction, processing and storage all sit under.

Checklist

@coderabbitai
Copy link

coderabbitai bot commented Dec 15, 2025

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.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chat/external-data-processing

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.

@splindsay-92 splindsay-92 force-pushed the chat/external-data-processing branch 4 times, most recently from 81034ca to 141f0a2 Compare December 18, 2025 21:26
@m-hulbert m-hulbert added the review-app Create a Heroku review app label Dec 19, 2025
@ably-ci ably-ci temporarily deployed to ably-docs-chat-external-czhado December 19, 2025 11:43 Inactive
@splindsay-92 splindsay-92 requested a review from m-hulbert January 5, 2026 11:01
@splindsay-92 splindsay-92 force-pushed the chat/external-data-processing branch from a491a26 to 6b0ffcc Compare January 5, 2026 18:38
@splindsay-92 splindsay-92 requested a review from AndyTWF January 13, 2026 13:37
@splindsay-92 splindsay-92 force-pushed the chat/external-data-processing branch from 6b0ffcc to 2be4b41 Compare January 21, 2026 13:40
@splindsay-92 splindsay-92 marked this pull request as ready for review January 21, 2026 13:40
@splindsay-92 splindsay-92 changed the title Add external data processing guide Add external data processing and storage section Jan 22, 2026
@AndyTWF AndyTWF added review-app Create a Heroku review app and removed review-app Create a Heroku review app labels Jan 22, 2026
@ably-ci ably-ci temporarily deployed to ably-docs-chat-external-vfcvkb January 22, 2026 10:20 Inactive
@@ -0,0 +1,552 @@
---
title: "Extract messages via integrations"
Copy link
Contributor

Choose a reason for hiding this comment

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

We do already have https://ably.com/docs/guides/chat/export-chat - is this intended to replace that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, off the back of conversations with Mark, it seemed this was less a use-case guide and more a how-to feature. I'll remove the file now as the information is contained in the new pages :)

```
</Code>

## Understanding channel names and room names <a id="channel-names"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there's benefit here of encouraging users to group their chat rooms under a common namespace for simplicity, e.g gamechat:<room>

### Example webhook handler

<Code>
```javascript
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this add any value to the narrative? It's very abstract and is fairly obvious

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

```
</Code>

## Using queues <a id="queues"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Would bump below streaming

await room.messages.send({
text: responseText
}, {
extras: {
Copy link
Contributor

Choose a reason for hiding this comment

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

This approach doesn't work with Chat - metadata goes into data and headers go specifically into extras.headers

Copy link
Contributor

Choose a reason for hiding this comment

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

(Something we should think about addressing)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed for now till we decide how to handle this

await room.messages.send({
text: "Hello!",
metadata: {
intent: 'translate',
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this decision be a client-side one, or something that the server would decide? If it's client side then you're up for spoofing.

Also for translation specifically on-device translation is something we'd consider

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've switched the example to focus more on something like a notification for now

- **Consistency**: Webhook calls that fail will lead to inconsistencies between your data storage and Ably, which can be difficult to resolve. Detect if this happens using the `[meta]log` channel and use the [history endpoint](#history-endpoint) to backfill missing data.
- **[At-least-once delivery](/docs/platform/architecture/idempotency#protocol-support-for-exactly-once-delivery)**: You need to handle duplicate messages. Deduplication can be done by checking `serial` and `version.serial`.

## Using outbound streaming <a id="outbound-streaming"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Some of these sections feel like repeating the above?

@splindsay-92 splindsay-92 force-pushed the chat/external-data-processing branch from 2be4b41 to dcfe862 Compare February 2, 2026 18:58
@m-hulbert m-hulbert temporarily deployed to ably-docs-chat-external-ievfum February 9, 2026 16:48 Inactive
Copy link
Contributor

@m-hulbert m-hulbert left a comment

Choose a reason for hiding this comment

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

This is pretty much there - mostly minor comments throughout except for the data storage page that is a little difficult to follow.


Chat rooms are built on Ably Pub/Sub channels, allowing you to leverage the full range of Ably's [platform integrations](/docs/platform/integrations) to forward messages to external systems.

## Common use cases <a id="use-cases"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not best practice to have two headers following one another without any text if we can add some please.


### Process messages with external systems <a id="process-messages"/>

Extract and process messages through external systems, then respond back to the chat in real-time:
Copy link
Contributor

Choose a reason for hiding this comment

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

realtime throughout please.


Extract and process messages through external systems, then respond back to the chat in real-time:

* **AI-powered assistance**: Process commands through language models and respond with helpful information
Copy link
Contributor

Choose a reason for hiding this comment

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

Full stops at the end of bullet points please.


* **AI-powered assistance**: Process commands through language models and respond with helpful information
* **Real-time translation**: Automatically translate messages for multilingual chat rooms
* **Content moderation**: Filter messages through moderation services
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we include moderation here given we have a dedicated section on it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in favour of sentiment analysis 8ce1744


Each decoded message provides the following data for your processing logic. See [decoding messages](/docs/chat/external-storage-and-processing/data-extraction#decoding) for how to decode the integration envelope.

* `text` is the message content, typically user input. See [message structure](/docs/chat/rooms/messages#structure).
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be easier to read in a table.


## Handle message reactions <a id="reactions"/>

Reaction summaries arrive as messages with `action` set to `message.summary`. If your processing needs reaction data, for example analytics on popular reactions or triggering actions when a message reaches a reaction threshold, extract reaction counts from the annotations payload.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is useful info about extracting reaction counts that we don't cover in the extraction page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made it clear in both now I think, so a smaller mention here as a reminder.

meta_keywords: "chat storage, data storage, data retention, compliance, analytics, message history, chat export"
---

Store chat messages from Ably Chat in your own data storage for long-term retention, compliance, analytics, or to maintain your data storage as the canonical source of truth.
Copy link
Contributor

Choose a reason for hiding this comment

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

"your own data storage" or "your own data store"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll go with data store


While Ably Chat provides flexible data retention for messages (30 days by default, up to a year on request), this page discusses options for longer-term storage and additional control over your chat data.

## What Ably Chat history gives you <a id="history-endpoint"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

This page is a lot of bullet points that asks a lot of questions that we don't answer or offer any suggestions for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've done a bit of an overhaul here, removing bullet points and at the same time trying to focus more on the typical way to do things. 085941c


This approach provides full control over the publishing flow with immediate consistency (no integration delay), the opportunity to add validation or business logic before publishing, and the ability to use the Chat REST API or SDK to publish.

**Considerations:**
Copy link
Contributor

Choose a reason for hiding this comment

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

We've had this as a header in other pages - but I wonder if we should offer less text for the less recommended approaches?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made the change, see what you think and I can always add it back in if your think we are now lacking in that area :)

@m-hulbert m-hulbert temporarily deployed to ably-docs-chat-external-ievfum February 11, 2026 09:46 Inactive
Copy link
Contributor

@m-hulbert m-hulbert left a comment

Choose a reason for hiding this comment

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

Looks like a lot of comments but this is 99% just suggestions for removing unnecessary links and including them within text 🙂


#### Data store schema design <a id="schema-design"/>

Design your schema to support the features you need while keeping scale and reliability in mind. An early decision is whether you need to store all versions of messages or just the latest version (see [Decision 1](#decision-1) below), and whether to store full message objects or normalized relational data.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd actually suggest removing the "decision" terminology from here and the headings below and just make them open questions.

@m-hulbert m-hulbert temporarily deployed to ably-docs-chat-external-ievfum February 11, 2026 14:52 Inactive
Copy link
Contributor

@m-hulbert m-hulbert left a comment

Choose a reason for hiding this comment

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

👌

@splindsay-92 splindsay-92 requested a review from AndyTWF February 16, 2026 14:47
Add redirect_from for old export-chat guide, reword intro, remove moderation bullet, and guide links into section intros.
> Change integration methods to types.
> move channel names section into filtering
> various other ordering and structural changes.
> Add code examples for order handling.
> convert message data bullet list to a table
@splindsay-92 splindsay-92 force-pushed the chat/external-data-processing branch from 987997f to f63e940 Compare February 20, 2026 10:05
@splindsay-92 splindsay-92 merged commit 24038b1 into main Feb 20, 2026
7 checks passed
@splindsay-92 splindsay-92 deleted the chat/external-data-processing branch February 20, 2026 12:46
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