199OS 自主工作系统
模型无关的全天候(24/7)AI助手,助力销售、市场营销与客户成功
将您的MCP服务器转变为自主运行的工作者,全天候监控、分析并发出警报——即使在您沉睡时也不停歇。
 
______________________________________________________________________
🎯 这是什么?
这个系统将您的199OS MCP服务器(销售、市场营销、客户成功)转变为全天候自主工作的员工,它们能够:
- ✅(对号,表示正确、确认或同意) 持续监控 - 客户健康状况、交易风险、活动支出、支持服务级别协议(SLAs)
- ✅ 智能警报 - 需要采取行动时,通过Slack、电子邮件或自定义webhooks通知
- ✅ 从模式中学习 - 去重警报,追踪趋势,随时间优化
- ✅ 控制成本 - 预算限制、模型选择、每个工作节点的令牌追踪
- ✅ 随处可运行 - 与模型无关(可选择Sonnet、Haiku或任何Claude模型)
问题: MCP服务器是按需使用的工具——只有在您请求时才会运行。关键问题可能会在一夜之间出现。
解决方案: 按计划运行的自主工作程序,能够分析数据并自动向您发出警报。
______________________________________________________________________
🚀 快速入门(5分钟)
1. 安装依赖项
cd /Users/evanpaliotta/199os-autonomous-worker
pip install -r requirements.txt2. 配置环境
cp .env.example .env
# Edit .env and add:
# - ANTHROPIC_API_KEY
# - DATABASE_URL (PostgreSQL)
# - SLACK_BOT_TOKEN or SLACK_WEBHOOK_URL
# - SMTP credentials (for email alerts)3. 初始化数据库
python -c "from src.state.database import DatabaseManager; DatabaseManager().init_db()"4. 测试单个工作节点
python run_worker.py run customer_health_monitor5. 开始全天候24/7监控
python run_worker.py start______________________________________________________________________
📊 预配置的启动工作节点
包含5名高投资回报率(ROI)员工
| 工人 | 时间表 | 目的 | 预估月成本 | ||
|---|---|---|---|---|---|
| ** | ** 客户健康监测器 | ||||
| 每4小时 | 检测处于风险中的客户,健康评分下降 | 600美元 | ** | ** 交易风险分析器 | |
| 每6小时 | 标记停滞交易,预测偏差 | 480美元 | ** | ** 活动预算守护者 | |
| 每小时 | 防止广告超支,暂停失控的广告活动 | 480美元 | ** | ** 潜在客户评分引擎 | |
| 每30分钟 | 热门线索评分及路线规划,即时转化为销售 | 960美元 | ** | ** 支持SLA监控 |
| 每15分钟 | 防止SLA(服务级别协议)违约,升级紧急工单 | 1,920美元 | 总计:约4,440美元/月 | 预估价值:每月5万至20万美元
______________________________________________________________________
(防止客户流失,挽救交易,加快潜在客户跟进)
┌─────────────────────────────────────────────┐
│ Scheduler (APScheduler) │
│ Triggers workers on cron schedules │
└─────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│ Worker Orchestrator │
│ • Loads MCP servers dynamically │
│ • Calls Anthropic API (user's model) │
│ • Parses responses, triggers actions │
│ • Tracks costs, deduplicates alerts │
└─────────────────────────────────────────────┘
│
┌───────────┼───────────┐
▼ ▼ ▼
┌─────┐ ┌─────┐ ┌─────┐
│Sales│ │Mktg │ │ CS │ (MCP Servers)
│ MCP │ │ MCP │ │ MCP │
└─────┘ └─────┘ └─────┘
│
┌───────────┼───────────────┐
▼ ▼ ▼
[PostgreSQL] [Slack API] [Email SMTP]
(State) (Alerts) (Reports)🏗️ 建筑学
- 主要特点:模型无关的
- 为每个工作节点选择任意Claude模型(Sonnet、Haiku、Opus)MCP发现
- 自动查找您的MCP服务器有状态的
- PostgreSQL追踪运行情况、成本及警报动作插件
- 可扩展的(Slack、电子邮件、Webhook、数据库)成本控制
______________________________________________________________________
预算限制,人均代币上限
📋 配置
workers:
- name: my_custom_worker
description: Monitor X and alert on Y
server: sales # or marketing, customer_success
model: claude-3-5-sonnet-20241022 # YOU choose the model
schedule: "0 */4 * * *" # Cron expression
enabled: true
max_tokens: 50000
temperature: 1.0
prompt: |
Your detailed task instructions here.
The worker will use the specified MCP server tools.
actions:
- type: slack
config:
channel: "#alerts"
threshold: high_priority # or any_alerts, any_findings
- type: email
config:
to:
- team@company.com
subject: "Alert: {worker_name}"
threshold: high_priority
metadata:
category: sales
priority: high工作器配置(YAML)
max_monthly_cost_usd: 5000.0 # Hard limit
max_concurrent_workers: 5
retry_attempts: 3
alert_deduplication_hours: 24 # Don't spam same alert______________________________________________________________________
全局设置
🔌 MCP 服务器发现
- 该系统会按顺序自动查找您的MCP服务器: Claude 桌面配置
~/.config/claude/claude_desktop_config.json( - ) Cherry Studio 配置
~/.config/cherry-studio/mcp.json( - ) 环境变量
SALES_MCP_PATH(MARKETING_MCP_PATH,CS_MCP_PATH, - ) 默认路径
~/199os-sales-mcp(~/199os_marketing_mcp,
等
sales支持的服务器:marketing→ 199os-销售-MCP(62个工具,78个流程)customer_success→ 199os-marketing-mcp(80+工具,30个流程)
______________________________________________________________________
→ 199os-客户成功-MCP(54个工具,49个流程)
💰 成本管理
# Set monthly budget (system stops when exceeded)
max_monthly_cost_usd: 5000.0
# Per-worker token limits
max_tokens: 50000 # Prevents runaway costs
# Model selection affects cost
model: claude-3-5-sonnet-20241022 # $3/$15 per 1M tokens
model: claude-3-5-haiku-20241022 # $0.8/$4 per 1M tokens (80% cheaper!)预算控制
# View current spend
python run_worker.py status
# Output:
# 💰 Budget:
# Monthly Cost: $1,234.56
# Remaining: $3,765.44
# Utilization: 24.7%成本追踪
- 优化技巧 使用Haiku进行常规监控
- (节省80%的成本) 调整时间表
- (4小时对比1小时 = 成本降低4倍) 利用提示缓存
- (人类特征——缓存标记90%折扣) 批处理
______________________________________________________________________
(一次性分析100个项目 vs 分别进行100次调用)
📊 使用示例
python run_worker.py run customer_health_monitor运行单个工作节点(测试)
python run_worker.py start启动所有工人(生产)
python run_worker.py status检查系统状态
python run_worker.py list列出所有工作者
from src.state.database import DatabaseManager
db = DatabaseManager()
runs = db.get_recent_runs(limit=10)
for run in runs:
print(f"{run['worker_name']}: {run['status']} - ${run['cost_usd']}")______________________________________________________________________
查看最近运行记录
🔔 通知渠道
actions:
- type: slack
config:
channel: "#customer-alerts"
# Uses SLACK_BOT_TOKEN or SLACK_WEBHOOK_URL from .env
threshold: high_prioritySlack(音译为“斯拉克”,但通常直接使用原名)
actions:
- type: email
config:
to:
- team@company.com
- manager@company.com
subject: "[URGENT] {worker_name} Alert"
threshold: any_alerts电子邮件
actions:
- type: webhook
config:
url: "https://your-api.com/alerts"
method: POST
headers:
Authorization: "Bearer YOUR_TOKEN"______________________________________________________________________
自定义Webhooks
🗄️ 数据库模式
- 桌子 工人运行次数(或:工作运行)
- - 执行历史(状态、成本、令牌、结果) 警报
- - 发送警报(用于去重) 成本追踪
- - 每位员工的月成本 工作状态
- 工作者状态(上次运行、失败情况、启用/禁用)
# Get worker stats
db.get_worker_stats("customer_health_monitor", days=30)
# Check monthly cost
monthly_cost = db.get_monthly_cost()
# Should we send this alert? (deduplication)
should_send = db.should_send_alert(
worker_name="deal_risk_analyzer",
alert_key="deal:12345:high_risk",
deduplication_hours=24
)______________________________________________________________________
查询
🛠️ 创建自定义工作线程
步骤1:定义工作者 config/workers/my_worker.yaml创造
name: competitor_price_monitor
description: Track competitor pricing changes
server: marketing
model: claude-3-5-haiku-20241022 # Cheap for frequent checks
schedule: "0 */2 * * *" # Every 2 hours
enabled: true
prompt: |
Use the Marketing MCP tools to:
1. Fetch competitor pricing pages
2. Compare to our pricing
3. Identify any changes in last 24h
4. Calculate price gap percentage
Alert if competitor drops prices >10%.
actions:
- type: slack
config:
channel: "#competitive-intel"
threshold: any_alerts:
python run_worker.py run competitor_price_monitor步骤2:测试
第三步:部署
python run_worker.py start______________________________________________________________________
重启调度器 - 它会自动发现新的工作节点:
📈 生产部署
python run_worker.py start本地(开发)
sudo cp infrastructure/systemd/autonomous-worker.service /etc/systemd/system/
sudo systemctl enable autonomous-worker
sudo systemctl start autonomous-worker
sudo systemctl status autonomous-workerSystemd 服务(Linux)
docker-compose up -d
docker-compose logs -fDocker
# SSH into instance
git clone
cd 199os-autonomous-worker
pip install -r requirements.txt
cp .env.example .env
# Edit .env
python run_worker.py start
# Use tmux/screen to keep running
tmux new -s workers
python run_worker.py start
# Ctrl+B, D to detach______________________________________________________________________
云(AWS EC2,GCP Compute)
🔒 安全
- 凭证;资格;资历
.envAPI密钥存储在 - (从未提交过)
- PostgreSQL凭据在静止状态时加密
环境变量中的Slack/电子邮件凭据
- 数据库
- 带有SSL/TLS的PostgreSQL
- 最小权限的数据库用户
infrastructure/scripts/backup.sh定期备份(参见
)
- 网络
- 在防火墙后运行
- 限制数据库访问仅限于本地主机
______________________________________________________________________
使用VPN进行远程访问
📊 监控与可观测性
日志 structlog带有结构的JSON日志
{
"timestamp": "2025-10-14T12:00:00Z",
"level": "info",
"event": "worker_completed",
"worker": "customer_health_monitor",
"status": "success",
"cost_usd": 0.1234,
"actions": 2
}:
- 指标(即将推出)
:9090/metrics - Prometheus 上的指标
- Grafana 仪表板
______________________________________________________________________
警惕高成本、故障及预算超支
🚧 路线图
- 第一阶段:基础 ✅(完成)
- \[x\] 核心编排器
- \[x\] MCP服务器加载器
- \[x\] 与模型无关的人类中心主义客户端
- \[x\] 使用 cron 的调度器
- \[x\] 动作插件(Slack,电子邮件)
- \[x\] 数据库状态跟踪
\[x\] 5个初始工作者
- 第二阶段:智力提升(第二周)
- \[ \] 反馈循环(追踪警报准确性)
- \[ \] 自适应阈值(基于机器学习)
- \[ \] 成本优化建议
\[ \] 工作人员绩效仪表盘(Grafana)
- 第三阶段:扩展(第三周)
- \[ \] 工作者市场(共享/出售工作者)
- \[ \] 多租户支持
- \[ \] 用于外部集成的API
______________________________________________________________________
\[ \] 用于警报的手机应用
💡 团队使用案例
- 客户成功(或客户成功管理) 健康监测
- - 防止客户流失 使用分析
- - 检测掉队情况 净推荐值(NPS)追踪
- - 情感分析 入职培训完成
- 确保达到95%的比率
- 销售 交易风险
- - 救活搁浅的交易 管道卫生
- - 保持CRM(客户关系管理)系统的整洁 预测准确性
- - 每周更新 主导回应
- 5分钟SLA(服务级别协议)
- 市场营销 预算控制
- - 防止过度消费 活动表现
- - 失败者暂停,成功者扩大规模 潜在客户评分
- - 热门路线即时导流 竞争对手追踪
______________________________________________________________________
- 定价、广告、内容
🤝 贡献
- 我们欢迎投稿!
- 克隆(或分叉)该仓库
- 创建一个特性分支
- 进行你的更改
- 添加测试
提交拉取请求
- 投稿建议:
- 新的操作插件(PagerDuty、Teams、Discord)
- 工作者模板(SEO监控、社交聆听)
- 仪表盘用户界面(React + FastAPI)
______________________________________________________________________
移动应用(React Native)
📄 许可证 MIT 许可证 - 请参阅 许可证
______________________________________________________________________
文件。
______________________________________________________________________
support@199os.com(该邮箱地址的中文表述可直接为“support@199os.com”,但若需解释其用途或背景,可译为“用于联系199os的客服支持邮箱”等,不过在此直接给出邮箱地址的中文表述即可)
- 📚 相关项目销售MCP(多渠道营销计划/经理/专员等,具体含义需根据上下文确定)
/Users/evanpaliotta/199os-sales-mcp: - (62个工具)市场营销 MCP(注:MCP在此处可能代表某个特定的市场营销概念、策略或职位,但根据上下文无法确定具体含义,因此保留原样)
/Users/evanpaliotta/199os_marketing_mcp: - (80+种工具)客户成功管理专家(MCP)
/Users/evanpaliotta/199os-customer-success-mcp:
______________________________________________________________________
(54个工具)
由199OS团队用心打造
