关于 autogpt-agents
AutoGPT 是用于构建、部署和管理持续运行 AI Agent 的平台,面向希望使用可视化界面或开发工具创建自动化流程的团队。它结合图形化节点编辑器、可复用模块、外部触发器和 Forge 开发工具包。
主要功能
- 01可视化节点式 Agent 构建器
- 02持续执行与外部触发
- 03可复用模块和市场
- 04Forge 自定义 Agent 工具包
- 05Agent 基准测试系统
适用场景
- 01构建多步骤自动化流程
- 02按计划或 Webhook 触发 Agent
- 03通过可视化界面配置 Agent
- 04使用基准测试评估 Agent
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ orchestra-research/ ai-research-skills --skill autogpt-agents安装后在 Claude Code 中输入/autogpt-agents确认已加载。
附带文件references/advanced-usage.mdreferences/troubleshooting.md
详细介绍
AutoGPT - 自主 AI Agent 平台
通过可视化界面或开发工具包构建、部署和管理持续运行的 AI Agent 的综合平台。
何时使用 AutoGPT
在以下情况下使用 AutoGPT:
- 构建持续运行的自主 Agent
- 创建基于可视化工作流的 AI Agent
- 部署带外部触发(webhook、定时任务)的 Agent
- 构建复杂的多步骤自动化流水线
- 需要无代码/低代码的 Agent 构建器
主要功能:
- 可视化 Agent 构建器:拖拽式基于节点的工作流编辑器
- 持续执行:Agent 通过触发器持久运行
- 市场:可共享/复用的预构建 Agent 和区块
- 区块系统:用于大模型、工具、集成的模块化组件
- Forge 工具包:用于创建自定义 Agent 的开发者工具
- 基准测试系统:标准化的 Agent 性能测试
在以下情况下改用其他方案:
- LangChain/LlamaIndex:如果你需要对 Agent 逻辑有更多控制
- CrewAI:用于基于角色的多 Agent 协作
- OpenAI Assistants:用于简单的托管式 Agent 部署
- Semantic Kernel:用于 Microsoft 生态集成
快速开始
安装(Docker)
# Clone repository
git clone https://github.com/Significant-Gravitas/AutoGPT.git
cd AutoGPT/autogpt_platform
# Copy environment file
cp .env.example .env
# Start backend services
docker compose up -d --build
# Start frontend (in separate terminal)
cd frontend
cp .env.example .env
npm install
npm run dev
访问平台
- 前端 UI:http://localhost:3000
- 后端 API:http://localhost:8006/api
- WebSocket:ws://localhost:8001/ws
架构概览
AutoGPT 有两个主要系统:
AutoGPT 平台(生产环境)
- 带 React 前端的可视化 Agent 构建器
- 带执行引擎的 FastAPI 后端
- PostgreSQL + Redis + RabbitMQ 基础设施
AutoGPT Classic(开发环境)
- Forge:Agent 开发工具包
- Benchmark:性能测试框架
- CLI:用于开发的命令行界面
核心概念
图和节点
Agent 表示为包含由链接连接的节点的图:
Graph (Agent)
├── Node (Input)
│ └── Block (AgentInputBlock)
├── Node (Process)
│ └── Block (LLMBlock)
├── Node (Decision)
│ └── Block (SmartDecisionMaker)
└── Node (Output)
└── Block (AgentOutputBlock)
区块
区块是可复用的功能组件:
| 区块类型 | 用途 |
|---|---|
INPUT | Agent 入口点 |
OUTPUT | Agent 输出 |
AI | 大模型调用、文本生成 |
WEBHOOK | 外部触发 |
STANDARD | 通用操作 |
AGENT | 嵌套 Agent 执行 |
执行流程
User/Trigger → Graph Execution → Node Execution → Block.execute()
↓ ↓ ↓
Inputs Queue System Output Yields
构建 Agent
使用可视化构建器
- 打开 Agent 构建器,地址为 http://localhost:3000
- 从 BlocksControl 面板添加区块
- 连接节点,在句柄之间拖拽
- 在每个节点中配置输入
- 运行 Agent,使用 PrimaryActionBar
可用区块
AI 区块:
AITextGeneratorBlock- 使用大模型生成文本AIConversationBlock- 多轮对话SmartDecisionMakerBlock- 条件逻辑
集成区块:
- GitHub、Google、Discord、Notion 连接器
- Webhook 触发器和处理器
- HTTP 请求区块
控制区块:
- 输入/输出区块
- 分支和决策节点
- 循环和迭代区块
Agent 执行
触发类型
手动执行:
POST /api/v1/graphs/{graph_id}/execute
Content-Type: application/json
{
"inputs": {
"input_name": "value"
}
}
Webhook 触发:
POST /api/v1/webhooks/{webhook_id}
Content-Type: application/json
{
"data": "webhook payload"
}
定时执行:
{
"schedule": "0 */2 * * *",
"graph_id": "graph-uuid",
"inputs": {}
}
监控执行
WebSocket 更新:
const ws = new WebSocket('ws://localhost:8001/ws');
ws.onmessage = (event) => {
const update = JSON.parse(event.data);
console.log(`Node ${update.node_id}: ${update.status}`);
};
REST API 轮询:
GET /api/v1/executions/{execution_id}
使用 Forge(开发)
创建自定义 Agent
# Setup forge environment
cd classic
./run setup
# Create new agent from template
./run forge create my-agent
# Start agent server
./run forge start my-agent
Agent 结构
my-agent/
├── agent.py # Main agent logic
├── abilities/ # Custom abilities
│ ├── __init__.py
│ └── custom.py
├── prompts/ # Prompt templates
└── config.yaml # Agent configuration
实现自定义能力
from forge import Ability, ability
@ability(
name="custom_search",
description="Search for information",
parameters={
"query": {"type": "string", "description": "Search query"}
}
)
def custom_search(query: str) -> str:
"""Custom search ability."""
# Implement search logic
result = perform_search(query)
return result
Agent 基准测试
运行基准测试
# Run all benchmarks
./run benchmark
# Run specific category
./run benchmark --category coding
# Run with specific agent
./run benchmark --agent my-agent
基准测试类别
- 编码:代码生成和调试
- 检索:信息查找
- Web:网页浏览和交互
- 写作:文本生成任务
VCR 录像带
基准测试使用录制的 HTTP 响应以保证可复现性:
# Record new cassettes
./run benchmark --record
# Run with existing cassettes
./run benchmark --playback
集成
添加凭据
- 导航至 Profile > Integrations
- 选择提供商(OpenAI、GitHub、Google 等)
- 输入 API 密钥或授权 OAuth
- 凭据会被加密并安全存储
在区块中使用凭据
区块会自动访问用户凭据:
class MyLLMBlock(Block):
def execute(self, inputs):
# Credentials are injected by the system
credentials = self.get_credentials("openai")
client = OpenAI(api_key=credentials.api_key)
# ...
支持的提供商
| 提供商 | 认证类型 | 使用场景 |
|---|---|---|
| OpenAI | API Key | 大模型、嵌入 |
| Anthropic | API Key | Claude 模型 |
| GitHub | OAuth | 代码、仓库 |
| OAuth | Drive、Gmail、Calendar | |
| Discord | Bot Token | 消息收发 |
| Notion | OAuth | 文档 |
部署
Docker 生产环境设置
# docker-compose.prod.yml
services:
rest_server:
image: autogpt/platform-backend
environment:
- DATABASE_URL=postgresql://...
- REDIS_URL=redis://redis:6379
ports:
- "8006:8006"
executor:
image: autogpt/platform-backend
command: poetry run executor
frontend:
image: autogpt/platform-frontend
ports:
- "3000:3000"
环境变量
| 变量 | 用途 |
|---|---|
DATABASE_URL | PostgreSQL 连接 |
REDIS_URL | Redis 连接 |
RABBITMQ_URL | RabbitMQ 连接 |
ENCRYPTION_KEY | 凭据加密 |
SUPABASE_URL | 身份认证 |
生成加密密钥
cd autogpt_platform/backend
poetry run cli gen-encrypt-key
最佳实践
- 从简单开始:先使用 3-5 个节点 Agent
- 增量测试:每次更改后运行并测试
- 使用 webhooks:为事件驱动的 Agent 提供外部触发器
- 监控成本:通过积分系统跟踪大模型 API 用量
- 为 Agent 设置版本:更改前保存可用的版本
- 基准测试:使用 agbenchmark 验证 Agent 质量
常见问题
服务无法启动:
# Check container status
docker compose ps
# View logs
docker compose logs rest_server
# Restart services
docker compose restart
数据库连接问题:
# Run migrations
cd backend
poetry run prisma migrate deploy
Agent 执行卡住:
# Check RabbitMQ queue
# Visit http://localhost:15672 (guest/guest)
# Clear stuck executions
docker compose restart executor
参考资料
资源
- 文档:https://docs.agpt.co
- 仓库:https://github.com/Significant-Gravitas/AutoGPT
- Discord:https://discord.gg/autogpt
- 许可证:MIT (Classic) / Polyform Shield (Platform)
评论
支持 Markdown