Chat SDKがユーザーにエージェントをもたらす
VercelはChat SDKを発表し、開発者が単一のコードベースで複数のチャットプラットフォーム向けにAIエージェントを構築・展開できるようにすることで、エージェントの導入障壁を大幅に低減した。
キーポイント
マルチプラットフォーム対応の必要性
企業内で作成されたAIエージェントをSlackやDiscordなど複数のプラットフォームで利用したいという需要が高まり、各プラットフォームごとのAPI統合作業が開発者の負担となっていた。
Chat SDKの解決策
TypeScriptライブラリとして提供されるChat SDKは、プラットフォーム固有のAPIの差異をアダプタ層で抽象化し、開発者が単一のコードベースで複数プラットフォーム向けのボットを構築できるようにする。
Write once, deploy everywhere
コアのチャットパッケージがイベントルーティングとアプリケーションロジックを処理し、プラットフォーム固有の動作はアダプタが担当するため、デプロイ先を変更してもハンドラを書き換える必要がない。
実用的な開発者体験
各アダプタは環境変数から資格情報を自動検出するため、追加設定なしで開発を開始でき、プラットフォーム間の移行もアダプタの交換だけで完了する。
Streaming and Formatting
Chat SDK automatically converts streaming markdown to native formatting across platforms, eliminating raw syntax display and supporting real-time rendering where available.
Cross-Platform Component Rendering
Components like tables, cards, and buttons are written once in JSX, and Chat SDK adapts them to each platform's native format, with graceful fallbacks for unsupported elements.
State Management and Scalability
Chat SDK offers pluggable state adapters for Redis, ioredis, and PostgreSQL, handling thread subscriptions, distributed locks, and key-value caching to scale bot state without requiring additional infrastructure.
影響分析・編集コメントを表示
影響分析
この発表は、AIエージェントの実用段階における重要なインフラ整備を示しており、企業内でのAIエージェント導入を加速させる可能性が高い。開発者体験を重視した設計は、エージェント開発の民主化を推進し、AI活用の裾野を広げる効果が期待される。
編集コメント
AIエージェントの実用化における「最後の一マイル」問題に焦点を当てた実用的なソリューション。開発者視点の設計思想が現場での採用を後押ししそう。
1月初旬、私たちは会社全体にひとつの課題を提示しました:あなたのアウトプットを倍増させる方法を見つけ出そう、と。
社員たちはエージェントを作り始めました。そのほとんどはチャットボットですが、実際のワークフローを強化するために目的特化型に構築された専用のエージェントであり、面倒で時間のかかる作業を自動的に行ってくれました。
当初、人々はエージェント用に個別のインターフェースを構築し、AI SDKはすぐに使えるモデル統合とUI設計を簡素化するAI Elementsによって、これを容易にしました。
その後、私たちは制約に直面しました。人々はSlack内でエージェントと対話したがり、誰もがSlackのAPIとの統合方法を考えなければならなくなったのです。
そして問題はさらに深刻化しました。エージェントがSlackに導入されると、人々はDiscord、GitHub、さらにはLinearのような課題トラッカーなど、より多くのプラットフォームと統合したくなりました。それぞれの統合が、すべてのエージェントに対して新たな挑戦をもたらしたのです。
私たちは気付きました。人々にエージェントのところへ来てもらうのではなく、エージェントを彼らが既に作業している場所へ届ける必要があるのだと。
チャットには統合の抽象化が必要
私たちは、チームがエージェントを作成することは容易にしたものの、プラットフォーム横断での採用に向けてエージェントを拡張することを、さらに容易にする必要があると気付きました。
これはあらゆる企業に当てはまります。人々は既にMicrosoft Teams、WhatsApp、Telegram、Google Chatなどを利用しており、エージェントはそれらすべての場で利用可能である必要があります。
それがまさにChat SDKの役割です:エンタープライズおよびコンシューマー向けチャットプラットフォーム全体でエージェントを利用可能にします。
AI SDKがモデルプロバイダーAPIを単一のインターフェースに統合したように、私たちはChat SDKを構築し、メッセージングAPIの独自仕様を、開発者とそのコーディングエージェントのためのシンプルなフレームワークへと抽象化しました。
開発者はもう、ストリーミングの仕組みがプラットフォーム間でどう異なるか、フォーマットや分岐ロジック、さらにはリアクション処理を個々のAPIごとにどう実装すべきかを考える必要はありません。
一度書けば、どこでもデプロイ可能
Chat SDKは、単一のコードベースからSlack、Microsoft Teams、Google Chat、Discord、Telegram、GitHub、Linearで動作するボットを構築するためのTypeScriptライブラリです。コアのチャットパッケージがイベントルーティングとアプリケーションロジックを処理します。プラットフォーム固有の動作はアダプターが処理するため、デプロイ先が変わってもハンドラーは変更する必要がありません。
基本的なボットは次のようになります:
各アダプターは環境変数から認証情報を自動検出するため、追加の設定なしですぐに始められます。SlackからDiscordに切り替えることは、アダプターを交換するだけで、ボットを書き直すことではありません。
プラットフォームの不一致は、解決済み
プラットフォームごとの動作は大きく異なり、Chat SDKは偽りの約束でそれらの違いを覆い隠すことはしません。その代わりに、アダプターレイヤーでそれらを処理するため、アプリケーションコード側で対応する必要がなくなります。
ストリーミングを例にとりましょう。Slackにはネイティブのストリーミングパスがあり、応答が到着するにつれて太字、斜体、リストなどのフォーマットをリアルタイムでレンダリングします。他のプラットフォームではフォールバックのストリーミングパスを使用し、ストリーミングされるテキストを、各アダプターのマークダウンからネイティブ形式への変換パイプラインを通じて、中間編集ごとに渡していきます。
Chat SDK以前は、これらのアダプターは生のマークダウン文字列を受け取っていたため、DiscordやTeamsのユーザーは最終メッセージが確定するまで、文字通りの 太字 構文を見ることになっていました。今ではこの変換は自動的に行われます。
テーブルのレンダリングも同じパターンに従います。Table()コンポーネントは、すべてのアダプターでテーブルをレンダリングするための構成可能なAPIを提供します。ヘッダーと行を渡せば、あとはChat SDKが処理します。SlackはBlock Kitのテーブルブロックをレンダリングします。TeamsとDiscordはGFMマークダウンのテーブルを使用します。Google Chatは等幅(モノスペース)テキストウィジェットを使用します。Telegramはテーブルをコードブロックに変換します。GitHubとLinearは既存のマークダウンパイプラインをそのまま使用します。
カード、モーダル、ボタンも同様に動作します。
JSXを使って要素を一度書くだけで、各アダプターがプラットフォームがネイティブにサポートする形式でレンダリングします。もしプラットフォームがある要素をサポートしていなければ、適切にフォールバックします。
単一プラットフォームの場合でもChat SDKが重要な理由
たとえあなたのエージェントがSlackのみを対象としている場合でも、Chat SDKは実用的な問題を解決します。チャンネル名やユーザー名は自動的に平文に変換されるため、エージェントは会話の文脈を理解できます。
この変換は双方向で機能します。エージェントが平文を使って誰かをメンション(@mention)すると、Chat SDKはその通知が実際にSlackでトリガーされることを保証します。
エージェントが効果的であるためには、完全な文脈が必要です。Chat SDKはリンクプレビューの内容、参照された投稿、画像を自動的にエージェントのプロンプトに直接含めます。さらに、モデルは標準的なマークダウンを生成しますが、Slackはそれをネイティブにはサポートしていません。
Chat SDKは標準マークダウンをSlack用の形式に自動変換します。この変換は、Slackのネイティブな追加専用(append-only)ストリーミングAPIを使用している場合でも、リアルタイムで行われます。
AIストリーミング、内蔵
post()関数はAI SDKのテキストストリームを直接受け入れるため、追加の配線なしでストリーミングLLM応答をあらゆるチャットプラットフォームに流し込むことができます:
アダプターレイヤーは、プラットフォームがサポートする場合はライブフォーマットを含め、そのストリームのプラットフォーム固有のレンダリングを処理します。
スケールする状態管理
スレッドサブスクリプション、分散ロック、キーバリューキャッシュの状態は、プラグ可能な状態アダプターを介して処理されます。Redisとioredisはリリース時から利用可能でした。PostgreSQLは本番環境対応のオプションとして新たにサポートされたため、既にPostgresを運用しているチームは、インフラにRedisを追加することなくボットの状態を永続化できます。
PostgreSQLアダプターはpg(node-postgres)と生SQLを使用し、初回接続時に必要なテーブルを自動的に作成します。TTLベースのキャッシング、複数インスタンスにわたる分散ロック、設定可能なキープレフィックスによる名前空間付き状態をサポートします。コミュニティ貢献者@baiがPR #154でその基礎を築きました。
WhatsApp、そしてその先へ
Chat SDKは現在WhatsAppをサポートしており、「一度書けば、どこでもデプロイ可能」モデルを世界最大級のメッセージングプラットフォームの一つに拡張します。
WhatsAppアダプターは、メッセージ、リアクション、自動チャンキング、既読確認、マルチメディアダウンロード(画像、音声メッセージ、ステッカー)、Google Maps URLを用いた位置情報共有をサポートします。カードは最大3つのオプションを持つインタラクティブな返信ボタンとしてレンダリングされ、必要に応じてフォーマット済みテキストにフォールバックします。
WhatsAppは24時間のメッセージングウィンドウを強制するため、ボットはその期間内にのみ応答できます。このアダプターはメッセージ履歴、編集、削除をサポートしていません。コミュニティ貢献者@ghellachがPR #102でその基礎を築きました。
はじめに
コーディングエージェントを拡張するには、Chatスキルをインストールします:
また、このスタータープロンプトを変更して使用することもできます:
Chat SDKのドキュメントは、はじめに、プラットフォームアダプターの設定、状態管理の設定、およびSlackボットとNext.js及びRedis、DiscordサポートボットとNuxt、GitHubコードレビューボットとHonoを含む一般的なパターンのガイドをカバーしています。
Chat SDKはオープンソースで、現在パブリックベータ段階です。あなたのチームが構築してきたエージェントは、単一のプラットフォームに留まる必要はありません。それらは、あなたのユーザーが実際にいる場所へと赴くことができるのです。
続きを読む
原文を表示
In early January, we gave the entire company a challenge: figure out how to multiply your output.
People created agents. Mostly chat bots, but dedicated ones, purpose-built for real workflow augmentation: the agents were doing things automatically that would otherwise be tedious and time consuming.
Initially people built individual interfaces for their agents, and AI SDK made that easy with out-of-the box model integrations and AI Elements to simplify UI design.
Then we hit a constraint. People wanted to interact with the agents in Slack, meaning everyone had to figure out how to integrate with Slack's API.
Then the problem got worse. Once the agents were in Slack, people wanted to integrate them with even more platforms, like Discord, Github, and even issue trackers like Linear. Each of those introduced a new integration adventure for every agent.
It hit us. Instead of asking people to come to agents, we needed to deliver agents to the places they were already working.
Chat needs integration abstraction
We realized we had made it easy for our teams to create agents, but we needed to make it easier to extend them for adoption across platforms.
This is true for every company. People are already using Microsoft Teams, WhatsApp, Telegram, and Google Chat, and agents need to be available in all of them.
That's exactly what the Chat SDK does: makes agents available across enterprise and consumer chat platforms.
Just like the AI SDK unified model provider APIs into a single interface, we built Chat SDK to abstract the quirks of messaging APIs into a simple framework for developers and their coding agents.
Developers no longer need to think about the way streaming might differ from one platform to the next, or how formatting, branching logic, or even reaction-handling should be tackled for individual APIs.
Write once, deploy everywhere
Chat SDK is a TypeScript library for building bots that work across Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, and Linear from a single codebase. The core chat package handles event routing and application logic. Platform-specific behavior is handled by adapters, so your handlers don't change when your deployment target does.
Here's what a basic bot looks like:
Each adapter auto-detects credentials from environment variables, so you can get started without any additional configuration. Switching from Slack to Discord means swapping the adapter, not rewriting the bot.
Platform inconsistencies, handled
Platforms behave very differently from each other, and Chat SDK doesn't paper over those differences with false promises. Instead, it handles them in the adapter layer so your application code doesn't have to.
Take streaming. Slack has a native streaming path that renders bold, italic, lists, and other formatting in real time as the response arrives. Other platforms use a fallback streaming path, passing streamed text through each adapter's markdown-to-native conversion pipeline at each intermediate edit.
Before Chat SDK, those adapters received raw markdown strings, so users on Discord or Teams would see literal bold syntax until the final message resolved. Now that conversion happens automatically.
Table rendering follows the same pattern. The Table() component gives you a composable API for rendering tables across every adapter. Pass in headers and rows, and Chat SDK figures out the rest. Slack renders Block Kit table blocks. Teams and Discord use GFM markdown tables. Google Chat uses monospace text widgets. Telegram converts tables to code blocks. GitHub and Linear continue to use their existing markdown pipelines.
Cards, modals, and buttons work similarly.
You write the element once using JSX, and each adapter renders them in whatever format the platform supports natively. If a platform doesn't support a given element, it will fall back gracefully.
Why Chat SDK matters even for single platforms
Even if your agent only targets Slack, Chat SDK still solves real problems. Channel and user names are automatically converted to clear text so your agent understands the context of the conversation.
This translation works in both directions. When the agent at-mentions somebody using clear text, Chat SDK ensures the notification actually triggers in Slack.
Agents require full context to be effective. Chat SDK automatically includes link preview content, referenced posts, and images directly in agent prompts. Additionally, while models generate standard markdown, Slack does not natively support it.
Chat SDK converts standard markdown to the Slack variant automatically. This conversion happens in real time, even when using Slack's native append-only streaming API.
AI streaming, built in
The post() function accepts an AI SDK text stream directly, which means you can pipe a streaming LLM response to any chat platform without any additional wiring:
The adapter layer handles the platform-specific rendering of that stream, including live formatting where the platform supports it.
State that scales
Thread subscriptions, distributed locks, and key-value cache state are handled through pluggable state adapters. Redis and ioredis have been available since launch. PostgreSQL is now supported as a production-ready option, so teams already running Postgres can persist bot state without adding Redis to their infrastructure.
The PostgreSQL adapter uses pg (node-postgres) with raw SQL and automatically creates the required tables on first connect. It supports TTL-based caching, distributed locking across multiple instances, and namespaced state via a configurable key prefix. Community contributor @bai laid the groundwork in PR #154.
WhatsApp, and beyond
Chat SDK now supports WhatsApp, extending the write-once model to one of the largest messaging platforms in the world.
The WhatsApp adapter supports messages, reactions, auto-chunking, read receipts, multi-media downloads (images, voice messages, stickers), and location sharing with Google Maps URLs. Cards render as interactive reply buttons with up to three options, falling back to formatted text where needed.
Note that WhatsApp enforces a 24-hour messaging window, so bots can only respond within that period. The adapter does not support message history, editing, or deletion. Community contributor @ghellach laid the groundwork in PR #102.
Getting started
To augment your coding agents, install the Chat skill:
And you can also modify and use this starter prompt:
The Chat SDK documentation covers getting started, platform adapter setup, state configuration, and guides for common patterns including a Slack bot with Next.js and Redis, a Discord support bot with Nuxt, and a GitHub code review bot with Hono.
Chat SDK is open source and in public beta. The agents your team has been building don't have to live on just one platform. They can go where your users actually are.
Read more
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み