mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
docs(ai): reorganize AI guides into /ai section and refresh nav
- Move AI config/CLI guides under /ai with redirect stubs at old /usage paths
- Rewrite why-chatlab: lead with value, drop table for a two-item list
- Rename nav items ("为什么选择 ChatLab", "对接 ChatLab") for clarity
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
fcf30853e9
commit
3dc86cf0d2
26 files changed
+581
-300
No files matched your search
@@ -9,13 +9,19 @@ const enSidebar: DefaultTheme.SidebarItem[] = [
|
||||
{ text: 'Quick Start', link: '/usage/quick-start' },
|
||||
{ text: 'Export Chat Records', link: '/usage/how-to-export' },
|
||||
{ text: 'Import Chat Records', link: '/usage/how-to-import' },
|
||||
{ text: 'Configure AI', link: '/usage/how-to-config-ai' },
|
||||
{ text: 'External Agent Calls', link: '/usage/cli-query' },
|
||||
{ text: 'Troubleshooting', link: '/usage/troubleshooting' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Standards',
|
||||
text: 'AI Analysis',
|
||||
items: [
|
||||
{ text: 'Why ChatLab', link: '/ai/why-chatlab' },
|
||||
{ text: 'Analyze with Built-in AI', link: '/ai/chatlab-ai' },
|
||||
{ text: 'Analyze with an External AI Agent', link: '/ai/external-agent' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Integrate with ChatLab',
|
||||
items: [
|
||||
{ text: 'ChatLab Format', link: '/standard/chatlab-format' },
|
||||
{ text: 'AI Conversion Guide', link: '/standard/ai-converter' },
|
||||
@@ -37,14 +43,20 @@ const cnSidebar: DefaultTheme.SidebarItem[] = [
|
||||
{ text: '快速开始', link: '/cn/usage/quick-start' },
|
||||
{ text: '导出聊天记录', link: '/cn/usage/how-to-export' },
|
||||
{ text: '导入聊天记录', link: '/cn/usage/how-to-import' },
|
||||
{ text: '配置 AI', link: '/cn/usage/how-to-config-ai' },
|
||||
{ text: '外部 Agent 调用', link: '/cn/usage/cli-query' },
|
||||
{ text: '故障排查', link: '/cn/usage/troubleshooting' },
|
||||
{ text: '常见问题', link: '/cn/usage/faq' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: '适配 ChatLab',
|
||||
text: 'AI 分析',
|
||||
items: [
|
||||
{ text: '为什么选择 ChatLab', link: '/cn/ai/why-chatlab' },
|
||||
{ text: '使用内置 AI 分析', link: '/cn/ai/chatlab-ai' },
|
||||
{ text: '使用外部 AI Agent 分析', link: '/cn/ai/external-agent' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: '对接 ChatLab',
|
||||
items: [
|
||||
{ text: 'ChatLab Format', link: '/cn/standard/chatlab-format' },
|
||||
{ text: 'AI 辅助转换', link: '/cn/standard/ai-converter' },
|
||||
@@ -68,13 +80,19 @@ const twSidebar: DefaultTheme.SidebarItem[] = [
|
||||
{ text: '快速開始', link: '/tw/usage/quick-start' },
|
||||
{ text: '匯出聊天記錄', link: '/tw/usage/how-to-export' },
|
||||
{ text: '匯入聊天記錄', link: '/tw/usage/how-to-import' },
|
||||
{ text: '配置 AI', link: '/tw/usage/how-to-config-ai' },
|
||||
{ text: '故障排除', link: '/tw/usage/troubleshooting' },
|
||||
{ text: '常見問題', link: '/tw/usage/faq' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: '適配 ChatLab',
|
||||
text: 'AI 分析',
|
||||
items: [
|
||||
{ text: '為什麼選擇 ChatLab', link: '/tw/ai/why-chatlab' },
|
||||
{ text: '使用內建 AI 分析', link: '/tw/ai/chatlab-ai' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: '對接 ChatLab',
|
||||
items: [
|
||||
{ text: 'ChatLab Format', link: '/tw/standard/chatlab-format' },
|
||||
{ text: 'AI 輔助轉換', link: '/tw/standard/ai-converter' },
|
||||
@@ -145,6 +163,7 @@ export default defineConfig({
|
||||
sidebar: {
|
||||
'/': enSidebar,
|
||||
'/usage/': enSidebar,
|
||||
'/ai/': enSidebar,
|
||||
'/standard/': enSidebar,
|
||||
'/contributing/': enSidebar,
|
||||
},
|
||||
@@ -184,6 +203,7 @@ export default defineConfig({
|
||||
sidebar: {
|
||||
'/cn/': cnSidebar,
|
||||
'/cn/usage/': cnSidebar,
|
||||
'/cn/ai/': cnSidebar,
|
||||
'/cn/standard/': cnSidebar,
|
||||
'/cn/contributing/': cnSidebar,
|
||||
},
|
||||
@@ -226,6 +246,7 @@ export default defineConfig({
|
||||
sidebar: {
|
||||
'/tw/': twSidebar,
|
||||
'/tw/usage/': twSidebar,
|
||||
'/tw/ai/': twSidebar,
|
||||
'/tw/standard/': twSidebar,
|
||||
},
|
||||
outline: {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# 使用内置 AI 分析
|
||||
|
||||
在 ChatLab 中直接使用 AI 分析功能前,需要先配置一个可用的在线模型。
|
||||
|
||||
## 在线 AI 模型
|
||||
|
||||
这里以 deepseek 为例,其他的模型请自行搜索配置方法:
|
||||
|
||||
1. 访问 [Deepseek 官网](https://www.deepseek.com/),选择 API 开放平台,注册并登录
|
||||
|
||||

|
||||
|
||||
2. 选择左侧充值,充值你所需要的金额(建议先充 10 块钱,足够用很久了)
|
||||
|
||||

|
||||
|
||||
3. 选择左侧 API Keys,点击创建 API key,随便填写一个标题,然后复制 API Key
|
||||
|
||||

|
||||
|
||||
4. 打开 ChatLab,右下角点击设置,然后「模型配置」>「添加新配置」
|
||||
|
||||
把刚才复制的 API Key 填写到 API Keys 中,点击验证确认没问题后,点击右下角添加后,即可开始使用 AI 相关功能
|
||||
|
||||

|
||||
|
||||
5. 在左侧的用量信息中,你可以查看你充值和消费的额度
|
||||
|
||||

|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
layout: page
|
||||
title: 页面已迁移
|
||||
head:
|
||||
- - meta
|
||||
- http-equiv: refresh
|
||||
content: '0; url=/cn/ai/external-agent'
|
||||
- - meta
|
||||
- name: robots
|
||||
content: noindex
|
||||
- - link
|
||||
- rel: canonical
|
||||
href: https://docs.chatlab.fun/cn/ai/external-agent
|
||||
---
|
||||
|
||||
# 页面已迁移
|
||||
|
||||
正在前往[使用外部 AI Agent 分析](/cn/ai/external-agent)。
|
||||
@@ -0,0 +1,95 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# 使用外部 AI Agent 分析
|
||||
|
||||
ChatLab 可以让 Codex、Claude Code、HermesAgent 等 AI Agent 在本地查询和分析聊天记录。查询全程只读,默认经过脱敏和黑名单过滤,使用时无需打开 ChatLab 桌面端或 Web 界面。
|
||||
|
||||
## 开始使用
|
||||
|
||||
需要 Node.js 20 或更高版本,并已在 ChatLab 中导入聊天记录。安装 ChatLab CLI 和中文 Skill:
|
||||
|
||||
```bash
|
||||
npm install -g chatlab-cli
|
||||
npx skills add ChatLab/ChatLab --skill chatlab-analyze-cn -g
|
||||
```
|
||||
|
||||
安装后,可以在 Codex、Claude Code、Cursor 等外部 Agent 中直接说:
|
||||
|
||||
```text
|
||||
chatlab-analyze-cn 帮我分析我和小红的聊天记录
|
||||
```
|
||||
|
||||
这个技能会引导 Agent 先执行 `chatlab manifest` 获取机读命令清单,再用安全的 `--format agent/json` 查询聊天记录。
|
||||
|
||||
`chatlab-analyze-cn` 始终只读。如果你希望 Agent 导入新的聊天导出文件,请改用独立的 `chatlab-import-cn` Skill;它会先预览导入计划,再自动新建或增量导入,详见[导入聊天记录指南](/cn/usage/how-to-import)。
|
||||
|
||||
## 命令总览
|
||||
|
||||
```bash
|
||||
chatlab sessions list # 列出已导入的会话
|
||||
chatlab sessions show # 查看单个会话详情
|
||||
chatlab members list # 会话成员列表
|
||||
chatlab members history # 成员改名历史
|
||||
chatlab messages list # 按时间窗口列消息
|
||||
chatlab messages search <关键词...> # 关键词搜索(支持多词、上下文、翻页)
|
||||
chatlab messages context --id <id> # 查看某条消息前后现场
|
||||
chatlab messages between # 两个成员之间的对话
|
||||
chatlab stats overview # 会话概览统计
|
||||
chatlab stats activity # 成员活跃度排行
|
||||
chatlab stats time --by day # 时间分布(hour/weekday/day/month)
|
||||
chatlab stats keywords # 高频词(已过隐私过滤)
|
||||
chatlab stats response # 回复速度排行
|
||||
chatlab topics list # AI 分段摘要列表
|
||||
chatlab topics show --id <id> # 某个分段的原始消息
|
||||
chatlab sql "<SELECT ...>" # 只读 SQL 兜底(字符串默认脱敏)
|
||||
chatlab schema # 查看数据库表结构
|
||||
chatlab manifest # 机读命令清单(给 Agent 一次读全)
|
||||
```
|
||||
|
||||
只有一个会话时可省略 `--session`;多个会话时命令会返回候选列表提示消歧。
|
||||
|
||||
## 输出格式
|
||||
|
||||
通过 `--format` 显式指定:
|
||||
|
||||
- **`agent`**:推荐给 AI Agent 的格式。返回 JSON 信封,正文是经过完整预处理管道(清洗、黑名单、去噪、合并连续发言、脱敏、token 截断)的紧凑文本;单条消息标记 `[#id]` / `[#id*]` 可用于 `messages context --id`,合并块范围 `[#a-b]` 仅用于展示。
|
||||
- **`json`**:程序化解析格式。返回结构化消息数组,仍应用隐私步骤(清洗、黑名单、脱敏),但不合并、不去噪。适合 `--no-content`、`--fields` 之类的结构化勘察。
|
||||
- **`text`**:人类可读输出(终端默认)。
|
||||
|
||||
agent/json 模式下 stdout 只包含一个 JSON 响应信封,日志一律走 stderr:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"command": "messages.search",
|
||||
"data": { "text": "returned: 2\n\n--- 2026/6/1 ---\n[#1*] 09:00 老王: 今年五一去旅游吧..." },
|
||||
"meta": { "totalHits": 2, "returnedHits": 2, "hasMore": false, "preprocess": { "desensitized": true }, "apiVersion": 1 }
|
||||
}
|
||||
```
|
||||
|
||||
失败时返回 `{ "ok": false, "error": { "code", "message", "hint", "candidates" } }`,并配合语义化退出码:0 成功、2 参数错误/能力未开启、3 未找到、4 歧义(附候选列表)、5 SQL 错误。
|
||||
|
||||
## 常用查询参数
|
||||
|
||||
- **时间**:`--since` / `--until` 支持 `2026-06-01`、`"2026-06-01 08:30"`、ISO 8601、`today`、`yesterday`;`--last 30d` 支持 h/d/w。日期形式的 `--until` 包含整天,解析后的绝对边界回显在 `meta.timeRange`。
|
||||
- **成员**:`--member` 接受成员 id、精确名称或 `me`(数据所有者);重名时返回候选 id。
|
||||
- **翻页**:`meta.hasMore` 为 true 时,用 `--cursor <meta.nextCursor>` 取下一页;cursor 与查询条件绑定。
|
||||
- **Token 控制**:`--limit`(主对象数)、`--max-messages`(上下文展开上限)、`--max-tokens`(agent 正文预算,默认 4000)、`--max-chars`(单条内容截断)。
|
||||
|
||||
## 隐私边界
|
||||
|
||||
- 所有查询命令默认应用你在 ChatLab 设置中的脱敏规则与黑名单,包括 `stats keywords` 的词表、`topics list` 的摘要和 `sql` 结果中的字符串字段;`sql` 读取消息 `content` 列需要显式 `--raw`。
|
||||
- `--raw`(绕过预处理)默认禁用,仅当你显式执行 `chatlab config set cli.allow_raw true` 或设置 `CHATLAB_CLI_ALLOW_RAW=1` 后可用。
|
||||
- 不需要 SQL 兜底能力时,可用 `chatlab config set cli.allow_sql false` 关闭 `sql` 命令。
|
||||
|
||||
## 查询示例
|
||||
|
||||
典型配方——"谁最早提到某个问题?查看现场":
|
||||
|
||||
```bash
|
||||
chatlab messages search "服务器迁移" --sort asc --limit 5 --context 3 --format agent
|
||||
# 从返回文本的单条消息标记 [#1021*] 拿到消息 id,再深挖现场:
|
||||
chatlab messages context --id 1021 --window 10 --format agent
|
||||
```
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
layout: page
|
||||
title: 页面已迁移
|
||||
head:
|
||||
- - meta
|
||||
- http-equiv: refresh
|
||||
content: '0; url=/cn/ai/chatlab-ai'
|
||||
- - meta
|
||||
- name: robots
|
||||
content: noindex
|
||||
- - link
|
||||
- rel: canonical
|
||||
href: https://docs.chatlab.fun/cn/ai/chatlab-ai
|
||||
---
|
||||
|
||||
# 页面已迁移
|
||||
|
||||
正在前往[使用内置 AI 分析](/cn/ai/chatlab-ai)。
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# 为什么选择 ChatLab
|
||||
|
||||
聊天记录里藏着很多信息:你和某个人聊过什么、一个群最近在讨论什么、谁最活跃、什么时候最热闹。但导出的聊天文件动辄几万条消息,人翻不过来,直接丢给 AI 也不好用。
|
||||
|
||||
ChatLab 先把聊天记录整理成结构化数据,提问时只取出真正相关的部分交给 AI——**更快、更省,也更安全**。
|
||||
|
||||
## 为什么不直接把聊天文件发给 AI?
|
||||
|
||||
导出文件不是为 AI 准备的,整份上传常常会遇到三个问题:
|
||||
|
||||
- **太大读不完**:几万条消息超出模型一次能处理的长度,被截断后容易漏掉关键内容。
|
||||
- **夹带无关内容**:你只想问一件小事,却把大量无关的聊天也一并发了出去。
|
||||
- **隐私没法把关**:聊天里可能混着密码、银行卡号、身份证、住址等敏感信息,整份上传前很难逐条检查。
|
||||
|
||||
想知道“我和小红最近在聊什么”,其实用不着每次都上传全部记录。
|
||||
|
||||
## ChatLab 怎么解决
|
||||
|
||||
- **先整理,再分析**:把不同平台的聊天记录统一成会话、成员、消息,结构清晰、可检索。
|
||||
- **按需取数**:按时间、成员、关键词或统计条件,只取当前问题需要的那部分。
|
||||
- **本地优先**:数据存在你自己的电脑上,交给 AI 前会先脱敏、按黑名单过滤。
|
||||
|
||||
## 如何使用ChatLab提供的AI能力?
|
||||
|
||||
- **[内置 AI](/cn/ai/chatlab-ai)**:在 ChatLab 应用内配置一个 AI 模型,直接提问和分析。适合想开箱即用的人。
|
||||
- **[外部 AI Agent](/cn/ai/external-agent)**:安装 ChatLab CLI 和官方 Skill,让 Codex、Claude Code 等 Agent 查询你的聊天记录。适合已有常用 Agent、想复用现有工作流的人。
|
||||
|
||||
两种方式用的都是已导入 ChatLab 的记录,**默认都经过数据脱敏和黑名单过滤**。
|
||||
+1
-1
@@ -12,7 +12,7 @@ ChatLab 是一款免费、开源、本地优先的聊天记录分析工具,支
|
||||
- [ChatLab 介绍](/cn/intro) — 了解 ChatLab 是什么,以及它的核心功能。
|
||||
- [快速开始](/cn/usage/quick-start) — 安装 ChatLab 并完成第一次聊天记录导入的步骤指南。
|
||||
- [导出与导入](/cn/usage/how-to-export) — 从 WhatsApp、QQ、LINE 等平台导出聊天记录并导入 ChatLab 分析。
|
||||
- [配置 AI](/cn/usage/how-to-config-ai) — 接入 OpenAI、Claude、DeepSeek 等 AI 模型,用自然语言分析聊天内容。
|
||||
- [使用内置 AI 分析](/cn/ai/chatlab-ai) — 接入 OpenAI、Claude、DeepSeek 等 AI 模型,用自然语言分析聊天内容。
|
||||
- [故障排查](/cn/usage/troubleshooting) — 解决导入失败、格式不支持、AI 配置报错等常见问题。
|
||||
|
||||
## 开发者:对接 ChatLab
|
||||
|
||||
+14
-102
@@ -1,106 +1,18 @@
|
||||
---
|
||||
outline: deep
|
||||
layout: page
|
||||
title: 页面已迁移
|
||||
head:
|
||||
- - meta
|
||||
- http-equiv: refresh
|
||||
content: '0; url=/cn/ai/external-agent'
|
||||
- - meta
|
||||
- name: robots
|
||||
content: noindex
|
||||
- - link
|
||||
- rel: canonical
|
||||
href: https://docs.chatlab.fun/cn/ai/external-agent
|
||||
---
|
||||
|
||||
# 外部 Agent 调用
|
||||
# 页面已迁移
|
||||
|
||||
ChatLab 可以作为 Codex、Claude Code、HermesAgent 等外部 Agent 的本地聊天数据工具层。外部 Agent 负责对话、规划和总结,ChatLab 负责受控地读取、搜索、统计和整理本地聊天记录。
|
||||
|
||||
这种模式不需要打开 ChatLab 网页,也不需要先启动 ChatLab 桌面界面。外部 Agent 会按需调用轻量的 `chatlab` CLI,在本地完成受控查询、搜索和统计,并拿到已经过隐私预处理的文本。
|
||||
|
||||
## 适合什么场景
|
||||
|
||||
- 你已经在使用 Codex、Claude Code、HermesAgent 等外部 Agent,并希望复用它们的订阅、token、模型能力和工作流。
|
||||
- 你希望外部 Agent 能按需分析 ChatLab 里的聊天记录,但不想把原始数据库或完整聊天导出直接交给 Agent。
|
||||
- 你希望先由 ChatLab 完成脱敏、黑名单过滤、清洗、合并和截断,再把适合分析的文本与可追溯的单条消息 id 提供给 Agent。
|
||||
|
||||
`chatlab` CLI 提供一组面向 AI Agent 优化、同时人类可读的查询命令。所有查询命令只读,默认应用你在 ChatLab 中配置的隐私预处理(脱敏、黑名单)。
|
||||
|
||||
安装:`npm i chatlab-cli -g`(需要 Node.js ≥ 20),并先在 ChatLab 中导入聊天记录。
|
||||
|
||||
## 使用 AI Agent
|
||||
|
||||
推荐通过通用 Agent Skills CLI 安装官方中文 `chatlab-analyze-cn` 技能:
|
||||
|
||||
```bash
|
||||
npx skills add ChatLab/ChatLab --skill chatlab-analyze-cn -g
|
||||
```
|
||||
|
||||
安装后,可以在 Codex、Claude Code、Cursor 等外部 Agent 中直接说:
|
||||
|
||||
```text
|
||||
chatlab-analyze-cn 帮我分析我和小红的聊天记录
|
||||
```
|
||||
|
||||
这个技能会引导 Agent 先执行 `chatlab manifest` 获取机读命令清单,再用安全的 `--format agent/json` 查询聊天记录。
|
||||
|
||||
`chatlab-analyze-cn` 始终只读。如果你希望 Agent 导入新的聊天导出文件,请改用独立的 `chatlab-import-cn` Skill;它会先预览导入计划,再自动新建或增量导入,详见[导入聊天记录指南](./how-to-import.md)。
|
||||
|
||||
## 命令总览
|
||||
|
||||
```bash
|
||||
chatlab sessions list # 列出已导入的会话
|
||||
chatlab sessions show # 查看单个会话详情
|
||||
chatlab members list # 会话成员列表
|
||||
chatlab members history # 成员改名历史
|
||||
chatlab messages list # 按时间窗口列消息
|
||||
chatlab messages search <关键词...> # 关键词搜索(支持多词、上下文、翻页)
|
||||
chatlab messages context --id <id> # 查看某条消息前后现场
|
||||
chatlab messages between # 两个成员之间的对话
|
||||
chatlab stats overview # 会话概览统计
|
||||
chatlab stats activity # 成员活跃度排行
|
||||
chatlab stats time --by day # 时间分布(hour/weekday/day/month)
|
||||
chatlab stats keywords # 高频词(已过隐私过滤)
|
||||
chatlab stats response # 回复速度排行
|
||||
chatlab topics list # AI 分段摘要列表
|
||||
chatlab topics show --id <id> # 某个分段的原始消息
|
||||
chatlab sql "<SELECT ...>" # 只读 SQL 兜底(字符串默认脱敏)
|
||||
chatlab schema # 查看数据库表结构
|
||||
chatlab manifest # 机读命令清单(给 Agent 一次读全)
|
||||
```
|
||||
|
||||
只有一个会话时可省略 `--session`;多个会话时命令会返回候选列表提示消歧。
|
||||
|
||||
## 输出格式
|
||||
|
||||
通过 `--format` 显式指定:
|
||||
|
||||
- **`agent`**:推荐给 AI Agent 的格式。返回 JSON 信封,正文是经过完整预处理管道(清洗、黑名单、去噪、合并连续发言、脱敏、token 截断)的紧凑文本;单条消息标记 `[#id]` / `[#id*]` 可用于 `messages context --id`,合并块范围 `[#a-b]` 仅用于展示。
|
||||
- **`json`**:程序化解析格式。返回结构化消息数组,仍应用隐私步骤(清洗、黑名单、脱敏),但不合并、不去噪。适合 `--no-content`、`--fields` 之类的结构化勘察。
|
||||
- **`text`**:人类可读输出(终端默认)。
|
||||
|
||||
agent/json 模式下 stdout 只包含一个 JSON 响应信封,日志一律走 stderr:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"command": "messages.search",
|
||||
"data": { "text": "returned: 2\n\n--- 2026/6/1 ---\n[#1*] 09:00 老王: 今年五一去旅游吧..." },
|
||||
"meta": { "totalHits": 2, "returnedHits": 2, "hasMore": false, "preprocess": { "desensitized": true }, "apiVersion": 1 }
|
||||
}
|
||||
```
|
||||
|
||||
失败时返回 `{ "ok": false, "error": { "code", "message", "hint", "candidates" } }`,并配合语义化退出码:0 成功、2 参数错误/能力未开启、3 未找到、4 歧义(附候选列表)、5 SQL 错误。
|
||||
|
||||
## 常用查询参数
|
||||
|
||||
- **时间**:`--since` / `--until` 支持 `2026-06-01`、`"2026-06-01 08:30"`、ISO 8601、`today`、`yesterday`;`--last 30d` 支持 h/d/w。日期形式的 `--until` 包含整天,解析后的绝对边界回显在 `meta.timeRange`。
|
||||
- **成员**:`--member` 接受成员 id、精确名称或 `me`(数据所有者);重名时返回候选 id。
|
||||
- **翻页**:`meta.hasMore` 为 true 时,用 `--cursor <meta.nextCursor>` 取下一页;cursor 与查询条件绑定。
|
||||
- **Token 控制**:`--limit`(主对象数)、`--max-messages`(上下文展开上限)、`--max-tokens`(agent 正文预算,默认 4000)、`--max-chars`(单条内容截断)。
|
||||
|
||||
## 隐私边界
|
||||
|
||||
- 所有查询命令默认应用你在 ChatLab 设置中的脱敏规则与黑名单,包括 `stats keywords` 的词表、`topics list` 的摘要和 `sql` 结果中的字符串字段;`sql` 读取消息 `content` 列需要显式 `--raw`。
|
||||
- `--raw`(绕过预处理)默认禁用,仅当你显式执行 `chatlab config set cli.allow_raw true` 或设置 `CHATLAB_CLI_ALLOW_RAW=1` 后可用。
|
||||
- 不需要 SQL 兜底能力时,可用 `chatlab config set cli.allow_sql false` 关闭 `sql` 命令。
|
||||
|
||||
## 查询示例
|
||||
|
||||
典型配方——"谁最早提到某个问题?查看现场":
|
||||
|
||||
```bash
|
||||
chatlab messages search "服务器迁移" --sort asc --limit 5 --context 3 --format agent
|
||||
# 从返回文本的单条消息标记 [#1021*] 拿到消息 id,再深挖现场:
|
||||
chatlab messages context --id 1021 --window 10 --format agent
|
||||
```
|
||||
正在前往[使用外部 AI Agent 分析](/cn/ai/external-agent)。
|
||||
@@ -1,31 +1,18 @@
|
||||
---
|
||||
outline: deep
|
||||
layout: page
|
||||
title: 页面已迁移
|
||||
head:
|
||||
- - meta
|
||||
- http-equiv: refresh
|
||||
content: '0; url=/cn/ai/chatlab-ai'
|
||||
- - meta
|
||||
- name: robots
|
||||
content: noindex
|
||||
- - link
|
||||
- rel: canonical
|
||||
href: https://docs.chatlab.fun/cn/ai/chatlab-ai
|
||||
---
|
||||
|
||||
# 如何配置 AI 模型
|
||||
# 页面已迁移
|
||||
|
||||
## 在线 AI 模型
|
||||
|
||||
这里以 deepseek 为例,其他的模型请自行搜索配置方法:
|
||||
|
||||
1. 访问 [Deepseek 官网](https://www.deepseek.com/),选择 API 开放平台,注册并登录
|
||||
|
||||

|
||||
|
||||
2. 选择左侧充值,充值你所需要的金额(建议先充 10 块钱,足够用很久了)
|
||||
|
||||

|
||||
|
||||
3. 选择左侧 API Keys,点击创建 API key,随便填写一个标题,然后复制 API Key
|
||||
|
||||

|
||||
|
||||
4. 打开 ChatLab,右下角点击设置,然后「模型配置」>「添加新配置」
|
||||
|
||||
把刚才复制的 API Key 填写到 API Keys 中,点击验证确认没问题后,点击右下角添加后,即可开始使用 AI 相关功能
|
||||
|
||||

|
||||
|
||||
5. 在左侧的用量信息中,你可以查看你充值和消费的额度
|
||||
|
||||

|
||||
正在前往[使用内置 AI 分析](/cn/ai/chatlab-ai)。
|
||||
@@ -71,4 +71,4 @@ ChatLab 提供三种导入方式,适用于不同场景:
|
||||
|
||||
ChatLab 内置 AI Agent 功能,接入 AI 模型后即可通过自然语言探索你的聊天历史。
|
||||
|
||||
详细配置步骤请查看 [如何配置 AI 模型](/cn/usage/how-to-config-ai)。
|
||||
详细配置步骤请查看 [使用内置 AI 分析](/cn/ai/chatlab-ai)。
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Analyze with built-in AI
|
||||
|
||||
To use AI analysis directly in ChatLab, first configure an available online model.
|
||||
|
||||
## Online AI Models
|
||||
|
||||
Here we use DeepSeek as an example. For other models, please search for their configuration methods:
|
||||
|
||||
1. Visit [DeepSeek official website](https://www.deepseek.com/), select API Platform, register and log in
|
||||
|
||||

|
||||
|
||||
2. Select "Recharge" on the left side and add credit (we recommend starting with a small amount - it will last a long time)
|
||||
|
||||

|
||||
|
||||
3. Select "API Keys" on the left side, click "Create API key", enter any title, then copy the API Key
|
||||
|
||||

|
||||
|
||||
4. Open ChatLab, click Settings in the bottom right corner, then "Model Configuration" > "Add New Configuration"
|
||||
|
||||
Paste the API Key you copied into the API Keys field, click Verify to confirm it works, then click Add in the bottom right corner to start using AI features
|
||||
|
||||

|
||||
|
||||
5. In the usage information on the left, you can check your credit balance and consumption
|
||||
|
||||

|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
layout: page
|
||||
title: Page moved
|
||||
head:
|
||||
- - meta
|
||||
- http-equiv: refresh
|
||||
content: '0; url=/ai/external-agent'
|
||||
- - meta
|
||||
- name: robots
|
||||
content: noindex
|
||||
- - link
|
||||
- rel: canonical
|
||||
href: https://docs.chatlab.fun/ai/external-agent
|
||||
---
|
||||
|
||||
# Page moved
|
||||
|
||||
Redirecting to [Analyze with an External AI Agent](/ai/external-agent).
|
||||
@@ -0,0 +1,95 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Analyze with an external AI agent
|
||||
|
||||
ChatLab lets AI agents such as Codex, Claude Code, and HermesAgent query and analyze chat records locally. Queries are read-only, apply desensitization and blacklist filtering by default, and do not require the ChatLab desktop or web interface to be open.
|
||||
|
||||
## Get started
|
||||
|
||||
Node.js 20 or newer is required, and chat records must already be imported into ChatLab. Install ChatLab CLI and the English Skill:
|
||||
|
||||
```bash
|
||||
npm install -g chatlab-cli
|
||||
npx skills add ChatLab/ChatLab --skill chatlab-analyze -g
|
||||
```
|
||||
|
||||
After installation, ask Codex, Claude Code, Cursor, or another external agent:
|
||||
|
||||
```text
|
||||
chatlab-analyze help me analyze my chat history with Alice
|
||||
```
|
||||
|
||||
The skill tells the agent to run `chatlab manifest` first, then query chat records safely with explicit `--format agent/json` commands.
|
||||
|
||||
`chatlab-analyze` always remains read-only. To let an agent import a new chat export, use the separate `chatlab-import` skill; it previews the import, then automatically creates or incrementally updates a session. See the [Import Chat Records Guide](/usage/how-to-import).
|
||||
|
||||
## Command overview
|
||||
|
||||
```bash
|
||||
chatlab sessions list # List imported sessions
|
||||
chatlab sessions show # Session details
|
||||
chatlab members list # Session members
|
||||
chatlab members history # Member name history
|
||||
chatlab messages list # List messages in a time window
|
||||
chatlab messages search <keywords...> # Keyword search (multi-word, context, paging)
|
||||
chatlab messages context --id <id> # Messages around a specific id
|
||||
chatlab messages between # Conversation between two members
|
||||
chatlab stats overview # Session overview
|
||||
chatlab stats activity # Member activity ranking
|
||||
chatlab stats time --by day # Time distribution (hour/weekday/day/month)
|
||||
chatlab stats keywords # High-frequency words (privacy-filtered)
|
||||
chatlab stats response # Reply speed ranking
|
||||
chatlab topics list # AI segment summaries
|
||||
chatlab topics show --id <id> # Original messages of one segment
|
||||
chatlab sql "<SELECT ...>" # Read-only SQL fallback (strings desensitized)
|
||||
chatlab schema # Database schema
|
||||
chatlab manifest # Machine-readable command manifest for agents
|
||||
```
|
||||
|
||||
With a single session `--session` can be omitted; with multiple sessions, commands return candidates for disambiguation.
|
||||
|
||||
## Output formats
|
||||
|
||||
Pass `--format` explicitly:
|
||||
|
||||
- **`agent`**: recommended for AI agents. A JSON envelope whose body is compact text produced by the full preprocessing pipeline (cleaning, blacklist, denoising, merging consecutive messages, desensitization, token-aware truncation). Single-message markers `[#id]` / `[#id*]` can be used with `messages context --id`; merged ranges such as `[#a-b]` are display-only.
|
||||
- **`json`**: for programmatic parsing. Structured message items with privacy steps applied (cleaning, blacklist, desensitization) but no merging or denoising. The right choice for structural scouting with `--no-content` / `--fields`.
|
||||
- **`text`**: human-readable output (TTY default).
|
||||
|
||||
In agent/json mode stdout contains exactly one JSON envelope; logs go to stderr:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"command": "messages.search",
|
||||
"data": { "text": "returned: 2\n\n--- 2026/6/1 ---\n[#1*] 09:00 Wang: how about a trip on May Day..." },
|
||||
"meta": { "totalHits": 2, "returnedHits": 2, "hasMore": false, "preprocess": { "desensitized": true }, "apiVersion": 1 }
|
||||
}
|
||||
```
|
||||
|
||||
Failures return `{ "ok": false, "error": { "code", "message", "hint", "candidates" } }` with semantic exit codes: 0 success, 2 invalid argument or disabled capability, 3 not found, 4 ambiguous (with candidates), 5 SQL error.
|
||||
|
||||
## Common query parameters
|
||||
|
||||
- **Time**: `--since` / `--until` accept `2026-06-01`, `"2026-06-01 08:30"`, ISO 8601, `today`, `yesterday`; `--last 30d` supports h/d/w. Date-only `--until` includes the whole day; resolved bounds are echoed in `meta.timeRange`.
|
||||
- **Members**: `--member` accepts a member id, exact name, or `me` (the data owner); ambiguous names return candidate ids.
|
||||
- **Paging**: when `meta.hasMore` is true, pass `--cursor <meta.nextCursor>`; cursors are bound to the exact query conditions.
|
||||
- **Token budget**: `--limit` (primary objects), `--max-messages` (context expansion cap), `--max-tokens` (agent text budget, default 4000), `--max-chars` (per-message truncation).
|
||||
|
||||
## Privacy boundaries
|
||||
|
||||
- All query commands apply your ChatLab desensitize rules and blacklist by default — including the `stats keywords` vocabulary, `topics list` summaries, and string cells in `sql` results; reading the message `content` column with `sql` requires explicit `--raw`.
|
||||
- `--raw` (bypassing preprocessing) is disabled by default; it only works after you explicitly run `chatlab config set cli.allow_raw true` or set `CHATLAB_CLI_ALLOW_RAW=1`.
|
||||
- If you don't need the SQL fallback, disable it with `chatlab config set cli.allow_sql false`.
|
||||
|
||||
## Query example
|
||||
|
||||
A typical recipe — "who mentioned this first? inspect the surrounding context":
|
||||
|
||||
```bash
|
||||
chatlab messages search "server migration" --sort asc --limit 5 --context 3 --format agent
|
||||
# Take the message id from a single-message [#1021*] marker in the returned text, then dig in:
|
||||
chatlab messages context --id 1021 --window 10 --format agent
|
||||
```
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
layout: page
|
||||
title: Page moved
|
||||
head:
|
||||
- - meta
|
||||
- http-equiv: refresh
|
||||
content: '0; url=/ai/chatlab-ai'
|
||||
- - meta
|
||||
- name: robots
|
||||
content: noindex
|
||||
- - link
|
||||
- rel: canonical
|
||||
href: https://docs.chatlab.fun/ai/chatlab-ai
|
||||
---
|
||||
|
||||
# Page moved
|
||||
|
||||
Redirecting to [Analyze with built-in AI](/ai/chatlab-ai).
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# Why ChatLab
|
||||
|
||||
Your chat history holds a lot of useful information: what you discussed with someone, what a group has been talking about lately, who is most active, when things get busy. But an exported chat file easily runs to tens of thousands of messages — too many to read through, and not much use if you just hand it to an AI.
|
||||
|
||||
ChatLab organizes your chat records into structured data first, then sends only the part that actually matters to your question to the AI — **faster, cheaper, and safer**.
|
||||
|
||||
## Why not send the file directly to an AI?
|
||||
|
||||
Chat exports aren't built for AI, and uploading the whole file usually runs into three problems:
|
||||
|
||||
- **Too large to read:** tens of thousands of messages exceed what a model can take in at once, and truncation drops important context.
|
||||
- **Carries unrelated content:** you only want to ask about one thing, but a heap of unrelated conversations goes along with it.
|
||||
- **No way to vet privacy:** chat records may contain passwords, bank card numbers, ID numbers, or addresses, and it's hard to check every message before uploading the whole file.
|
||||
|
||||
To find out "what have Alice and I discussed recently?", you don't need to upload your entire history every time.
|
||||
|
||||
## How ChatLab solves it
|
||||
|
||||
- **Organize, then analyze:** normalizes records from different platforms into sessions, members, and messages — structured and searchable.
|
||||
- **Fetch on demand:** retrieves only the part your current question needs, by time, member, keyword, or statistical condition.
|
||||
- **Local first:** your data stays on your own computer, and can be desensitized and blacklist-filtered before it reaches an AI.
|
||||
|
||||
## How to use ChatLab's AI features
|
||||
|
||||
- **[Built-in AI](/ai/chatlab-ai):** configure an AI model inside ChatLab and ask questions directly. Best if you want it to work out of the box.
|
||||
- **[External AI agent](/ai/external-agent):** install the ChatLab CLI and the official Skill, and let agents like Codex or Claude Code query your chat records. Best if you already use an agent and want to reuse your existing workflow.
|
||||
|
||||
Both methods use records already imported into ChatLab, and **both apply desensitization and blacklist filtering by default**.
|
||||
+1
-1
@@ -12,7 +12,7 @@ ChatLab is a free, open-source, local-first chat history analysis tool. It suppo
|
||||
- [Introduction](/intro) — Learn what ChatLab is and what it can do.
|
||||
- [Quick Start](/usage/quick-start) — Step-by-step guide to installing ChatLab and importing your first chat records.
|
||||
- [Export & Import](/usage/how-to-export) — Export chat records from WhatsApp, QQ, LINE, and other platforms and import them into ChatLab.
|
||||
- [Configure AI](/usage/how-to-config-ai) — Connect OpenAI, Claude, DeepSeek, or other AI models to analyze your chat history in natural language.
|
||||
- [Analyze with built-in AI](/ai/chatlab-ai) — Connect OpenAI, Claude, DeepSeek, or another AI model to analyze your chat history in natural language.
|
||||
- [Troubleshooting](/usage/troubleshooting) — Fix common issues with failed imports, unsupported formats, and AI configuration errors.
|
||||
|
||||
## For Developers: Integrating with ChatLab
|
||||
|
||||
+14
-102
@@ -1,106 +1,18 @@
|
||||
---
|
||||
outline: deep
|
||||
layout: page
|
||||
title: Page moved
|
||||
head:
|
||||
- - meta
|
||||
- http-equiv: refresh
|
||||
content: '0; url=/ai/external-agent'
|
||||
- - meta
|
||||
- name: robots
|
||||
content: noindex
|
||||
- - link
|
||||
- rel: canonical
|
||||
href: https://docs.chatlab.fun/ai/external-agent
|
||||
---
|
||||
|
||||
# External Agent Calls
|
||||
# Page moved
|
||||
|
||||
ChatLab can act as the local chat-data tool layer for external agents such as Codex, Claude Code, and HermesAgent. The agent handles conversation, planning, and synthesis; ChatLab handles controlled local reads, search, statistics, and organization of local chat records.
|
||||
|
||||
This mode does not require opening the ChatLab web UI, and it does not require starting the ChatLab desktop interface first. External agents call the lightweight `chatlab` CLI on demand, run controlled local queries, searches, and statistics, then receive privacy-processed text.
|
||||
|
||||
## When to use it
|
||||
|
||||
- You already use an external agent such as Codex, Claude Code, or HermesAgent, and want to reuse its subscription, tokens, model capabilities, and workflow.
|
||||
- You want the agent to analyze ChatLab records on demand, but you do not want to hand it the raw database or a full chat export.
|
||||
- You want ChatLab to handle desensitization, blacklist filtering, cleaning, merging, and truncation before sending analysis-ready text and traceable single-message ids to the agent.
|
||||
|
||||
The `chatlab` CLI ships a set of query commands optimized for AI agents while staying human-readable. All query commands are read-only and apply your ChatLab privacy preprocessing (desensitization, blacklist) by default.
|
||||
|
||||
Install with `npm i chatlab-cli -g` (Node.js ≥ 20) and import chat records in ChatLab first.
|
||||
|
||||
## Use it with an AI agent
|
||||
|
||||
Install the official `chatlab-analyze` skill through the general Agent Skills CLI:
|
||||
|
||||
```bash
|
||||
npx skills add ChatLab/ChatLab --skill chatlab-analyze -g
|
||||
```
|
||||
|
||||
After installation, ask Codex, Claude Code, Cursor, or another external agent:
|
||||
|
||||
```text
|
||||
chatlab-analyze help me analyze my chat history with Alice
|
||||
```
|
||||
|
||||
The skill tells the agent to run `chatlab manifest` first, then query chat records safely with explicit `--format agent/json` commands.
|
||||
|
||||
`chatlab-analyze` always remains read-only. To let an agent import a new chat export, use the separate `chatlab-import` skill; it previews the import, then automatically creates or incrementally updates a session. See the [Import Chat Records Guide](./how-to-import.md).
|
||||
|
||||
## Command overview
|
||||
|
||||
```bash
|
||||
chatlab sessions list # List imported sessions
|
||||
chatlab sessions show # Session details
|
||||
chatlab members list # Session members
|
||||
chatlab members history # Member name history
|
||||
chatlab messages list # List messages in a time window
|
||||
chatlab messages search <keywords...> # Keyword search (multi-word, context, paging)
|
||||
chatlab messages context --id <id> # Messages around a specific id
|
||||
chatlab messages between # Conversation between two members
|
||||
chatlab stats overview # Session overview
|
||||
chatlab stats activity # Member activity ranking
|
||||
chatlab stats time --by day # Time distribution (hour/weekday/day/month)
|
||||
chatlab stats keywords # High-frequency words (privacy-filtered)
|
||||
chatlab stats response # Reply speed ranking
|
||||
chatlab topics list # AI segment summaries
|
||||
chatlab topics show --id <id> # Original messages of one segment
|
||||
chatlab sql "<SELECT ...>" # Read-only SQL fallback (strings desensitized)
|
||||
chatlab schema # Database schema
|
||||
chatlab manifest # Machine-readable command manifest for agents
|
||||
```
|
||||
|
||||
With a single session `--session` can be omitted; with multiple sessions, commands return candidates for disambiguation.
|
||||
|
||||
## Output formats
|
||||
|
||||
Pass `--format` explicitly:
|
||||
|
||||
- **`agent`**: recommended for AI agents. A JSON envelope whose body is compact text produced by the full preprocessing pipeline (cleaning, blacklist, denoising, merging consecutive messages, desensitization, token-aware truncation). Single-message markers `[#id]` / `[#id*]` can be used with `messages context --id`; merged ranges such as `[#a-b]` are display-only.
|
||||
- **`json`**: for programmatic parsing. Structured message items with privacy steps applied (cleaning, blacklist, desensitization) but no merging or denoising. The right choice for structural scouting with `--no-content` / `--fields`.
|
||||
- **`text`**: human-readable output (TTY default).
|
||||
|
||||
In agent/json mode stdout contains exactly one JSON envelope; logs go to stderr:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"command": "messages.search",
|
||||
"data": { "text": "returned: 2\n\n--- 2026/6/1 ---\n[#1*] 09:00 Wang: how about a trip on May Day..." },
|
||||
"meta": { "totalHits": 2, "returnedHits": 2, "hasMore": false, "preprocess": { "desensitized": true }, "apiVersion": 1 }
|
||||
}
|
||||
```
|
||||
|
||||
Failures return `{ "ok": false, "error": { "code", "message", "hint", "candidates" } }` with semantic exit codes: 0 success, 2 invalid argument or disabled capability, 3 not found, 4 ambiguous (with candidates), 5 SQL error.
|
||||
|
||||
## Common query parameters
|
||||
|
||||
- **Time**: `--since` / `--until` accept `2026-06-01`, `"2026-06-01 08:30"`, ISO 8601, `today`, `yesterday`; `--last 30d` supports h/d/w. Date-only `--until` includes the whole day; resolved bounds are echoed in `meta.timeRange`.
|
||||
- **Members**: `--member` accepts a member id, exact name, or `me` (the data owner); ambiguous names return candidate ids.
|
||||
- **Paging**: when `meta.hasMore` is true, pass `--cursor <meta.nextCursor>`; cursors are bound to the exact query conditions.
|
||||
- **Token budget**: `--limit` (primary objects), `--max-messages` (context expansion cap), `--max-tokens` (agent text budget, default 4000), `--max-chars` (per-message truncation).
|
||||
|
||||
## Privacy boundaries
|
||||
|
||||
- All query commands apply your ChatLab desensitize rules and blacklist by default — including the `stats keywords` vocabulary, `topics list` summaries, and string cells in `sql` results; reading the message `content` column with `sql` requires explicit `--raw`.
|
||||
- `--raw` (bypassing preprocessing) is disabled by default; it only works after you explicitly run `chatlab config set cli.allow_raw true` or set `CHATLAB_CLI_ALLOW_RAW=1`.
|
||||
- If you don't need the SQL fallback, disable it with `chatlab config set cli.allow_sql false`.
|
||||
|
||||
## Query example
|
||||
|
||||
A typical recipe — "who mentioned this first? inspect the surrounding context":
|
||||
|
||||
```bash
|
||||
chatlab messages search "server migration" --sort asc --limit 5 --context 3 --format agent
|
||||
# Take the message id from a single-message [#1021*] marker in the returned text, then dig in:
|
||||
chatlab messages context --id 1021 --window 10 --format agent
|
||||
```
|
||||
Redirecting to [Analyze with an External AI Agent](/ai/external-agent).
|
||||
@@ -1,31 +1,18 @@
|
||||
---
|
||||
outline: deep
|
||||
layout: page
|
||||
title: Page moved
|
||||
head:
|
||||
- - meta
|
||||
- http-equiv: refresh
|
||||
content: '0; url=/ai/chatlab-ai'
|
||||
- - meta
|
||||
- name: robots
|
||||
content: noindex
|
||||
- - link
|
||||
- rel: canonical
|
||||
href: https://docs.chatlab.fun/ai/chatlab-ai
|
||||
---
|
||||
|
||||
# How to Configure AI Models
|
||||
# Page moved
|
||||
|
||||
## Online AI Models
|
||||
|
||||
Here we use DeepSeek as an example. For other models, please search for their configuration methods:
|
||||
|
||||
1. Visit [DeepSeek official website](https://www.deepseek.com/), select API Platform, register and log in
|
||||
|
||||

|
||||
|
||||
2. Select "Recharge" on the left side and add credit (we recommend starting with a small amount - it will last a long time)
|
||||
|
||||

|
||||
|
||||
3. Select "API Keys" on the left side, click "Create API key", enter any title, then copy the API Key
|
||||
|
||||

|
||||
|
||||
4. Open ChatLab, click Settings in the bottom right corner, then "Model Configuration" > "Add New Configuration"
|
||||
|
||||
Paste the API Key you copied into the API Keys field, click Verify to confirm it works, then click Add in the bottom right corner to start using AI features
|
||||
|
||||

|
||||
|
||||
5. In the usage information on the left, you can check your credit balance and consumption
|
||||
|
||||

|
||||
Redirecting to [Analyze with built-in AI](/ai/chatlab-ai).
|
||||
@@ -69,4 +69,4 @@ If you're a developer looking to integrate **auto sync** or **API push**, see:
|
||||
|
||||
ChatLab comes with a built-in AI Agent. Connect a model and start asking questions about your chat history in natural language.
|
||||
|
||||
See [How to Configure AI](/usage/how-to-config-ai) for detailed setup steps.
|
||||
See [Analyze with built-in AI](/ai/chatlab-ai) for detailed setup steps.
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vitepress dev .",
|
||||
"dev": "vitepress dev . --port 3120",
|
||||
"build": "vitepress build .",
|
||||
"preview": "vitepress preview ."
|
||||
},
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# 使用內建 AI 分析
|
||||
|
||||
在 ChatLab 中直接使用 AI 分析功能前,需要先配置一個可用的線上模型。
|
||||
|
||||
## 在线 AI 模型
|
||||
|
||||
这里以 deepseek 为例,其他的模型请自行搜索配置方法:
|
||||
|
||||
1. 访问 [Deepseek 官网](https://www.deepseek.com/),选择 API 开放平台,注册并登录
|
||||
|
||||

|
||||
|
||||
2. 选择左侧充值,充值你所需要的金额(建议先充 10 块钱,足够用很久了)
|
||||
|
||||

|
||||
|
||||
3. 选择左侧 API Keys,点击创建 API key,随便填写一个标题,然后复制 API Key
|
||||
|
||||

|
||||
|
||||
4. 打开 ChatLab,右下角点击设置,然后「模型配置」>「添加新配置」
|
||||
|
||||
把刚才复制的 API Key 填写到 API Keys 中,点击验证确认没问题后,点击右下角添加后,即可开始使用 AI 相关功能
|
||||
|
||||

|
||||
|
||||
5. 在左侧的用量信息中,你可以查看你充值和消费的额度
|
||||
|
||||

|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
layout: page
|
||||
title: 頁面已遷移
|
||||
head:
|
||||
- - meta
|
||||
- http-equiv: refresh
|
||||
content: '0; url=/tw/ai/chatlab-ai'
|
||||
- - meta
|
||||
- name: robots
|
||||
content: noindex
|
||||
- - link
|
||||
- rel: canonical
|
||||
href: https://docs.chatlab.fun/tw/ai/chatlab-ai
|
||||
---
|
||||
|
||||
# 頁面已遷移
|
||||
|
||||
正在前往[使用內建 AI 分析](/tw/ai/chatlab-ai)。
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# 為什麼選擇 ChatLab
|
||||
|
||||
聊天記錄裡藏著很多資訊:你和某個人聊過什麼、一個群組最近在討論什麼、誰最活躍、什麼時候最熱鬧。但匯出的聊天檔案動輒幾萬則訊息,人翻不完,直接丟給 AI 也不好用。
|
||||
|
||||
ChatLab 會先把聊天記錄整理成結構化資料,提問時只取出真正相關的部分交給 AI——**更快、更省,也更安全**。
|
||||
|
||||
## 為什麼不直接把聊天檔案傳給 AI?
|
||||
|
||||
匯出檔案不是為 AI 準備的,整份上傳常常會遇到三個問題:
|
||||
|
||||
- **太大讀不完**:幾萬則訊息超出模型一次能處理的長度,被截斷後容易遺漏重要內容。
|
||||
- **夾帶無關內容**:你只想問一件小事,卻把大量無關的聊天也一併傳了出去。
|
||||
- **隱私沒法把關**:聊天裡可能混著密碼、銀行卡號、身分證、住址等敏感資訊,整份上傳前很難逐則檢查。
|
||||
|
||||
想知道「我和小紅最近在聊什麼」,其實用不著每次都上傳全部記錄。
|
||||
|
||||
## ChatLab 怎麼解決
|
||||
|
||||
- **先整理,再分析**:把不同平台的聊天記錄統一成工作階段、成員、訊息,結構清晰、可檢索。
|
||||
- **按需取資料**:依時間、成員、關鍵字或統計條件,只取目前問題需要的那部分。
|
||||
- **本機優先**:資料存在你自己的電腦上,交給 AI 前會先脫敏、依黑名單過濾。
|
||||
|
||||
## 如何使用 ChatLab 提供的 AI 能力?
|
||||
|
||||
- **[內建 AI](/tw/ai/chatlab-ai)**:在 ChatLab 應用程式內配置一個 AI 模型,直接提問和分析。適合想開箱即用的人。
|
||||
- **[外部 AI Agent](/ai/external-agent)(英文)**:安裝 ChatLab CLI 和官方 Skill,讓 Codex、Claude Code 等 Agent 查詢你的聊天記錄。適合已有常用 Agent、想沿用現有工作流程的人。
|
||||
|
||||
兩種方式用的都是已匯入 ChatLab 的記錄,**預設都經過資料脫敏和黑名單過濾**。
|
||||
+1
-1
@@ -14,7 +14,7 @@ title: ChatLab 文件
|
||||
|
||||
- [快速開始](/tw/usage/quick-start) — 匯入第一份聊天記錄,了解 ChatLab 的基礎使用流程。
|
||||
- [匯出與匯入](/tw/usage/how-to-export) — 準備來自不同平台的聊天記錄,並匯入 ChatLab 分析。
|
||||
- [配置 AI](/tw/usage/how-to-config-ai) — 連接 AI 模型,透過 Agent 工具探索聊天歷史。
|
||||
- [使用內建 AI 分析](/tw/ai/chatlab-ai) — 連接 AI 模型,透過 Agent 工具探索聊天歷史。
|
||||
- [故障排除](/tw/usage/troubleshooting) — 處理匯入、解析和 AI 配置中的常見問題。
|
||||
|
||||
## 標準
|
||||
|
||||
@@ -1,31 +1,18 @@
|
||||
---
|
||||
outline: deep
|
||||
layout: page
|
||||
title: 頁面已遷移
|
||||
head:
|
||||
- - meta
|
||||
- http-equiv: refresh
|
||||
content: '0; url=/tw/ai/chatlab-ai'
|
||||
- - meta
|
||||
- name: robots
|
||||
content: noindex
|
||||
- - link
|
||||
- rel: canonical
|
||||
href: https://docs.chatlab.fun/tw/ai/chatlab-ai
|
||||
---
|
||||
|
||||
# 如何配置 AI 模型
|
||||
# 頁面已遷移
|
||||
|
||||
## 在线 AI 模型
|
||||
|
||||
这里以 deepseek 为例,其他的模型请自行搜索配置方法:
|
||||
|
||||
1. 访问 [Deepseek 官网](https://www.deepseek.com/),选择 API 开放平台,注册并登录
|
||||
|
||||

|
||||
|
||||
2. 选择左侧充值,充值你所需要的金额(建议先充 10 块钱,足够用很久了)
|
||||
|
||||

|
||||
|
||||
3. 选择左侧 API Keys,点击创建 API key,随便填写一个标题,然后复制 API Key
|
||||
|
||||

|
||||
|
||||
4. 打开 ChatLab,右下角点击设置,然后「模型配置」>「添加新配置」
|
||||
|
||||
把刚才复制的 API Key 填写到 API Keys 中,点击验证确认没问题后,点击右下角添加后,即可开始使用 AI 相关功能
|
||||
|
||||

|
||||
|
||||
5. 在左侧的用量信息中,你可以查看你充值和消费的额度
|
||||
|
||||

|
||||
正在前往[使用內建 AI 分析](/tw/ai/chatlab-ai)。
|
||||
@@ -65,4 +65,4 @@ ChatLab 提供三種匯入方式,適用於不同場景:
|
||||
|
||||
ChatLab 內建 AI Agent 功能,接入 AI 模型後即可透過自然語言探索你的聊天歷史。
|
||||
|
||||
詳細配置步驟請查看 [如何配置 AI 模型](/tw/usage/how-to-config-ai)。
|
||||
詳細配置步驟請查看 [使用內建 AI 分析](/tw/ai/chatlab-ai)。
|
||||
Reference in new issue
Block a user