Show HN:Channels SDK —— 将任意智能体接入任意平台(Slack、MS Teams)
Show HN: The Channels SDK – Bring Any Agent to Any Channel (Slack, MS Teams)

原始链接: https://github.com/CopilotKit/channels-sdk

**Channels by CopilotKit** 让您可以将 AI 智能体直接集成到 Slack 和 Microsoft Teams 等通信平台中。通过支持 AG-UI(智能体 UI)标准,它使智能体能够直接在您的团队日常工作环境中运行,处理对话、调用工具、管理文件,并呈现特定于平台的交互式 UI(如按钮和审批闸道)。 **主要功能:** * **平台无关性:** 兼容多种智能体框架,包括 LangGraph、CrewAI 和 Pydantic AI。 * **原生集成:** 将智能体交互转换为 Slack Block Kit 或 Teams 自适应卡片 (Adaptive Cards)。 * **安全第一:** 您的智能体逻辑、模型凭据和业务数据完全保留在您的基础设施内;CopilotKit Intelligence 仅负责管理平台连接。 * **快速部署:** 使用 `npx copilotkit@latest channels setup` 命令,即可通过编码智能体引导您完成从设置到生产的整个配置过程。 Channels 在您的自定义 AI 逻辑与现有的协作工具之间架起桥梁,确保您的智能体如同团队的原生一员。无论您是要构建简单的助手还是复杂的分类工具,CopilotKit 都能为您提供实现无缝体验所需的运行时、SDK 和连接能力。

```Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Show HN: The Channels SDK – 将任何智能体接入任何渠道(Slack, MS Teams) (github.com/copilotkit) 29 分,davidmckayv 发布于 23 分钟前 | 隐藏 | 过往 | 收藏 | 讨论 | 帮助 考虑申请 YC 2026 年秋季批次!申请截止日期为 7 月 27 日。 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:```
相关文章

原文
channels-sdk-demo.mp4

Your agent keeps its tools, model, and business logic. Channels gives it a native place to work with people.

Your agent belongs where work happens

Channels connects an AG-UI-compatible agent to the communication platforms your team already uses. The agent can understand the conversation, stream a response, call tools, work with files, render interactive UI, and pause for human approval.

Bring your agent Render native UI Keep people in control
Use CopilotKit's built-in agent or connect LangGraph, CrewAI, Mastra, Pydantic AI, Google ADK, and other AG-UI agents. Describe a message once and render it as native Slack Block Kit, Teams Adaptive Cards, and platform-specific UI. Put buttons, choices, and approval gates directly into the conversation before an agent acts.

One interaction, native to every channel

Channels is built for a world where the same agent can meet users across every communication surface. Managed connections for Slack and Microsoft Teams are available through CopilotKit Intelligence, with more channels on the way.

Try it before you build it

Experience a real Channels agent in Slack or Microsoft Teams without configuring an app, runtime, or provider credentials.

Choose a platform, join the experience, and see how an agent handles context, tool use, and native channel UI.

Your agent and application logic run in your infrastructure. CopilotKit Intelligence manages the platform connection and delivers each turn to your long-running Channels process.

Fastest path: let your coding agent drive

Building a Channels agent spans a project, an agent, a managed Channel, a provider app, and a long-running runtime. One guide walks your agent through all of it.

npx copilotkit@latest channels setup

That installs the channels-setup skill, prints a prompt, and copies it to your clipboard. Paste it into your coding agent.

The skill is a pointer — it fetches the workflow from copilotkit.ai/channels-guide.md when your agent needs it, so the steps are current even if the installed skill is months old. The guide asks which platform you want, Slack or Microsoft Teams, and which agent framework.

Your agent drives the Slack and Intelligence consoles itself, in your own signed-in session. If it has no browser or computer-use tool yet, it will ask you to add one first — that is the intended path, not a fallback. You type the secrets; it does the clicking.

Or install the Slack setup skill on disk

Skip the hosted guide and put the Slack workflow directly in the coding agent you are already running in:

npx copilotkit@latest skills install --skill setup-slack-channel -y

-y installs that one skill without opening a picker. The skill is scoped to Slack — for Microsoft Teams, use the guide above.

The CLI covers the Intelligence side: copilotkit channels add --adapter slack declares the Channel and attaches the adapter, and copilotkit channels status compares your configuration, your code, and the server. What stays in the browser is the provider side — creating the Slack app and installing it into a workspace — plus issuing the project API key. No CLI flag accepts a credential value, so the bot token and signing secret stay in your .env and with you.

Unknown option '--skill'? An older copilotkit — globally installed or left in the npx cache — is shadowing the current CLI. Keep the @latest; that is what forces npx to fetch the current version instead of reusing what it already has.

The steps below are the same path, done by hand.

1. Configure the connection

Create a Channel in CopilotKit Intelligence and connect Slack. Keep the Channel Code and project-scoped Intelligence API key for the next steps.

You need Node.js 22 or later and a long-running Node process or container.

npm install @copilotkit/channels @copilotkit/runtime
npm install --save-dev tsx typescript @types/node
npm pkg set type=module

Channels and Runtime ship together as a tested pair. Upgrade both packages together.

The example below uses CopilotKit's built-in agent. Replace makeAgent with any AG-UI-compatible agent factory without changing the Channel lifecycle.

// channel.ts
import { createServer } from "node:http";
import { createChannel } from "@copilotkit/channels";
import {
  BuiltInAgent,
  CopilotKitIntelligence,
  CopilotRuntime,
} from "@copilotkit/runtime/v2";
import { createCopilotNodeListener } from "@copilotkit/runtime/v2/node";

function required(name: string): string {
  const value = process.env[name];
  if (!value) throw new Error(`Missing required environment variable: ${name}`);
  return value;
}

function makeAgent(threadId: string) {
  const agent = new BuiltInAgent({ model: "openai:gpt-5.4-mini" });
  agent.threadId = threadId;
  return agent;
}

const channel = createChannel({
  name: required("CHANNEL_CODE"),
  identifyUser: "platform",
  agent: makeAgent,
});

channel.onMessage(async ({ thread, message }) => {
  await thread.runAgent({
    prompt: message.contentParts?.length
      ? [
          ...(message.text
            ? [{ type: "text" as const, text: message.text }]
            : []),
          ...message.contentParts,
        ]
      : message.text,
    context: [{ description: "Originating platform", value: message.platform }],
  });
});

const intelligence = new CopilotKitIntelligence({
  apiKey: required("INTELLIGENCE_API_KEY"),
});

const runtime = new CopilotRuntime({
  agents: {},
  intelligence,
  identifyUser: () => ({
    id: "channels-runtime",
    name: "Channels Runtime",
  }),
  channels: [channel],
});

const listener = createCopilotNodeListener({
  runtime,
  basePath: "/api/copilotkit",
});

const channels = listener.channels;
if (!channels) throw new Error("Channels control surface was not created.");

const server = createServer(listener);
const shutdown = async () => {
  await channels.stop();
  if (server.listening) server.close();
};
process.once("SIGINT", shutdown);
process.once("SIGTERM", shutdown);

await channels.ready({ timeoutMs: 30_000 });

const status = channels.status();
if (status.overall !== "online") {
  throw new Error(`Channel is not online: ${JSON.stringify(status)}`);
}

const port = Number(process.env.PORT ?? 3000);
server.listen(port, () => {
  console.log(`Channel online; lifecycle server listening on :${port}`);
});
# .env
OPENAI_API_KEY=<openai-api-key>
INTELLIGENCE_API_KEY=<project-api-key>
CHANNEL_CODE=<channel-code-from-intelligence>
PORT=3000
node --env-file=.env --import tsx channel.ts

When Intelligence reports Online, invite the app to a Slack channel and mention it. Your agent now receives the conversation and responds in the thread.

Want Microsoft Teams, a different agent framework, interactive approvals, files, or production deployment guidance? Continue in the Channels documentation.

Rather have your agent do it? Run npx copilotkit@latest channels setup from Fastest path above. The guide covers this same setup plus the provider and verification steps.

Channels architecture connecting any agent through CopilotKit and AG-UI to communication platforms

Every turn follows the same path:

  1. A person messages your app in Slack or Microsoft Teams.
  2. CopilotKit Intelligence receives the platform event and delivers it to your Channels process.
  3. Channels runs your agent over AG-UI, executes tools, and renders the result.
  4. Intelligence sends native platform UI back into the conversation.
You run CopilotKit Intelligence manages
Your agent, model credentials, tools, and business logic Slack and Microsoft Teams platform credentials
The long-running Channels listener Platform ingress and credentialed delivery
Application state, deployment, and logs Runtime registration, health, and reconnects

The SDK is open source and MIT licensed. CopilotKit Intelligence can be hosted by CopilotKit or self-hosted for enterprise deployments.

See a complete Channels app

OpenTag is an open-source, self-hosted on-call triage assistant built with Channels.

Use it to study a complete application with:

  • a Python LangGraph agent connected over AG-UI
  • native Slack and Microsoft Teams experiences
  • file-aware prompts and generative UI
  • human approval before Linear or Notion writes
  • a production-shaped Node runtime and agent service

MIT © CopilotKit

联系我们 contact @ memedata.com