AgentBus
The open-source event bus for AI agents. Webhooks in. Agent actions out.
______________________________________________________________________
为什么
AI代理需要事件来采取行动。但将Webhook连接到代理意味着为每个集成编写自定义HTTP服务器、解析有效载荷、处理重试和管理队列。
AgentBus是一个轻量级的、自托管的事件总线,可以处理所有这些。 接收webhooks。通往代理商的路线。调度行动。 适用于任何AI框架:CrewAI、LangGraph、OpenAI代理SDK或纯HTTP。
快速开始
npm install agentbusimport { AgentBus } from 'agentbus';
const bus = new AgentBus({
handlers: [
{
name: 'issue-triage',
pattern: 'github:issues.*',
handle: async (ctx) => {
ctx.logger.info(`New issue: ${ctx.event.payload.title}`);
// Call your AI agent here
return { success: true };
},
},
],
});
// Receive an event
await bus.emit({
source: 'github',
type: 'issues.opened',
payload: { title: 'Bug: login fails', labels: ['bug'] },
});特性
| 功能 | 社区(免费) | 专业版 |
|---|---|---|
| Webhook摄入 | ✅ 无限制 | ✅ + 已验证的来源 |
| 路由 | ✅ 球状图案 | ✅ + 基于内容 |
| 队列 | ✅ 内存+BullMQ | ✅ + 速率限制 |
| 存储 | ✅ SQLite+PostgreSQL | ✅ + 事件回放,DLQ |
| 代理人 | ✅ HTTP适配器 | ✅ + A2A,MCP服务器 |
| 派遣 | ✅ 无限制 | ✅ + 除尘、过滤器 |
| 支持 | GitHub问题 | 优先电子邮件 |
建筑
Webhooks (GitHub, Stripe, Sentry, ...)
│
▼
┌──────────────┐
│ AgentBus │
│ ┌──────────┐ │
│ │ Router │ │ ← Glob pattern matching
│ └──────────┘ │
│ ┌──────────┐ │
│ │ Queue │ │ ← In-memory or BullMQ
│ └──────────┘ │
│ ┌──────────┐ │
│ │ Store │ │ ← SQLite or PostgreSQL
│ └──────────┘ │
└──────────────┘
│
▼
AI Agents (HTTP, CrewAI, LangGraph, ...)集成
AgentBus适用于任何AI代理框架:
- 超文本传输协议 --将POST事件发送到任何端点
- CrewAI --从webhooks触发船员任务
- LangGraph --将事件发送到LangGraph工作流
- OpenAI代理SDK --发送给OpenAI代理
- A2A协议 --代理间通信(Pro)
- MCP服务器 --模型上下文协议集成(Pro)
文档
访问 agentbus.dev 获取完整文档。
贡献
看 贡献.md 用于开发设置和指南。
许可证
麻省理工学院 --AgentBus核心是免费和开源的。
@ agentbus/专业 根据商业许可证提供。
