内容
外发驾驶舱
**基于代理的创始人外联** — 一个 LangGraph + FastMCP 的销售研究系统,它用工具调用代理、实时网络研究和咨询稿生成取代了单次 LLM 调用。





[](https://outbound-cockpit-xopw.onrender.com/cockpit.html)
**实时应用:** [outbound-cockpit-xopw.onrender.com/cockpit.html](https://outbound-cockpit-xopw.onrender.com/cockpit.html) · **GitHub:** [nancyjain779/outbound-cockpit](https://github.com/nancyjain779/outbound-cockpit)
> **公共演示 - 无需登录。** 访问者打开上述链接,无需密码。
> `COCKPIT_SERVICE_TOKEN` 是一个**仅限服务器的秘密**(在 Render 环境中设置)- 永远不要将其放在 README、GitHub 或与用户共享。
**招聘人员演示:**潜在客户 → **分析** → 查看 **代理 面板。指南: [docs/DEMO.md](docs/DEMO.md)
---
## 实时部署(Render)
`` 中的双服务蓝图:
| URL | 角色 |
|---------|-----|------|
| **outbound-cockpit** | https://outbound-cockpit-xopw.onrender.com | 公共 UI + 工具桥 |
| **out** | https://outreach-agent-nuuh.onrender.com | LangGraph 代理 + MCP(后端) |
**环境连接** (蓝图自动设置 URL;验证代理跟踪是否丢失):
| 服务 | 变量 | 值 |
|---------|----------|--------|
| Node | `AGENT_SERVICE_URL` | `https://outreach-agent-nuuh.onrender.com` |
| Python | `NODE_TOOL_BRIDGE_URL` | `https://outbound-cockpit-xopw.onrender.com` |
| **Both** | `COCKPIT_SERVICE_TOKEN` | 相同的秘密(不是 URL) |
| **Both** | `OPENAI_API_KEY`sk-...` -的 LiteLLM 密钥检查: [Node `/healthz`](https://outbound-cockpit-xopw.onrender.com/healthz) · [Python `/health`](https://outreach-agent-nuuh.onrender.com/health) (期望 `bridge_ok: true`)
---
## 概述
外发驾驶舱帮助操作员研究潜在客户,分类社交信号,并草拟听起来像人类的开场白 - 而不像销售垃圾邮件。 **Node.js** UI 和潜在客户来源 API 位于 **Python LangGraph 代理** 之前,该代理12 个 MCP 工具Apollo,Apify,ity,MongoDB CRM| 层 | 技术 | |
|-------|------|------ UI | `cockpit.html` | 每日外联工作流 - 潜在客户,草稿 |
| API 网 Node.js | 认证,速率限制,代理代理,内部工具桥 |
| 代理 | LangGraph + FastAPI | 计划 → 收集 → 综合 → 验证 → 持久化 |
| 工具 | FastMCP → Node 桥 | Apollo,Apify,Perplexity,CRM |
---
## 截图
| 潜在客户流水线 | AI 分析代理跟踪 |
|----------------|--------------------------|
|  |
> 用实时 PNG 替换 SVG 预览 - 请参阅 [docs/screenshots/README.md](docs/screenshots/README.md)。
> **试用实时应用:** [outbound-cockpit-xopw.onrender.com/cockpit.html](https://outbound-cockpit-xopw.onrender.com/cockpit.html)
---
## 架构
```mermaid
flowchart TB
subgraph Browser
UI[cockpit.html]
end
subgraph Node["Node.js :3000"]
AgentProxy["/api/agent/*"]
LeadsAPI["/api/*"]
Internalapi/internal/tools/*"]
end
subgraph Python["8000"]
FastAPI[FastAPI]
Graph[ StateGraph]
Planner tool planner]
MCPMCP 12 tools]
end
subgraph External
Apollo[Apollo.io]
Apify[Apify]
Perplexity[Perplexity]
Mongo[(MongoDB)]
end
UI --> AgentProxy --> FastAPI --> Graph
Graph --> Planner --> MCP --> Internal
Internal --> Apollo & Apify & Perplexity & Mongo
UI --> LeadsAPI --> Apollo & Apify
```
完整图表,图表节点和 SSE 流: **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)**
---
## 功能
- **LangGraph 代理** - 混合工具规划器(规则 + LLM),单工具每步执行循环,LLM 验证带有限定重试
- **12 个 MCP 工具** - 分类,丰富,抓取,LinkedIn 配置文件,网络研究,CRM 读取/写入,验证
- **SSE 流** - UI 中的实时代理跟踪(`计划` → `工具` → `综合` → `验证 `最终`)
-轮聊天** - Mongo程内存用于“修订草稿”而无需重新运行完整研究
- **潜在客户来源** - Apollo 人员搜索,Apify LinkedIn 帖子,Reddit 意图查找器
- **优雅降级** - 无 API 密钥(启发式模式)有效;`AGENT_FALLBACK=1` 降级到旧版 `/api/ai/*`
---
## 快速入门(本地)
```bash
git clone https://github.com/nancyjain779/outbound-cockpit.git
cd outbound-cockpit
cp .env.example .env # 添加密钥(见下文)
npm install && npm # 终端 1://localhost:300ockpit.html
```
```bash
# 终端 2 - Python 代理
cd outreach-agent
pip install -e .
export NODE_TOOL_BRIDGE_URL=http://localhost:3000
export COCKPIT_SERVICEdev-secret
export OPEN_KEY=sk-...
uvicorn agent.api.main:app --port 8000**完整代理流程的最低环境变量:**
| 变量 | 目的 |
|----------|---------|
| `COCKP_TOKEN` | Node ↔ Python 之间的共享秘密(仅 Render 环境 - **绝不能公开**) |
| `OPENAI_API_KEY` 或 `PERPLEXITY_API_KEY` | LLM + 网络研究 |
| `AGENT_SERVICE_URL` | Node → Python(默认为 `http://localhost:8000`) |
可选:`APOLLO_API_KEY`,IFY_TOKEN`,`MONGODB_URI`,`REDDIT_*` - 请参阅 [.env.example](.env.example)。
---
## Docker
```bash
cp .env.example .env
# 在 .env 中设置 COCKPIT_SERVICE_TOKEN 和至少一个 LLM 密钥
docker compose up --build
```
| 服务 | 端口 | 镜像 |
|---------|------|-------|
| `cockpit` | 3000 | `Dockerfile.node` |
| `agent` | 8000 | `outreach-agent/Dockerfile` |
打开 **http://localhost:3000/cockpit.html**
```bash
docker compose ps # 健康状态
docker compose logs -f agent
curl http://localhost:8000/health
curl http://localhost:3000/healthz
```
---
## API 文档
| 接口 | 基本路径 | 文档 |
|---------|-----------|------|
| 浏览器 / | `/api/leads/*`,`/api/agent/*`,`/api/cockpit` | [docs/API.md](docs/API.md) |
| Python 代理 | `/v1/*` 在端口 8000 上 | [docs/API.md#python-agent-fastapi](docs/API.md#python-agent-fastapi) |
| 内部桥梁 | `/api/internal/tools/*` (服务令牌) | [docs/API.md#internal-tool-bridge](docs/API.md#internal-tool-bridge) |
交互式 OpenAPI(当代理运行时): **http://localhost:8000/docs**
---
## 文件结构
```
outbound-cockpit/
├── public/ # 单页 UI(cockpit.html)
├── api/
│ ├── agent/ # 代理到 Python 代理(+ SSE 流)
│ ├── ai/ # 旧式整体分析/分类(降级)
│ ├── leads/ # Apollo,Apify,Reddit 潜在客户来源
│ ├── cockpit.js # 潜在客户的 Mongo 同步
│ └── internal/tools/ # MCP 工具执行的受保护桥梁
├── lib/ # 共享 Node 实用程序(mongo,openers,auth)
├── outreach-agent/
│ ├── agent/ # LangGraph 图,节点,规划器,提示
│ ├── mcp_server/ # FastMCP 工具定义
│ ├── memory/ # MongoDB 线程存储
│ ├── eval/ # 黄金集评估脚手架
│ └── tests/
├── docs/ # 架构,API,设计,部署指南
├── docker-compose.yml
├── Dockerfile.node
├── render.yaml # Render.com 双服务部署
└── server.js # Node HTTP 服务器 + 认证门
```
详情: **[docs/FOLDER_STRUCTURE.md](docs/FOLDER_STRUCTURE.md)**
---
## 设计决策
关键选择(LangGraph 与 Temporal,Node+Python 分割,混合规划器,SSE,降级路径): **[docs/DESIGN.md](docs/DESIGN.md)**
---
## 未来改进
路线图(评估指标,Slack 机器人,批量作业,如果需要 Temporal): **[docs/FUTURE.md](docs/FUTURE.md)**
---
## 部署到生产环境
逐步 **Render Blueprint** 指南: **[docs/DEPLOY.md](docs/DEPLOY.md)**
**招聘人员实时演示脚本:** **[docs/DEMO.md](docs/DEMO.md)**
---
## 评估bash
cd outreach-agent && python -m eval.run_eval
```
黄金集:reach-agent/eval/golden_set.json`
---
## 许可证
MIT - 请参阅 [LICENSE](LICENSE)