
多租户 WhatsApp AI 代理平台——在 WhatsApp 上部署智能代理,支持大型语言模型(LLM)、MCP 工具和生产准备基础设施。
概览
WhaAgent 连接 AI 代理到 WhatsApp。Go 网关负责 WhatsApp 协议。Python API 运行基于 LangGraph 的代理。多个 WhatsApp 号码、多个 AI 代理、单一部署。 Docker 将 Go 网关和 Python API 构建在一个容器中。暴露 8000 端口。 - Python 3.12+ - Go 1.21+ - uv 包管理器 将 .env.example 复制到 .env,并设置你的 LLM API 密钥: 启动服务后,在浏览器中打开二维码页面: 用WhatsApp打开http://localhost:8000/api/v1/whatsapp/qr/personal/page,扫描(设置>关联设备)。 WhaAgent 内置了 12 个代理。每个代理都有系统提示、工具访问,并且可以自定义。 在~/.whaagent.yaml中分配代理到WhatsApp号码:
概述(AI 翻译)
多租户WhatsApp人工智能平台
概述
WhaAgent 连接 AI 代理到 WhatsApp。Go 网关负责 WhatsApp 协议。Python API 运行基于 LangGraph 的代理。多个 WhatsApp 号码、多个 AI 代理、单一部署。
建筑
信息流
安装
选项A:Docker
Docker 将 Go 网关和 Python API 构建在一个容器中。暴露端口 8000。
选项B:手动设置
先决条件:
- Python 3.12+
- Go 1.21+
- UV包管理器
配置
1.环境变量
将.env.example复制到.env,并设置你的LLM API密钥:
2.应用配置
运行交互式设置向导:
这会生成 ~/.whaagent.yaml:
3.链接 WhatsApp
启动服务后,在浏览器中打开二维码页面:
打开http://localhost:8000/api/v1/whatsapp/qr/personal/page,用WhatsApp扫描(设置>关联设备)。
特工们
WhaAgent 内置了 12 个代理。每个代理都有系统提示、工具访问,并且可以自定义。
内置代理
| 代理人 | 目的 |
|---|
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Overview
WhaAgent connects AI agents to WhatsApp. A Go gateway handles the WhatsApp protocol. A Python API runs LangGraph-powered agents. Multiple WhatsApp numbers, multiple AI agents, single deployment.
User sends WhatsApp message
|
v
Go Gateway (whatsmeow) --> Python API (FastAPI) --> AI Agent (LangGraph)
| |
v v
Response sent back via WhatsApp Tools / LLM / Memory
Architecture
flowchart TB
subgraph Clients["Client Layer"]
WA1["WhatsApp User A"]
WA2["WhatsApp User B"]
WA3["WhatsApp User C"]
end
subgraph Gateway["Go Gateway"]
SM["Session ManagerMulti-tenant WhatsApp connections"]
QR["QR Code GeneratorSSE streaming to browser"]
EVT["Event HandlerAsync message processing"]
HTTP["HTTP ClientForward to Python API"]
end
subgraph API["Python API — FastAPI"]
ROUTE["Webhook Router/api/v1/channels/whatsapp/message"]
AUTH["API Key AuthX-API-Key header"]
POOL["Tenant Agent PoolLRU eviction, per-tenant isolation"]
DB["SQLite CheckpointConversation memory persistence"]
end
subgraph Graph["LangGraph StateGraph"]
SUM["Summarize NodeToken threshold, context compression"]
ROUTER["Router NodeLLM intent classification"]
AGENT["Agent NodeTool orchestration, ReAct loop"]
end
subgraph Agents["Agent Registry"]
A1["assistantGeneral-purpose orchestrator"]
A2["developerCode exploration and analysis"]
A3["news / br-news / es-newsNews aggregation"]
A4["learning / recipe / youtubeDomain-specific agents"]
A5["github-pr-reviewerPull request automation"]
A6["Custom [email protected]"]
end
subgraph Tools["Tool Layers"]
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →