Add external data processing and storage section#3033
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
81034ca to
141f0a2
Compare
a491a26 to
6b0ffcc
Compare
6b0ffcc to
2be4b41
Compare
| @@ -0,0 +1,552 @@ | |||
| --- | |||
| title: "Extract messages via integrations" | |||
There was a problem hiding this comment.
We do already have https://ably.com/docs/guides/chat/export-chat - is this intended to replace that?
There was a problem hiding this comment.
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"/> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Does this add any value to the narrative? It's very abstract and is fairly obvious
| ``` | ||
| </Code> | ||
|
|
||
| ## Using queues <a id="queues"/> |
There was a problem hiding this comment.
Would bump below streaming
| await room.messages.send({ | ||
| text: responseText | ||
| }, { | ||
| extras: { |
There was a problem hiding this comment.
This approach doesn't work with Chat - metadata goes into data and headers go specifically into extras.headers
There was a problem hiding this comment.
(Something we should think about addressing)
There was a problem hiding this comment.
Removed for now till we decide how to handle this
| await room.messages.send({ | ||
| text: "Hello!", | ||
| metadata: { | ||
| intent: 'translate', |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"/> |
There was a problem hiding this comment.
Some of these sections feel like repeating the above?
2be4b41 to
dcfe862
Compare
m-hulbert
left a comment
There was a problem hiding this comment.
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"/> |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Should we include moderation here given we have a dedicated section on it?
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
This is useful info about extracting reaction counts that we don't cover in the extraction page.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
"your own data storage" or "your own data store"?
There was a problem hiding this comment.
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"/> |
There was a problem hiding this comment.
This page is a lot of bullet points that asks a lot of questions that we don't answer or offer any suggestions for.
There was a problem hiding this comment.
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:** |
There was a problem hiding this comment.
We've had this as a header in other pages - but I wonder if we should offer less text for the less recommended approaches?
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Looks like a lot of comments but this is 99% just suggestions for removing unnecessary links and including them within text 🙂
src/pages/docs/chat/external-storage-and-processing/data-extraction.mdx
Outdated
Show resolved
Hide resolved
src/pages/docs/chat/external-storage-and-processing/data-extraction.mdx
Outdated
Show resolved
Hide resolved
src/pages/docs/chat/external-storage-and-processing/data-extraction.mdx
Outdated
Show resolved
Hide resolved
src/pages/docs/chat/external-storage-and-processing/data-processing.mdx
Outdated
Show resolved
Hide resolved
src/pages/docs/chat/external-storage-and-processing/data-processing.mdx
Outdated
Show resolved
Hide resolved
src/pages/docs/chat/external-storage-and-processing/data-processing.mdx
Outdated
Show resolved
Hide resolved
src/pages/docs/chat/external-storage-and-processing/data-storage.mdx
Outdated
Show resolved
Hide resolved
|
|
||
| #### 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. |
There was a problem hiding this comment.
I'd actually suggest removing the "decision" terminology from here and the headings below and just make them open questions.
…n and rename the page.
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
987997f to
f63e940
Compare
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