You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/docs/guides/chat/build-task-oriented.mdx
+33-37Lines changed: 33 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ meta_keywords: "task-oriented chat, 1:1 chat, small group chat, realtime messagi
6
6
7
7
Ably Chat is purpose-built for task-oriented chat experiences, from 1:1 conversations to small group interactions that enhance specific activities and workflows.
8
8
9
-
> If you need to deliver seamless, contextual chat experiences that enhance tasks like support tickets, deliveries, gaming sessions, collaborative work, or transactional processes, without sacrificing performance, reliability, or costs, then Ably is the proven choice.
9
+
If you need to deliver seamless, contextual chat experiences that enhance tasks like support tickets, deliveries, gaming sessions, collaborative work, or transactional processes, without sacrificing performance, reliability, or costs, then Ably is the proven choice.
10
10
11
11
Building with Ably means that you no longer need to worry about managing websocket servers, handling failover, network disruptions, or keeping latency low. Ably handles all of this for you, leaving you free to focus on creating engaging task-oriented experiences.
12
12
@@ -46,26 +46,25 @@ For large-scale chat scenarios with many users per room, see our [building lives
46
46
47
47
Each room includes all task participants: customers and agents in support, buyers and sellers in marketplaces, players in games, team members in projects. Participants can join and leave as the task evolves. Access to message history and other features can be granted to all or select participants via capabilities.
48
48
49
-
## Message throughput and rate management
49
+
Key considerations for task-oriented chat rooms:
50
+
- When will the room be joined by participants and how will it be linked to the task (delivery, support ticket, game session and so on)?
51
+
- For something like support, you could create a ticket when the user opens the chat window in the UI and perhaps provides a name or category for the request. First create a support ticket, and also deliver a token for authentication and room name for the user to join.
52
+
- For games it can be one room per game session (such as a chess game), or for a MMORPG, each quest or location could be allocated a room.
53
+
- For deliveries, appointments, calls, there is usually a clear 1:1 mapping of task to room, and typically users join the room when they join the task.
54
+
- Does the room have to be active for the whole duration of the task, or just sometimes?
55
+
- Only attaching to rooms when they are needed is more cost-effective and saves resources.
56
+
- For example, during a delivery, the chat room doesn't always have to be active. With a good strategy for push notifications to alert inactive users of new messages, they can attach for very short periods of time for each delivery.
57
+
- Do you need any spam prevention measures applied before allowing users to join rooms?
58
+
- For example, in a support chat scenario, you could add a captcha or other measures before creating a new ticket and issuing a token that allows the user to join the room for that ticket.
59
+
- Do you need long-term archiving of the chat history?
60
+
- Check out the guide for [exporting chat data](/docs/guides/chat/export-chat) for an overview of your options.
50
61
51
-
In task-oriented chat, each room is typically low throughput. Scaling comes by running as many rooms as you need at the same time. Ably handles everything from 1:1 conversations and small group discussions to [livestream chats](/docs/guides/chat/build-livestream) with the same reliability and scalability guarantees.
52
-
53
-
Chat rooms scale horizontally. Ably allows you to have as many rooms as you need running in parallel.
54
-
55
-
***Proven at scale:** Ably delivers over 500 million messages per day for customers.
56
-
***Rate limiting:** Prevent spam and maintain conversation quality with global or per-user throttling appropriate for your use case.
57
62
58
63
## Authentication
59
64
60
65
Authentication is a design decision.
61
66
62
-
In some cases, you'll want to tie participants to their identity in your application.
63
-
In others, anyone can join and participate.
64
-
Ably Chat supports both of these scenarios - you don't need to go through the hassle of setting up
65
-
users in Ably and trying to keep them in sync with your application. Every client has a `clientId`.
66
-
If you want to allow random users, just use a random string. If you want to tie it to your application,
67
-
then use the ID of the user or some other well-known identifier. Just make sure you can tell them apart if
68
-
you allow both at the same time, for example by using distinct prefixes.
67
+
In some cases, you'll want to tie participants to their identity in your application. In others, anyone can join and participate. Ably Chat supports both of these scenarios - you don't need to go through the hassle of setting up users in Ably and trying to keep them in sync with your application. Every client has a `clientId`. If you want to allow random users, just use a random string. If you want to tie it to your application, then use the ID of the user or some other well-known identifier. Just make sure you can tell them apart if you allow both at the same time, for example by using distinct prefixes.
Ably supports [moderating messages](/docs/chat/moderation) both before and after publication, making it easy to integrate with AI-powered or human moderation systems.
255
263
256
264
***After-publish moderation:** Messages appear instantly, then are removed if flagged as inappropriate.
257
-
Best for most task-oriented scenarios, where immediacy often matters. It can be used to detect abusive behaviour or inappropriate content after the fact, and can also be used to remove users if necessary.
265
+
Best for most task-oriented scenarios, where immediacy often matters. It can be used to detect abusive behaviour or inappropriate content after the fact.
258
266
***Before-publish moderation:** Messages are held until approved. Use this for high-stakes tasks where every message must be vetted.
259
267
260
268
### Key moderation considerations for task-oriented chat
@@ -279,7 +287,7 @@ Best for most task-oriented scenarios, where immediacy often matters. It can be
279
287
280
288
Ably's flexible moderation system adapts to your task requirements:
281
289
282
-
***Per-room policies:** Different moderation rules for different task types or user roles.
290
+
***Per-room policies:** Different moderation rules for different task rooms.
283
291
***Fallback handling:** Configure what happens when moderation services are unavailable.
284
292
***Custom integration:** Connect your existing moderation infrastructure via webhooks, serverless functions, or message queues.
285
293
***Role-based permissions:** Give moderators special capabilities to manage conversations.
@@ -306,7 +314,7 @@ room.messages.send({text: 'Can you help me with my order?'}).then((message) => {
306
314
307
315
AI chatbots are revolutionizing the way we interact with digital platforms. Integrating AI functionality into your chat experience can provide automated contextual moderation, personalized interactions, automatically creating training material, and more.
308
316
309
-
Ably's flexible [integration capabilities](/docs/platform/integrations) make it easy to connect your chat system with AI services. Through Ably's integrations, you can automatically route messages to:
317
+
Ably's flexible [integration capabilities](/docs/chat/integrations) make it easy to connect your chat system with AI services. Through Ably's integrations, you can automatically route messages to:
310
318
311
319
* Serverless functions (AWS Lambda, Azure Functions, and others).
312
320
* Event streaming services including Kafka, SQS and Pulsar.
@@ -320,11 +328,7 @@ This enables powerful AI features like:
320
328
* Chat summarization and key point extraction.
321
329
* Automatically adding contextual information for your agents to help them be more effective.
322
330
323
-
For example, you could set up an integration that sends all messages from each chat room to an AI service for sentiment analysis,
324
-
which then automatically flags detected negative customer sentiments for review, to ensure they are handled appropriately, which
325
-
could increase overall customer satisfaction.
326
-
Or route messages to a language model to generate contextual responses to common questions, or to pull relevant information
327
-
for your agent to increase their effectiveness in handling support queries.
331
+
For example, you could set up an integration that sends all messages from each chat room to an AI service for sentiment analysis, which then automatically flags detected negative customer sentiments for review, to ensure they are handled appropriately, which could increase overall customer satisfaction. Or route messages to a language model to generate contextual responses to common questions, or to pull relevant information for your agent to increase their effectiveness in handling support queries.
Network disruption happens - mobile internet loses signal or someone drives through a tunnel. All of Ably's SDKs are designed with this in mind, so that you don't have to handle complicated reconnection logic.
348
352
349
-
Every SDK instance keeps track of where it's at in the message stream. If the connection is lost, the library will
350
-
[automatically attempt to reconnect](/docs/platform/architecture/connection-recovery) to the servers and in
351
-
doing so, resume its position in the stream. This enables the chat to continue as if the user never left.
352
-
After extended periods of disconnection, the client can make use of [history](#history) to backfill missing messages.
353
+
Every SDK instance keeps track of where it's at in the message stream. If the connection is lost, the library will [automatically attempt to reconnect](/docs/platform/architecture/connection-recovery) to the servers and in doing so, resume its position in the stream. This enables the chat to continue as if the user never left. After extended periods of disconnection, the client can make use of [history](#history) to backfill missing messages.
353
354
354
-
It's incredibly rare, but sometimes a client might lose connection to a particular data center. Ably operates in multiple data centers around
355
-
the world with multiple fallback regions available. If a client can't reach the nearest data center, it will try the next one until the
356
-
connection is re-established, ensuring minimal downtime and that network issues don't disrupt the experience that you are trying to build.
357
-
Ably's [fault tolerance guide](/docs/platform/architecture/fault-tolerance) describes how we do this and that, even if an entire region
358
-
goes down, it has little-to-no impact on the global service and your application.
355
+
It's incredibly rare, but sometimes a client might lose connection to a particular data center. Ably operates in multiple data centers around the world with multiple fallback regions available. If a client can't reach the nearest data center, it will try the next one until the connection is re-established, ensuring minimal downtime and that network issues don't disrupt the experience that you are trying to build. Ably's [fault tolerance guide](/docs/platform/architecture/fault-tolerance) describes how we do this and shows that even if an entire region goes down, it has little-to-no impact on the global service and your application.
359
356
360
357
## Priced for task-oriented efficiency
361
358
@@ -400,10 +397,9 @@ Before you go live with your task-oriented chat, review these key points:
400
397
401
398
***Authentication strategy:** Ensure you're using token authentication for all client-side communication with appropriate JWT expiration times for your task duration.
402
399
***Permission model:** Apply the principle of least privilege - participants should only have access to their specific task rooms and relevant capabilities.
403
-
***Performance tuning:** Validate your message rate and batching configuration based on your typical task conversation patterns.
404
400
***Monitoring setup:** Monitor task room activity, message delivery success rates, and connection stability across your user base.
405
-
***Scale planning:** Confirm you are on the right Ably package for your expected task volume and user concurrency.
406
-
***Error handling:** Implement proper error handling for network disruptions and ensure graceful degradation when tasks are interrupted.
401
+
***Scale planning:** Confirm you are on the right Ably package for your expected volume.
402
+
***Error handling:** Implement proper error handling for network disruptions and ensure graceful degradation when network connections are interrupted.
407
403
***Data retention:** Verify your message history retention policy aligns with your task lifecycle and any compliance requirements.
408
404
***Integration testing:** Test all third-party integrations (AI services, moderation, external APIs) under realistic task scenarios.
409
405
@@ -412,7 +408,7 @@ Before you go live with your task-oriented chat, review these key points:
412
408
***Explore Ably Chat:** Dive into the [Ably Chat documentation](/docs/chat) for comprehensive API details and advanced features.
413
409
***Try the examples:** Play around with [task-oriented chat examples](/examples?product=chat) to see real implementations.
414
410
***Get started quickly:** Follow the [JavaScript/TypeScript](/docs/chat/getting-started/javascript) or [React](/docs/chat/getting-started/react) getting started guides.
415
-
***Add intelligence:** Learn how to integrate [AI assistance](/docs/platform/integrations) for smarter task experiences.
411
+
***Add intelligence:** Learn how to integrate [AI assistance](/docs/chat/integrations) for smarter task experiences.
416
412
***Secure your chats:** Understand [token authentication](/docs/auth/token#jwt) for production-ready security.
417
413
***Moderate effectively:** Implement [chat moderation](/docs/chat/moderation) tailored to your task scenarios.
418
414
***Scale with confidence:** Explore [server-side batching](/docs/messages/batch#server-side) for optimal performance.
0 commit comments