Conversational Channels
|
This content was generated with the assistance of AI and should be verified against the official documentation of each tool and framework before being relied on in production. This section’s bibliography lists the reference material consulted while preparing these pages. |
This sub-section was written on 2026-10-01 against LangChain 1.4.3 (with langchain-core 1.6.6 and langgraph 1.2.12)
and FastAPI 0.142.2 on Python 3.12, Spring AI 2.0.1 on Spring Boot 4.1.1 with Java 21, the AI SDK UI Message Stream
protocol (ai 7.x, @ai-sdk/react 4.x), AG-UI 1.0, Teams SDK 2.1.x, the Microsoft 365 Agents SDK 1.x, Slack Bolt for
Python 1.30.0, python-telegram-bot 22.8 and Smack 4.5.0; the full list is in the version baseline
below. Versions were read from PyPI, npm, Maven Central and GitHub releases on that date. The code on the pages is
illustrative: it is written from the official documentation of each platform and is not compiled by this repository, and
each page says in its lead paragraph what was and was not checked. Platform policies change often, so every policy
statement on these pages carries the date it was read.
A retrieval-augmented assistant that only answers in a demo UI is not yet a product: people ask questions where they already work, in a browser tab, in Teams, in WhatsApp or in a terminal-adjacent chat protocol. The RAG Systems in Production sub-section builds the assistant and serves it as a REST, SSE and WebSocket API. This sub-section takes the next step: it puts that same assistant behind many channels without rewriting it for each of them.
The idea: one core, many adapters
Every page uses the same running scenario, DocsAssistant, which answers questions about this site’s documentation. Its core exposes one channel-agnostic operation:
ask(conversationId, userId, text) -> stream of { token | citation | done }
The core is implemented twice, exactly as in the RAG Systems sub-section: in Python with LangChain create_agent, a
retriever tool, a Postgres checkpointer and FastAPI, and in Java with the Spring AI ChatClient, the RAG advisor, JDBC
chat memory and Spring Boot. A channel adapter sits in front of the core and has three jobs: map the channel’s user
and thread identifiers to userId and conversationId (which drives memory and access control), map the core’s token
stream to what the channel can actually do (native streaming, message edits, a typing indicator or whole messages), and
render citations in the channel’s native idiom (links, cards or buttons).
The channel landscape
Your own surfaces are the ones you control end to end. A streaming HTTP or WebSocket API is the base that everything else can reuse; the AI SDK UI Message Stream and AG-UI protocols standardise what flows over it so that off-the-shelf UI libraries can render it; ready-made UIs such as assistant-ui, Chainlit, Open WebUI and LibreChat can sit on top, or you can embed a small widget in a web page. WebRTC data channels and XMPP are the two non-HTTP options: the first earns its place mainly when a media connection already exists, the second when you need a federated, self-hostable chat protocol.
Business channels are surfaces owned by someone else, so the platform dictates the rules: registration or approval, message formats, windows during which you may reply, and what an AI assistant is allowed to do. Microsoft Teams is the natural channel for employees of a Microsoft 365 organisation, WhatsApp and Apple Messages for Business and RCS reach customers on their own phones, and Slack, Telegram and Google Chat cover team and community chat.
Channel matrix
The table below adds what the figure cannot hold: the policy limits and where pricing is documented. Prices change too often to quote; each row links to the platform’s own pricing or terms page.
| Channel | Policy limits to know | Pricing | Page |
|---|---|---|---|
SSE, WebSocket, widget, WebRTC, XMPP |
None imposed by a platform; your own authentication, rate limits and privacy rules apply. |
Your own hosting; a TURN server and an XMPP server are extra components. |
|
Microsoft Teams |
Entra app registration, tenant admin consent and sideloading rules; Bot Framework SDKs are retired. |
Teams SDK and Azure Bot Service resources; see Azure pricing. |
|
WhatsApp Business |
A 24-hour customer-service window, template messages outside it, opt-in rules and an AI-provider clause in the Business Solution Terms. |
Per-message pricing: WhatsApp pricing. |
|
Apple Messages for Business |
Conversations start from Apple-approved entry points and go through a Messaging Service Provider. |
Set by the chosen provider. |
|
Slack, Telegram, Google Chat |
App review for public distribution (Slack), bot token and rate limits (Telegram), Workspace administration (Google Chat). |
Mostly free to build; Slack and Google Workspace plans apply. |
|
RCS Business Messaging |
Partner onboarding and carrier launch approval. |
Set by the partner and carriers. |
Reading path
Read the pages in navigation order on a first pass. Shorter paths:
A web assistant you own
-
Channel-Agnostic Architecture for the core and adapters.
Assistants for employees
Assistants for customers
Real-time and self-hosted protocols
What’s covered
Foundations
-
Channel-Agnostic Architecture — the core-plus-adapters pattern, identity and conversation-state mapping, streaming capability negotiation, citations as cards, human handoff, rate limits, idempotent webhooks, asynchronous answers and multi-tenancy.
Own channels
-
Streaming Chat APIs — SSE, WebSocket and NDJSON in FastAPI, Spring and Node, cancellation, reconnection, backpressure and proxy buffering.
-
Chat UI Protocols — the AI SDK UI Message Stream protocol and AG-UI.
-
Ready-Made Chat UIs — assistant-ui, Chainlit, Open WebUI and LibreChat compared.
-
Embedding a Web Chat Widget — a framework-free widget, React and Vue variants, accessibility, CSP and CORS.
-
WebRTC Data Channels — signalling, STUN/TURN and aiortc.
-
XMPP Bots — JIDs, servers, components, chat states, message corrections, slixmpp and Smack bots.
Business channels
-
Microsoft Teams — Teams SDK, Microsoft 365 Agents SDK, Copilot Studio and declarative agents with MCP.
-
WhatsApp Business — Cloud API, webhooks, the 24-hour window, templates and the AI-provider policy.
-
Apple Messages for Business — the MSP model and its limits.
-
Slack, Telegram & Google Chat — streaming APIs of the three platforms.
-
RCS Business Messaging — agents, onboarding and rich cards.
Operations
-
Operating Chat Channels — secrets, signatures, retries, deduplication, observability, abuse, retention, moderation, testing and cost.
Cheat sheet
-
Cheat Sheet (PDF) — a one-page A4 summary.
Voice is a separate sub-section (Voice Agents); LLMOps & Evaluation covers operating these channels in production; AI Security & Responsible AI covers threat modelling, prompt injection and governance for them.
Version baseline
Every version below was read on 2026-10-01 from PyPI, npm, Maven Central or GitHub releases, or from the platform’s own documentation. Each page repeats the subset it uses in its lead paragraph; if a page and this table ever disagree after an update, this table wins.
| Area | Versions |
|---|---|
LangChain (Python) |
|
Web layer (Python) |
FastAPI 0.142.2, whose |
Spring AI |
2.0.1 through |
Chat UI protocols |
AI SDK |
Ready-made UIs |
|
WebRTC |
|
XMPP |
|
Microsoft |
Teams SDK 2.1.x for TypeScript ( |
Meta WhatsApp Business Platform (Cloud API) documentation under |
|
Apple, Slack, Telegram, Google, RCS |
Apple Messages for Business documentation on |
Twilio |
Twilio WhatsApp sandbox, |
Where the books are out of date
None of the requester-provided books covers messaging channels; only the chapters named in the bibliography are used, and only for concepts. The differences that matter:
-
LangChain streaming. Learning LangChain (Chapter 8) describes streaming through the earlier chain and graph APIs. In LangChain 1.x agents are built with
langchain.agents.create_agentand streamed withstream_modevalues such asmessages, as described in the LangChain streaming documentation. -
Spring AI streaming. Spring AI in Action (Chapter 3) shows
stream()returning aFlux; that is still the shape, but Spring AI 2.0 on Spring Boot 4 changed the surrounding property names and advisor classes; see Streaming and Reactive. -
Teams and bots. Any text that builds Teams bots on the Bot Framework SDK is out of date: its SDK repositories are archived. The Teams SDK and the Microsoft 365 Agents SDK are the supported paths.
Bibliography
The following sources were consulted while preparing the pages of this sub-section. Every code example was written from the current official documentation of the platform it uses — never copied from a book. Every documentation page cited on the pages is listed here once. All links below were requested on 2026-10-01 and resolved, except the Microsoft Azure Bot Service overview page named in the original outline, which now answers HTTP 404; the Azure Bot Service documentation home is listed instead. Two addresses redirect: the WhatsApp Business Solution Terms address redirects to Meta’s terms for the WhatsApp Business Platform, and the Slack AI apps address redirects to the Bolt for JavaScript agent-features page.
Requester-provided books
None of these books covers messaging channels. Only the chapters named below are consulted, for concepts. Their text and code are not reproduced; concepts are paraphrased and credited on the page that uses them.
-
Albada, Ben. Building Applications with AI Agents: Designing and Implementing Multiagent Systems. O’Reilly Media, 2025. ISBN 978-1-098-17650-1. Publisher page: https://www.oreilly.com/library/view/building-applications-with/9781098176495/. Chapter 3 (agent UX across modalities, synchronous versus asynchronous experiences, proactive versus intrusive behaviour, communicating uncertainty) and Chapter 13 (escalation to humans) consulted.
-
Mendelevitch, Ofer, and Forrest Sheng Bao. Hands-On RAG for Production: Design, Develop, and Deploy Production-Ready RAG Applications. O’Reilly Media, 2026. ISBN 979-8-341-62171-8. Publisher page: https://www.oreilly.com/library/view/hands-on-rag-for/9798341621701/. Official code repository: https://github.com/ofermend/hands-on-rag. Chapter 3 (RAG UX: citations, progress, feedback) consulted.
-
Oshin, Mayo, and Nuno Campos. Learning LangChain. O’Reilly Media, 2025. ISBN 978-1-098-16728-8. Publisher page: https://www.oreilly.com/library/view/learning-langchain/9781098167271/. Official code repository: https://github.com/langchain-ai/learning-langchain. Chapter 8 (streaming intermediate output and tokens, double-texting) and Chapter 11 (chatbot UX patterns) consulted.
-
Walls, Craig. Spring AI in Action. Manning Publications, 2026. ISBN 978-1-63343-611-4. Publisher page: https://www.manning.com/books/spring-ai-in-action. Official code repository: https://github.com/habuma/spring-ai-in-action-samples. Chapter 3 (
stream()returning aFlux) consulted.
oreilly.com answers automated fetches with an HTTP 403 response, but the publisher pages above are live pages when
opened in a browser.
Official documentation
Web platform
-
MDN, Server-sent events: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events
-
MDN, WebSockets API: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
-
MDN, RTCDataChannel: https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel
-
MDN, Signaling and video calling: https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling
-
WebRTC samples: https://github.com/webrtc/samples
Streaming back-ends
-
FastAPI, Server-Sent Events: https://fastapi.tiangolo.com/tutorial/server-sent-events/
-
FastAPI, WebSockets: https://fastapi.tiangolo.com/advanced/websockets/
-
Spring AI, ChatClient API: https://docs.spring.io/spring-ai/reference/api/chatclient.html
-
LangChain, Streaming: https://docs.langchain.com/oss/python/langchain/streaming
UI protocols and ready-made UIs
-
AI SDK, Stream protocol: https://ai-sdk.dev/docs/ai-sdk-ui/stream-protocol
-
AG-UI: https://docs.ag-ui.com/introduction and https://docs.ag-ui.com/spec/1.0
-
assistant-ui: https://www.assistant-ui.com/
-
Open WebUI: https://docs.openwebui.com/
-
LibreChat: https://www.librechat.ai/docs
XMPP
-
The XMPP Extension Protocols index (XEP-0045, XEP-0085, XEP-0114, XEP-0308, XEP-0313): https://xmpp.org/extensions/
-
ejabberd: https://docs.ejabberd.im/
-
Prosody: https://prosody.im/doc
-
xmpp.js: https://github.com/xmppjs/xmpp.js
Microsoft
-
Azure Bot Service: https://learn.microsoft.com/en-us/azure/bot-service/
-
Microsoft 365 Agents SDK: https://learn.microsoft.com/en-us/microsoft-365/agents-sdk/agents-sdk-overview
-
Microsoft 365 Agents SDK samples: https://github.com/microsoft/Agents
-
Teams SDK: https://microsoft.github.io/teams-sdk/welcome/ and https://learn.microsoft.com/en-us/microsoftteams/platform/teams-sdk/
-
Teams SDK versus Agents SDK: https://learn.microsoft.com/en-us/microsoftteams/platform/teams-sdk/teams/sdk-comparison
-
Microsoft 365 Agents Toolkit: https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/agents-toolkit-fundamentals
-
Copilot Studio: https://learn.microsoft.com/en-us/microsoft-copilot-studio/
-
Adding an existing MCP server to Copilot Studio: https://learn.microsoft.com/en-us/microsoft-copilot-studio/mcp-add-existing-server-to-agent
-
Microsoft 365 Copilot plugins: https://learn.microsoft.com/en-us/microsoft-365/copilot/extensibility/overview-plugins
-
Microsoft 365 Copilot MCP plugins: https://learn.microsoft.com/en-us/microsoft-365/copilot/extensibility/build-mcp-plugins
-
Getting started: https://developers.facebook.com/documentation/business-messaging/whatsapp/get-started
-
Webhooks overview: https://developers.facebook.com/documentation/business-messaging/whatsapp/webhooks/overview/
-
Sending messages: https://developers.facebook.com/documentation/business-messaging/whatsapp/messages/send-messages
-
Templates: https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/overview
-
Pricing: https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing
-
Business Solution Terms: https://www.whatsapp.com/legal/business-solution-terms
-
Twilio WhatsApp: https://www.twilio.com/docs/whatsapp
Apple, Slack, Telegram, Google and RCS
-
Apple Messages for Business, end-to-end guide: https://register.apple.com/resources/messages/messaging-documentation/end-to-end
-
Apple Messages for Business, MSP onboarding: https://register.apple.com/resources/messages/msp-onboarding/
-
Slack, AI apps with Bolt for JavaScript: https://docs.slack.dev/tools/bolt-js/concepts/ai-apps
-
Telegram Bot API: https://core.telegram.org/bots/api and its changelog: https://core.telegram.org/bots/api-changelog
-
Google Chat: https://developers.google.com/workspace/chat
-
Google Chat ADK agent quickstart: https://developers.google.com/workspace/add-ons/chat/quickstart-adk-agent
-
RCS Business Messaging: https://developers.google.com/business-communications/rcs-business-messaging
Specifications and standards
-
RFC 6120, Extensible Messaging and Presence Protocol (XMPP): Core: https://datatracker.ietf.org/doc/html/rfc6120
-
RFC 6121, XMPP: Instant Messaging and Presence: https://datatracker.ietf.org/doc/html/rfc6121
-
W3C, WebRTC 1.0: Real-Time Communication Between Browsers: https://www.w3.org/TR/webrtc/
Papers and engineering articles
This sub-section is about integration surfaces and cites no research papers; the papers behind the underlying RAG assistant are listed in the RAG Systems in Production bibliography.
The requester-provided books are consulted references, not the primary source of any example on these pages. On any discrepancy between a book and the official documentation of a tool or framework, the official documentation is authoritative. No book PDF is committed or attached anywhere in this repository.
References
-
RAG Systems in Production — the assistant these channels expose.
-
Serving RAG as an API — the REST, SSE and WebSocket API this sub-section builds on.
-
Exposing RAG through MCP — the DocsAssistant MCP server used by Copilot Studio.