chatlab-analyze-cn

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ChatLab 聊天分析

ChatLab Chat Analysis

通过只读
clb
CLI 查询和分析已经导入 ChatLab 的聊天记录。
Query and analyze chat records imported into ChatLab via the read-only
clb
CLI.

适用场景

Applicable Scenarios

  • 查找某段对话,或确认谁最先提到某件事。
  • 总结近期话题,或分析与某个人的聊天关系。
  • 比较成员活跃度、关键词或回复规律。
如果要导入新的聊天导出文件,请使用
chatlab-import-cn
安装命令:
bash
npx skills add ChatLab/ChatLab --skill chatlab-analyze-cn -g
  • Locate a specific conversation, or confirm who first mentioned something.
  • Summarize recent topics, or analyze chat relationships with a certain person.
  • Compare member activity, keywords, or reply patterns.
To import new chat export files, please use
chatlab-import-cn
.
Installation command:
bash
npx skills add ChatLab/ChatLab --skill chatlab-analyze-cn -g

工作流程

Workflow

1. 准备查询

1. Prepare the Query

检查 CLI、读取当前命令契约并列出会话:
bash
clb --help
clb manifest
clb sessions list --format json
只有一个相关会话时直接使用;多个会话或成员都可能匹配时,让用户从返回的候选项中选择。
Check the CLI, read the current command contract, and list sessions:
bash
clb --help
clb manifest
clb sessions list --format json
Use directly when there is only one relevant session; when multiple sessions or members may match, ask the user to select from the returned candidates.

2. 从专用命令开始

2. Start with Dedicated Commands

先使用能直接回答问题的最简单命令:
bash
clb messages search "<keyword>" --session <session-id> --format agent
clb messages between --member me --member <member> --session <session-id> --last 90d --format agent
clb topics list --session <session-id> --last 30d --format agent
读取消息文本时使用
--format agent
;侦察会话、成员、数量和
--no-content
搜索等结构时使用
--format json
Start with the simplest command that can directly answer the question:
bash
clb messages search "<keyword>" --session <session-id> --format agent
clb messages between --member me --member <member> --session <session-id> --last 90d --format agent
clb topics list --session <session-id> --last 30d --format agent
Use
--format agent
when reading message text; use
--format json
when scouting structures like sessions, members, counts, and
--no-content
searches.

3. 补充上下文或统计

3. Supplement Context or Statistics

只有第一步结果不足时再深入:
bash
clb messages context --id 1021 --session <session-id> --window 10 --format agent
clb stats keywords --session <session-id> --member <member> --last 90d --top 20 --format json
meta.hasMore
为 true 时,保持相同查询条件并使用
--cursor <meta.nextCursor>
继续。通过数量和 Token 参数只获取回答问题所需的上下文。
Dig deeper only when the results from the first step are insufficient:
bash
clb messages context --id 1021 --session <session-id> --window 10 --format agent
clb stats keywords --session <session-id> --member <member> --last 90d --top 20 --format json
When
meta.hasMore
is true, keep the same query conditions and continue with
--cursor <meta.nextCursor>
. Only retrieve the context needed to answer the question through quantity and Token parameters.

4. 最后才使用 SQL

4. Use SQL Only as a Last Resort

只有专用命令无法回答时,才使用只读 SQL:
bash
clb schema --session <session-id> --format json
clb sql "SELECT COUNT(*) AS n FROM message" --session <session-id> --format json
Use read-only SQL only when dedicated commands cannot answer the question:
bash
clb schema --session <session-id> --format json
clb sql "SELECT COUNT(*) AS n FROM message" --session <session-id> --format json

隐私与回答

Privacy and Responses

  • 绝不使用
    --raw
    、修改 ChatLab 数据、导入文件、更改配置或启动长期运行的服务。
  • 绝不泄露完整聊天记录。ChatLab 的安全输出会应用用户配置的隐私预处理。
  • 使用
    [#1021]
    [#1021*]
    [#1021-1024]
    等可用标记引用消息证据。
  • 先直接回答,说明实际查询的会话和时间范围,再区分观察到的事实与解释。
  • 分析关系时不要过度推断情绪意图。仅在修正方式明确时遵循
    error.hint
  • 优先使用用户当前使用的中文变体回答,命令、参数、JSON 字段和证据标记保持原样。
  • Never use
    --raw
    , modify ChatLab data, import files, change configurations, or start long-running services.
  • Never disclose complete chat records. ChatLab's secure output applies privacy preprocessing configured by the user.
  • Reference message evidence using available tags such as
    [#1021]
    ,
    [#1021*]
    , or
    [#1021-1024]
    .
  • Answer directly first, specify the actual queried session and time range, then distinguish between observed facts and interpretations.
  • Do not overinfer emotional intentions when analyzing relationships. Follow
    error.hint
    only when the correction method is clear.
  • Prioritize answering using the Chinese variant currently used by the user; keep commands, parameters, JSON fields, and evidence tags unchanged.