with one click
chat-history
当用户查询历史对话内容,如「我上次说了什么」「帮我找找关于 X 的对话」时使用
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
当用户查询历史对话内容,如「我上次说了什么」「帮我找找关于 X 的对话」时使用
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
基于 persona.md 的 personality_dims,按映射公式计算行为参数,写入 character_params.yaml。 由 calibrate_params 定时任务触发(每7天),或初始化完成时立即触发一次。 其他 SKILL/hook 在检测到 persona_checksum 不一致时,也会直接调用 recalculate.sh 同步重算。
v2.2 M3 · 对话历程摘要。RECENT_HISTORY.md 超过 30 条时,压缩旧条目为 3-5 句历程摘要 写入 memory/session_summary.md,防止长 context 导致角色漂移到共情模板。 被 memory_distill 在检测条数超阈时调用,或用户主动校验记忆时调用。
Companion Workspace 生活日志生成 SOP (v5.2)。 由 life_sim.yaml 定时任务触发(每 4 小时)。 从 material_pool 选真实素材,以"触发→反应"模板转译为角色生活日志。 内含:留白模式、用户倾诉强制呼应、降温规则、多形态衔接、失败降级链。
v5.1 关键词模板驱动 + 硬筛规则 + LLM 二审(锁外)+ 失败状态追踪。 由 material_fetch.yaml 定时任务触发(每 6 小时)。send_output: false。 读 memory/keyword_templates.yaml 生成查询,经 filters.yaml 硬筛后 LLM 二审打 fit_score 入库。
Companion Workspace 定时记忆提炼 SOP。 由 memory_distill.yaml 定时任务触发(每小时一次)。 从最近消息中提炼新信息,补充到 memory 文件,不重复已有内容。
Companion Workspace 记忆写入规范。 触发词:记住 / 对话结束时的自动检查 / 强烈情绪事件
Based on SOC occupation classification
| name | chat_history |
| description | 当用户查询历史对话内容,如「我上次说了什么」「帮我找找关于 X 的对话」时使用 |
| type | task |
| version | 1.0 |
本 skill 规范如何通过 chat_history_search.py 脚本查询当前频道的历史对话记录。
频道隔离由脚本强制执行:脚本从 SESSION_CONTEXT.md 读取 Channel key 和 DB path,
用户无法通过 CLI 参数指定其他频道,无论用户说什么都只能查到自己的频道。
用户询问历史对话内容时,例如:
从 SESSION_CONTEXT.md 读取:
- Session dir: <session_dir> ← --session-dir 参数(必须)
脚本会自动从该目录读取 Channel key 和 DB path,无需手动传入。
python3 {_skill_base}/chat_history_search.py \
--session-dir <session_dir>
# 查最近 3 天记录(默认 7 天)
--days 3
# 关键词全文搜索
--keyword "投资组合"
# 只看用户消息
--role user
# 只看 AI 回复
--role assistant
# 限制返回条数(默认 50)
--limit 20
# 只列 session 概览,不展开消息内容
--sessions
# 组合示例:最近 30 天含「行情」的消息,最多 20 条
python3 {_skill_base}/chat_history_search.py \
--session-dir <session_dir> \
--keyword "行情" --days 30 --limit 20
## 聊天记录查询结果
频道:p2p:ou_xxx:cli_yyy 查询范围:最近 7 天
共 2 个 session,8 条消息
### Session abc123 (2026-03-10 09:00 — 2026-03-10 18:30,状态:archived)
**[2026-03-10 09:00] user**:帮我分析今天行情
**[2026-03-10 09:01] assistant**:今日沪指收跌 0.5%…
### Session def456 (2026-03-16 10:00 — 2026-03-16 10:30,状态:active)
…
--sessions)共 2 个 session
- **abc123** 状态:archived 消息数:6 创建:2026-03-10 09:00:00
- **def456** 状态:active 消息数:2 创建:2026-03-16 10:00:00
--session-dir 必须使用 SESSION_CONTEXT.md 中的 Session dir 字段,不得修改[已截断,完整内容 N 字符]未找到符合条件的聊天记录,属于正常情况,无需报错