From 3dc86cf0d24638ee64f099a9ae98892e140abb01 Mon Sep 17 00:00:00 2001 From: digua Date: Wed, 15 Jul 2026 03:44:32 -0700 Subject: [PATCH] docs(ai): reorganize AI guides into /ai section and refresh nav MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- docs/.vitepress/config.mts | 37 +++++++--- docs/cn/ai/chatlab-ai.md | 33 +++++++++ docs/cn/ai/cli-query.md | 18 +++++ docs/cn/ai/external-agent.md | 95 ++++++++++++++++++++++++ docs/cn/ai/how-to-config-ai.md | 18 +++++ docs/cn/ai/why-chatlab.md | 32 +++++++++ docs/cn/index.md | 2 +- docs/cn/usage/cli-query.md | 116 ++++-------------------------- docs/cn/usage/how-to-config-ai.md | 41 ++++------- docs/cn/usage/quick-start.md | 2 +- docs/en/ai/chatlab-ai.md | 33 +++++++++ docs/en/ai/cli-query.md | 18 +++++ docs/en/ai/external-agent.md | 95 ++++++++++++++++++++++++ docs/en/ai/how-to-config-ai.md | 18 +++++ docs/en/ai/why-chatlab.md | 32 +++++++++ docs/en/index.md | 2 +- docs/en/usage/cli-query.md | 116 ++++-------------------------- docs/en/usage/how-to-config-ai.md | 41 ++++------- docs/en/usage/quick-start.md | 2 +- docs/package.json | 2 +- docs/tw/ai/chatlab-ai.md | 33 +++++++++ docs/tw/ai/how-to-config-ai.md | 18 +++++ docs/tw/ai/why-chatlab.md | 32 +++++++++ docs/tw/index.md | 2 +- docs/tw/usage/how-to-config-ai.md | 41 ++++------- docs/tw/usage/quick-start.md | 2 +- 26 files changed, 581 insertions(+), 300 deletions(-) create mode 100644 docs/cn/ai/chatlab-ai.md create mode 100644 docs/cn/ai/cli-query.md create mode 100644 docs/cn/ai/external-agent.md create mode 100644 docs/cn/ai/how-to-config-ai.md create mode 100644 docs/cn/ai/why-chatlab.md create mode 100644 docs/en/ai/chatlab-ai.md create mode 100644 docs/en/ai/cli-query.md create mode 100644 docs/en/ai/external-agent.md create mode 100644 docs/en/ai/how-to-config-ai.md create mode 100644 docs/en/ai/why-chatlab.md create mode 100644 docs/tw/ai/chatlab-ai.md create mode 100644 docs/tw/ai/how-to-config-ai.md create mode 100644 docs/tw/ai/why-chatlab.md diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 473b6aca..c5a625e9 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -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: { diff --git a/docs/cn/ai/chatlab-ai.md b/docs/cn/ai/chatlab-ai.md new file mode 100644 index 00000000..41e6fdcf --- /dev/null +++ b/docs/cn/ai/chatlab-ai.md @@ -0,0 +1,33 @@ +--- +outline: deep +--- + +# 使用内置 AI 分析 + +在 ChatLab 中直接使用 AI 分析功能前,需要先配置一个可用的在线模型。 + +## 在线 AI 模型 + +这里以 deepseek 为例,其他的模型请自行搜索配置方法: + +1. 访问 [Deepseek 官网](https://www.deepseek.com/),选择 API 开放平台,注册并登录 + +![](/cn/img/ai-guide/1.png) + +2. 选择左侧充值,充值你所需要的金额(建议先充 10 块钱,足够用很久了) + +![](/cn/img/ai-guide/2.png) + +3. 选择左侧 API Keys,点击创建 API key,随便填写一个标题,然后复制 API Key + +![](/cn/img/ai-guide/3.png) + +4. 打开 ChatLab,右下角点击设置,然后「模型配置」>「添加新配置」 + +把刚才复制的 API Key 填写到 API Keys 中,点击验证确认没问题后,点击右下角添加后,即可开始使用 AI 相关功能 + +![](/cn/img/ai-guide/4.png) + +5. 在左侧的用量信息中,你可以查看你充值和消费的额度 + +![](/cn/img/ai-guide/5.png) diff --git a/docs/cn/ai/cli-query.md b/docs/cn/ai/cli-query.md new file mode 100644 index 00000000..36992fdc --- /dev/null +++ b/docs/cn/ai/cli-query.md @@ -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)。 diff --git a/docs/cn/ai/external-agent.md b/docs/cn/ai/external-agent.md new file mode 100644 index 00000000..7b39fdbf --- /dev/null +++ b/docs/cn/ai/external-agent.md @@ -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 # 查看某条消息前后现场 +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 # 某个分段的原始消息 +chatlab sql "" # 只读 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 ` 取下一页;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)。 diff --git a/docs/cn/usage/how-to-config-ai.md b/docs/cn/usage/how-to-config-ai.md index 88275ecc..e9984159 100644 --- a/docs/cn/usage/how-to-config-ai.md +++ b/docs/cn/usage/how-to-config-ai.md @@ -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 开放平台,注册并登录 - -![](/cn/img/ai-guide/1.png) - -2. 选择左侧充值,充值你所需要的金额(建议先充 10 块钱,足够用很久了) - -![](/cn/img/ai-guide/2.png) - -3. 选择左侧 API Keys,点击创建 API key,随便填写一个标题,然后复制 API Key - -![](/cn/img/ai-guide/3.png) - -4. 打开 ChatLab,右下角点击设置,然后「模型配置」>「添加新配置」 - -把刚才复制的 API Key 填写到 API Keys 中,点击验证确认没问题后,点击右下角添加后,即可开始使用 AI 相关功能 - -![](/cn/img/ai-guide/4.png) - -5. 在左侧的用量信息中,你可以查看你充值和消费的额度 - -![](/cn/img/ai-guide/5.png) +正在前往[使用内置 AI 分析](/cn/ai/chatlab-ai)。 diff --git a/docs/cn/usage/quick-start.md b/docs/cn/usage/quick-start.md index 2e685b6d..8f1c0abd 100644 --- a/docs/cn/usage/quick-start.md +++ b/docs/cn/usage/quick-start.md @@ -71,4 +71,4 @@ ChatLab 提供三种导入方式,适用于不同场景: ChatLab 内置 AI Agent 功能,接入 AI 模型后即可通过自然语言探索你的聊天历史。 -详细配置步骤请查看 [如何配置 AI 模型](/cn/usage/how-to-config-ai)。 +详细配置步骤请查看 [使用内置 AI 分析](/cn/ai/chatlab-ai)。 diff --git a/docs/en/ai/chatlab-ai.md b/docs/en/ai/chatlab-ai.md new file mode 100644 index 00000000..86cd286b --- /dev/null +++ b/docs/en/ai/chatlab-ai.md @@ -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 + +![](/en/img/ai-guide/1.png) + +2. Select "Recharge" on the left side and add credit (we recommend starting with a small amount - it will last a long time) + +![](/en/img/ai-guide/2.png) + +3. Select "API Keys" on the left side, click "Create API key", enter any title, then copy the API Key + +![](/en/img/ai-guide/3.png) + +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 + +![](/en/img/ai-guide/4.png) + +5. In the usage information on the left, you can check your credit balance and consumption + +![](/en/img/ai-guide/5.png) diff --git a/docs/en/ai/cli-query.md b/docs/en/ai/cli-query.md new file mode 100644 index 00000000..b5a37835 --- /dev/null +++ b/docs/en/ai/cli-query.md @@ -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). diff --git a/docs/en/ai/external-agent.md b/docs/en/ai/external-agent.md new file mode 100644 index 00000000..5bdca5da --- /dev/null +++ b/docs/en/ai/external-agent.md @@ -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 # Keyword search (multi-word, context, paging) +chatlab messages context --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 # Original messages of one segment +chatlab sql "" # 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 `; 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). diff --git a/docs/en/usage/how-to-config-ai.md b/docs/en/usage/how-to-config-ai.md index c9761e0b..375932df 100644 --- a/docs/en/usage/how-to-config-ai.md +++ b/docs/en/usage/how-to-config-ai.md @@ -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 - -![](/en/img/ai-guide/1.png) - -2. Select "Recharge" on the left side and add credit (we recommend starting with a small amount - it will last a long time) - -![](/en/img/ai-guide/2.png) - -3. Select "API Keys" on the left side, click "Create API key", enter any title, then copy the API Key - -![](/en/img/ai-guide/3.png) - -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 - -![](/en/img/ai-guide/4.png) - -5. In the usage information on the left, you can check your credit balance and consumption - -![](/en/img/ai-guide/5.png) +Redirecting to [Analyze with built-in AI](/ai/chatlab-ai). diff --git a/docs/en/usage/quick-start.md b/docs/en/usage/quick-start.md index b9326727..ff67765f 100644 --- a/docs/en/usage/quick-start.md +++ b/docs/en/usage/quick-start.md @@ -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. diff --git a/docs/package.json b/docs/package.json index 7b81b6d6..9ac59635 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,7 +4,7 @@ "private": true, "type": "module", "scripts": { - "dev": "vitepress dev .", + "dev": "vitepress dev . --port 3120", "build": "vitepress build .", "preview": "vitepress preview ." }, diff --git a/docs/tw/ai/chatlab-ai.md b/docs/tw/ai/chatlab-ai.md new file mode 100644 index 00000000..d7e8abac --- /dev/null +++ b/docs/tw/ai/chatlab-ai.md @@ -0,0 +1,33 @@ +--- +outline: deep +--- + +# 使用內建 AI 分析 + +在 ChatLab 中直接使用 AI 分析功能前,需要先配置一個可用的線上模型。 + +## 在线 AI 模型 + +这里以 deepseek 为例,其他的模型请自行搜索配置方法: + +1. 访问 [Deepseek 官网](https://www.deepseek.com/),选择 API 开放平台,注册并登录 + +![](/cn/img/ai-guide/1.png) + +2. 选择左侧充值,充值你所需要的金额(建议先充 10 块钱,足够用很久了) + +![](/cn/img/ai-guide/2.png) + +3. 选择左侧 API Keys,点击创建 API key,随便填写一个标题,然后复制 API Key + +![](/cn/img/ai-guide/3.png) + +4. 打开 ChatLab,右下角点击设置,然后「模型配置」>「添加新配置」 + +把刚才复制的 API Key 填写到 API Keys 中,点击验证确认没问题后,点击右下角添加后,即可开始使用 AI 相关功能 + +![](/cn/img/ai-guide/4.png) + +5. 在左侧的用量信息中,你可以查看你充值和消费的额度 + +![](/cn/img/ai-guide/5.png) diff --git a/docs/tw/ai/how-to-config-ai.md b/docs/tw/ai/how-to-config-ai.md new file mode 100644 index 00000000..b79820bf --- /dev/null +++ b/docs/tw/ai/how-to-config-ai.md @@ -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)。 diff --git a/docs/tw/ai/why-chatlab.md b/docs/tw/ai/why-chatlab.md new file mode 100644 index 00000000..3ff7dcd2 --- /dev/null +++ b/docs/tw/ai/why-chatlab.md @@ -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 的記錄,**預設都經過資料脫敏和黑名單過濾**。 diff --git a/docs/tw/index.md b/docs/tw/index.md index c6c30f12..9f321549 100644 --- a/docs/tw/index.md +++ b/docs/tw/index.md @@ -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 配置中的常見問題。 ## 標準 diff --git a/docs/tw/usage/how-to-config-ai.md b/docs/tw/usage/how-to-config-ai.md index 88275ecc..b79820bf 100644 --- a/docs/tw/usage/how-to-config-ai.md +++ b/docs/tw/usage/how-to-config-ai.md @@ -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 开放平台,注册并登录 - -![](/cn/img/ai-guide/1.png) - -2. 选择左侧充值,充值你所需要的金额(建议先充 10 块钱,足够用很久了) - -![](/cn/img/ai-guide/2.png) - -3. 选择左侧 API Keys,点击创建 API key,随便填写一个标题,然后复制 API Key - -![](/cn/img/ai-guide/3.png) - -4. 打开 ChatLab,右下角点击设置,然后「模型配置」>「添加新配置」 - -把刚才复制的 API Key 填写到 API Keys 中,点击验证确认没问题后,点击右下角添加后,即可开始使用 AI 相关功能 - -![](/cn/img/ai-guide/4.png) - -5. 在左侧的用量信息中,你可以查看你充值和消费的额度 - -![](/cn/img/ai-guide/5.png) +正在前往[使用內建 AI 分析](/tw/ai/chatlab-ai)。 diff --git a/docs/tw/usage/quick-start.md b/docs/tw/usage/quick-start.md index 45f16c0a..820df7ef 100644 --- a/docs/tw/usage/quick-start.md +++ b/docs/tw/usage/quick-start.md @@ -65,4 +65,4 @@ ChatLab 提供三種匯入方式,適用於不同場景: ChatLab 內建 AI Agent 功能,接入 AI 模型後即可透過自然語言探索你的聊天歷史。 -詳細配置步驟請查看 [如何配置 AI 模型](/tw/usage/how-to-config-ai)。 +詳細配置步驟請查看 [使用內建 AI 分析](/tw/ai/chatlab-ai)。