快速开始
环境要求
- 操作系统:macOS 12+ / Windows 10+ (WSL2) / Linux (Ubuntu 22.04+)
- 运行时:Node.js >= 18.0.0 / Python >= 3.11 / Rust >= 1.75
- 容器:Docker Desktop(可选,用于沙箱化执行)
- 硬件:4GB+ RAM,推荐 8GB+
- 企业级部署:PostgreSQL 15+(可选)/ Kubernetes 1.28+(可选)
安装
克隆仓库
bash
git clone https://github.com/gitcoffee-os/agido.git
cd agido安装依赖
bash
pnpm install配置环境变量
bash
cp .env.example .env
# 编辑 .env 文件,填入你的 API 密钥启动开发服务器
bash
pnpm dev开发服务器启动后,访问 http://localhost:3000 即可预览。
构建生产版本
bash
pnpm build构建产物将输出到 dist 目录。
项目结构
agido/
├── apps/ # 应用目录
│ ├── desktop/ # 桌面端应用(Tauri)
│ ├── web/ # Web 端应用(React)
│ └── cli/ # 命令行工具
├── packages/ # 共享包
│ ├── core/ # Agido Native 核心引擎
│ ├── scheduler/ # 统一调度引擎
│ ├── adapters/ # 引擎适配器
│ │ ├── openclaw/ # OpenClaw 适配器
│ │ ├── hermes/ # Hermes Agent 适配器
│ │ ├── openhuman/ # OpenHuman 适配器
│ │ ├── dify/ # Dify 适配器
│ │ ├── coze/ # Coze 适配器
│ │ ├── autogen/ # AutoGen 适配器
│ │ └── crewai/ # CrewAI 适配器
│ ├── mcp-server/ # MCP Server
│ ├── enhanced/ # 增强引擎
│ │ ├── orchestration/ # 智能编排
│ │ ├── health/ # 健康感知
│ │ └── knowledge/ # 知识融合
│ └── shared/ # 共享工具
├── server/ # 服务端
│ ├── gateway/ # API 网关
│ └── mcp/ # MCP Server
├── docs/ # 文档
└── scripts/ # 脚本引擎配置
OpenClaw 引擎
bash
# 安装 OpenClaw
curl -fsSL https://openclaw.ai/install.sh | bash
# 或使用 Docker
docker run -d --name openclaw \
-p 3000:3000 \
-v ~/.openclaw:/data \
openclaw/openclaw:latestHermes Agent 引擎
bash
# 一键安装 Hermes Agent
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
# 或使用 pip
pip install hermes-agentOpenHuman 引擎
bash
# macOS
brew install --cask openhuman
# 或从 GitHub Releases 下载
# https://github.com/tinyhumansai/openhuman/releasesDify 引擎
bash
# 使用 Docker Compose 自托管部署
git clone https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env
docker compose up -d
# 或使用 Dify Cloud
# https://cloud.dify.ai/Coze 引擎
bash
# Coze 为云端 SaaS 平台,无需本地安装
# 访问 https://www.coze.com/ 或 https://www.coze.cn/ 注册使用
# 安装 Coze SDK(可选)
pip install coze-python
# 或
npm install @coze/apiAutoGen 引擎
bash
# 安装 AutoGen
pip install autogen-agentchat
# 安装完整版(含 Docker 支持)
pip install "autogen-agentchat[docker]"CrewAI 引擎
bash
# 安装 CrewAI
pip install crewai
# 安装完整工具集
pip install 'crewai[tools]'Agido 统一配置
在 Agido 设置面板中,你可以:
- 连接 OpenClaw:配置 Gateway 地址和认证信息
- 连接 Hermes Agent:配置 API 端点和模型提供商
- 连接 OpenHuman:启动桌面应用并授权 Agido 访问
- 连接 Dify:配置 Dify API 端点和 API Key
- 连接 Coze:配置 Coze 个人访问令牌和 Bot ID
- 连接 AutoGen:配置模型提供商和 Agent 参数
- 连接 CrewAI:配置模型提供商和 Crew 定义
- 设置路由策略:定义不同任务类型的引擎优先级
- 配置消息渠道:选择你要接入的聊天平台
配置说明
基础配置
在项目根目录创建 .env 文件:
env
# SkyGate 天枢 AI 网关
SKYGATE_API_URL=http://localhost:8080
SKYGATE_API_KEY=your_skygate_key
# OpenAI 兼容 API
OPENAI_API_KEY=your_openai_key
OPENAI_BASE_URL=https://api.openai.com/v1
# Ollama 本地模型
OLLAMA_BASE_URL=http://localhost:11434
# MCP Server
MCP_PORT=3001
MCP_API_KEY=your_mcp_key引擎配置
env
# OpenClaw
OPENCLAW_GATEWAY_URL=http://localhost:3000
OPENCLAW_API_KEY=your_openclaw_key
# Hermes Agent
HERMES_API_URL=http://localhost:8000
HERMES_MODEL_PROVIDER=openrouter
# Dify
DIFY_API_URL=https://api.dify.ai/v1
DIFY_API_KEY=your_dify_key
# Coze
COZE_ACCESS_TOKEN=your_coze_token
COZE_BOT_ID=your_bot_id使用示例
MCP Tool 调用
bash
# 执行 Shell 命令
curl -X POST http://localhost:3001/api/v1/mcp/tools/call \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "shell_exec",
"arguments": {"command": "ls -la /workspace", "timeout": 30}
}'
# 提交 DAG 编排任务
curl -X POST http://localhost:3001/api/v1/mcp/tools/call \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "dag_submit",
"arguments": {
"nodes": [
{"id": "search", "engine": "dify", "action": "rag_search", "input": "竞品列表"},
{"id": "collect", "engine": "openclaw", "action": "web_scrape", "depends_on": ["search"]},
{"id": "analyze", "engine": "crewai", "action": "role_analysis", "depends_on": ["collect"]}
],
"config": {"mode": "dag", "on_failure": "rollback"}
}
}'
# 查询引擎健康状态
curl -X POST http://localhost:3001/api/v1/mcp/tools/call \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "engine_health",
"arguments": {}
}'常见问题
Q: 引擎连接失败怎么办?
A: Agido 会自动降级至 Native 引擎保底运行。检查:
- 引擎服务是否启动
- API 地址和端口是否正确
- 认证信息是否有效
Q: 如何切换路由策略?
A: 在 Agido 设置面板中,选择"路由策略",可设置不同任务类型的引擎优先级。
Q: 如何添加新的引擎?
A: 实现 EngineAdapter 接口,注册到调度引擎即可。详见开发指南。