Proactive Agent
A proactive agent that anticipates needs and takes initiative. Monitors environment, suggests actions, and proposes tasks based on context.
Features
- - Context Analysis: Analyzes current time, market status, content pipeline
- Action Suggestion: Predicts needs and generates actionable suggestions
- Task Initiation: Proactively proposes tasks based on context
- Priority Management: 3-tier priority system (Trading > Content > Learning)
Quick Start
CODEBLOCK0
Components
1. Context Analyzer (scripts/context_analyzer.py)
Analyzes:
- - Current time slot (morningstartup, tradinghours, content_window, etc.)
- Market status (open/closed)
- Content pipeline status
- Pending tasks
- Recent interactions
2. Action Suggester (scripts/action_suggester.py)
Generates suggestions based on:
- - Time-based rules (trading hours, content window)
- Market conditions
- Content pipeline status
- Pending tasks
- Learning optimization needs
3. Task Initiator (scripts/task_initiator.py)
Proactively proposes tasks with:
- - Task ID and timestamp
- Priority level
- Step-by-step instructions
- Auto-save to file
4. Proactive Monitor (scripts/proactive_monitor.py)
Continuous monitoring:
- - Daemon mode for background operation
- Configurable check intervals
- Alert cooldown management
Configuration
Edit config/proactive_config.yaml:
CODEBLOCK1
Time Rules
The agent recognizes these time slots:
| Time Slot | Hours | Typical Actions |
|---|
| morningstartup | 06:00-09:00 | Check portfolio, review today's plan |
| tradinghours |
09:30-15:00 | Monitor stocks, evaluate opportunities |
| content_window | 15:00-17:00 | Publish content, optimize posts |
| evening_routine | 17:00-22:00 | Log daily summary, update memory |
| night_quiet | 22:00-06:00 | Stay quiet, minimal alerts |
Integration
With AGENTS.md
Add to session startup:
CODEBLOCK2
With HEARTBEAT.md
Add to heartbeat checks:
CODEBLOCK3
Example Output
CODEBLOCK4
Use Cases
- 1. Trading Assistant: Monitor market hours, suggest buy/sell decisions
- Content Creator: Remind to publish at optimal times
- Task Manager: Proactively propose tasks based on schedule
- Learning Agent: Suggest performance analysis and improvements
Requirements
- - Python 3.7+
- Works on Windows/Linux/macOS
Changelog
v1.0.0 (2026-03-25)
- - Initial release
- Context analyzer, action suggester, task initiator, proactive monitor
- Configuration system
- Time-based rules
主动式智能体
一个能够预测需求并主动采取行动的智能体。监控环境、建议行动、并根据上下文提出任务。
功能特性
- - 上下文分析:分析当前时间、市场状态、内容生产管线
- 行动建议:预测需求并生成可操作的建议
- 任务发起:根据上下文主动提出任务
- 优先级管理:三级优先级系统(交易 > 内容 > 学习)
快速开始
bash
获取下一个建议行动
python scripts/action_suggester.py --next
分析当前上下文
python scripts/context_analyzer.py --json
提出任务
python scripts/task_initiator.py --propose
组件
1. 上下文分析器 (scripts/context_analyzer.py)
分析内容:
- - 当前时间段(早晨启动、交易时段、内容窗口等)
- 市场状态(开市/闭市)
- 内容生产管线状态
- 待处理任务
- 近期交互记录
2. 行动建议器 (scripts/action_suggester.py)
基于以下因素生成建议:
- - 时间规则(交易时段、内容窗口)
- 市场条件
- 内容生产管线状态
- 待处理任务
- 学习优化需求
3. 任务发起器 (scripts/task_initiator.py)
主动提出任务,包含:
- - 任务ID和时间戳
- 优先级等级
- 分步操作说明
- 自动保存到文件
4. 主动监控器 (scripts/proactive_monitor.py)
持续监控:
- - 守护进程模式,支持后台运行
- 可配置的检查间隔
- 警报冷却管理
配置
编辑 config/proactive_config.yaml:
yaml
proactive_level: 7 # 1-10,数值越高越主动
monitor_interval: 300 # 检查间隔(秒)
alert_cooldown: 1800 # 警报冷却时间(秒)
priority_weights:
trading: 10
content: 8
tasks: 6
learning: 4
routine: 3
时间规则
智能体识别以下时间段:
| 时间段 | 时间范围 | 典型行动 |
|---|
| 早晨启动 | 06:00-09:00 | 检查投资组合,回顾今日计划 |
| 交易时段 |
09:30-15:00 | 监控股票,评估机会 |
| 内容窗口 | 15:00-17:00 | 发布内容,优化帖子 |
| 晚间例行 | 17:00-22:00 | 记录每日总结,更新记忆 |
| 夜间静默 | 22:00-06:00 | 保持静默,最小化警报 |
集成
与 AGENTS.md 集成
添加到会话启动:
- 1. 运行主动式智能体:python skills/proactive-agent/scripts/action_suggester.py --next
与 HEARTBEAT.md 集成
添加到心跳检查:
python skills/proactive-agent/scripts/action_suggester.py --next
示例输出
[高优先级] 盘中交易时段
建议:观察候选股票,等待买入机会
[高优先级] 下午内容发布窗口
建议:检查待发布内容,准备发布小红书笔记
[中优先级] 晚间例行检查
建议:检查今日数据,记录交易日志
使用场景
- 1. 交易助手:监控交易时间,建议买入/卖出决策
- 内容创作者:提醒在最佳时间发布内容
- 任务管理器:根据日程主动提出任务
- 学习智能体:建议性能分析和改进方案
系统要求
- - Python 3.7+
- 支持 Windows/Linux/macOS
更新日志
v1.0.0(2026-03-25)
- - 初始版本发布
- 上下文分析器、行动建议器、任务发起器、主动监控器
- 配置系统
- 基于时间的规则