Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

更新快速上手文档

xiaoxiawang180033395959
diff --git a/README_CN.md b/README_CN.md
index b32ec1e299..f0905cf577 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -78,41 +78,35 @@ jiuwenclaw-tui
### 💬 使用方式
-#### 1️⃣ 对话模式
+📖 详细的快速上手指南,请参阅 [📖 快速开始文档](docs/zh/Quickstart.md),包含:
-| 方式 | 说明 |
-|------|-------------------------------------------|
-| **Web前端** | 启动服务后访问 `http://localhost:5173`,通过浏览器直接对话 |
-| **小艺频道** | 华为手机用户可直接唤醒小艺,与JiuwenClaw对话 |
-| **飞书频道** | 完成渠道配置后,在飞书中与JiuwenClaw畅聊 |
-
-#### 2️⃣ 配置模型
-
-在 Web 页面左侧找到「配置信息」,进入配置页面:
-
-![](docs/assets/images/jiuwenclaw_configuration_Info.png)
-
-完善以下四项基本配置,完成后点击右上角「保存」:
-
-![](docs/assets/images/jiuwenclaw_config_api.png)
-
-#### 3️⃣ 开始对话
-
-在 Web 页面左侧找到「对话」,输入问题即可开始:
+- **配置模型**:模型配置与API设置
+- **开始对话**:如何与JiuwenClaw对话
+- **会话管理**:清空会话的场景与效果对比
+- **清空记忆**:风险提示与操作步骤
-![](docs/assets/images/jiuwenclaw_example.png)
+快速启动命令:
-#### 4️⃣ 会话管理
-
-点击下方的「+」号,可清空当前会话并开启新会话:
+```bash
+# 安装并启动 JiuwenClaw
+pip install jiuwenclaw
+jiuwenclaw-init # 首次运行或升级后执行
+jiuwenclaw-start # 启动服务,访问 http://localhost:5173
-![](docs/assets/images/jiuwenclaw_new_session.png)
+# 或使用 TUI 版本
+pip install jiuwenclaw-tui
+jiuwenclaw-tui
+```
-清理后页面显示:
+### 💬 对话模式
-![](docs/assets/images/jiuwenclaw_clear_session.png)
+| 方式 | 说明 |
+|------|-------------------------------------------|
+| **Web前端** | 启动服务后访问 `http://localhost:5173`,通过浏览器直接对话 |
+| **小艺频道** | 华为手机用户可直接唤醒小艺,与JiuwenClaw对话 |
+| **飞书频道** | 完成渠道配置后,在飞书中与JiuwenClaw畅聊 |
-#### 5️⃣ 定时任务
+### ⏰ 定时任务
设置心跳任务,填写待办事项,JiuwenClaw即可定时被唤醒,自动执行预设任务。让你的日程管理更加智能高效!
diff --git a/docs/assets/images/jiuwenclaw_config_api.png b/docs/assets/images/jiuwenclaw_config_api.png
index cffffe5362..fe9f0bc065 100644
Binary files a/docs/assets/images/jiuwenclaw_config_api.png and b/docs/assets/images/jiuwenclaw_config_api.png differ
diff --git a/docs/en/Quickstart.md b/docs/en/Quickstart.md
index be45ec86f4..f077e35b4d 100644
--- a/docs/en/Quickstart.md
+++ b/docs/en/Quickstart.md
@@ -2,157 +2,179 @@
> **⚠️ Version Sync**: This document should be kept in sync with [`docs/zh/Quickstart.md`](../zh/Quickstart.md). When updating one, please update the other.
-JiuwenClaw provides two installation methods: `pip install` or `install from source`.
+## Installation
-## Prerequisites
+### Prerequisites
-- Download JiuwenClaw code:
- ```bash
- git clone https://gitcode.com/openjiuwen/jiuwenclaw.git
- ```
-- Environment dependencies:
- - Python: >=3.11, <3.14
- - Node.js: >=18.0.0 (only needed for building frontend from source or for browser-use functionality; 20 LTS recommended)
+Before installing JiuwenClaw, ensure your system meets the following requirements:
-**Note: Users can choose any of the following installation methods based on their needs.**
+| Dependency | Version | Description |
+|------------|---------|-------------|
+| Operating System | Windows 10/11, macOS 10.15+, Linux | Supports mainstream operating systems |
+| Python | ≥3.11, <3.14 | Python 3.11 recommended |
+| Node.js | 18.x or higher | For frontend interface |
+| Git | Latest | For source code installation |
-## Method 1: pip Install
+Check Node.js version:
-Suitable for users who manage their own Python environment. Follow these steps:
+```bash
+node --version
+# Expected output: v18.x.x or higher
+```
-- Create a virtual environment & install JiuwenClaw
+### pip Install
- ```bash
- # Create a virtual environment named jiuwenclaw
- python -m venv jiuwenclaw
+```bash
+# Create virtual environment
+python -m venv jiuwenclaw
- # Activate the jiuwenclaw virtual environment
- jiuwenclaw\Scripts\activate
+# Activate virtual environment
+# Windows:
+jiuwenclaw\Scripts\activate
+# Linux/Mac:
+source jiuwenclaw/bin/activate
- # Install JiuwenClaw
- pip install jiuwenclaw
- ```
+# Install JiuwenClaw
+pip install jiuwenclaw
+```
-- Initialize & start JiuwenClaw
+## Start Service
- ```bash
- # Initialize JiuwenClaw (first time setup)
- jiuwenclaw-init
+```bash
+# Initialize (first run)
+jiuwenclaw-init
- # Start JiuwenClaw
- jiuwenclaw-start
- ```
+# Start service
+jiuwenclaw-start
+```
- After running, you can access the JiuwenClaw web UI. The default local access URL is `http://localhost:5173`.
+After successful startup, the terminal will display backend service status:
- **Note:** For remote access, run the following commands:
+```
+[INFO] Starting JiuwenClaw server...
+[INFO] API server running at http://localhost:8000
+[INFO] Web server running at http://localhost:5173
+```
- ```bash
- # Start web service
- jiuwenclaw-web --host 0.0.0.0 --port <custom-port>
+When you see similar output, the service is ready. Open `http://localhost:5173` in your browser to use.
- # Start backend service
- jiuwenclaw-app
- ```
+### Remote Access (Optional)
-## Method 2: Install from Source
+For remote access, run the following commands:
-Suitable for users who perform custom development or adaptation based on JiuwenClaw.
+```bash
+# Start web service
+jiuwenclaw-web --host 0.0.0.0 --port <custom-port>
-### uv Installation
+# Start backend service
+jiuwenclaw-app
+```
-- Create a virtual environment with `uv`
- ```bash
- # Create a virtual environment with uv (supports any of 3.11, 3.12, 3.13)
- uv venv --python=3.11
- # or: uv venv --python=3.12
- # or: uv venv --python=3.13
- ```
+## Configure Model
-- Run uv sync
+In the left sidebar of the Web UI, find "Configuration" and enter the configuration page:
- Navigate to the project root directory `jiuwenclaw/` and run:
- ```bash
- uv sync
- ```
+![](../assets/images/jiuwenclaw_configuration_Info.png)
-- Install frontend dependencies
+Complete the following basic configuration, then click "Save" in the top right:
- Navigate to the frontend directory `jiuwenclaw/channels/web/frontend` and install dependencies:
- ```bash
- cd jiuwenclaw/channels/web/frontend
- npm install
- ```
+![](../assets/images/jiuwenclaw_config_api.png)
-- Run frontend service
+**Configuration Items:**
- Two methods are available for running the frontend service:
+| Field | Environment variable | Description | Required |
+|--------|------------------------|-------------|----------|
+| `model_name` | `MODEL_NAME` | Model name, e.g., `deepseek-chat`, `gpt-4o` | ✅ Required |
+| `api_base` | `API_BASE` | Model API base URL, e.g., `https://api.deepseek.com` | ✅ Required |
+| `api_key` | `API_KEY` | Model API key | ✅ Required |
+| `model_provider` | `MODEL_PROVIDER` | Model provider, e.g., `OpenAI`, `DeepSeek`, `Anthropic` | ✅ Required |
- - Static frontend service (suitable for production deployment)
- ```bash
- npm run build
- cd ../../
- uv run jiuwenclaw-init
- uv run jiuwenclaw-start
- ```
+**Test After Configuration:**
- - Dynamic frontend service (suitable for development and debugging)
- ```bash
- cd ../../
- uv run jiuwenclaw-init
- uv run jiuwenclaw-start dev
- ```
+After filling in the configuration, click the "Test" button to verify model availability. A successful test shows ✅, if failed check:
+- Whether API Key is correct
+- Whether API Base URL is accessible
+- Whether model name and Provider match
- After running, you can access the JiuwenClaw web UI.
+**Notes:**
-### conda Installation
+- **Auto-restart after save**: Backend automatically restarts to load new configuration
+- **Required fields**: The four fields above are basic configuration required for normal operation
+- **Model Providers**: `OpenAI`, `DashScope`, `SiliconFlow`, `InferenceAffinity`
-- Create a virtual environment with `conda`
- ```bash
- # Create a virtual environment with Anaconda (supports any of 3.11, 3.12, 3.13)
- conda create -n JiuwenClaw python=3.11
- # or: conda create -n JiuwenClaw python=3.12
- # or: conda create -n JiuwenClaw python=3.13
- ```
+## Start Conversation
-- Install Python dependencies
+In the left sidebar of the Web UI, find "Chat" and enter your question to start:
- Navigate to the project root directory `jiuwenclaw/` and run:
- ```bash
- # Mode 1: Development installation (recommended, facilitates code modification)
- pip install -e .
+![](../assets/images/jiuwenclaw_example.png)
- # Mode 2: Regular installation
- pip install .
- ```
- **Note:** This installation method relies on the project's installable package (pyproject.toml) and will install `jiuwenclaw` itself by default.
+## Session Management
+
+Click the "+" button below to clear the current session and start a new one:
+
+![](../assets/images/jiuwenclaw_new_session.png)
+
+Page display after clearing:
+
+![](../assets/images/jiuwenclaw_clear_session.png)
-- Install frontend dependencies
+**When to clear a session?**
+<<<<<<< HEAD
Navigate to the frontend directory `jiuwenclaw/channels/web/frontend` and install dependencies:
```bash
cd jiuwenclaw/channels/web/frontend
npm install
```
+=======
+| Scenario | Description |
+|----------|-------------|
+| **Topic Switch** | Current conversation is complete, want to start a completely new topic |
+| **Context Confusion** | Too much content in current session, model understanding deviates |
+| **Repeated/Wrong Response** | Model falls into loop response or gives irrelevant answers |
+| **Privacy/Sensitive Info** | Current session contains temporary sensitive information that needs immediate clearing |
+>>>>>>> 6e8b643 (docs(Quickstart): 同步中英文版本,补充环境要求)
+
+**Comparison: Clear vs Not Clear Session:**
+
+| Comparison | Not Clear (Continue Session) | Clear (New Session) |
+|------------|------------------------------|---------------------|
+| **Context Retention** | ✅ Keep all history, model knows full context | ❌ No history retained, model starts from scratch |
+| **Token Consumption** | ⚠️ Grows with conversation, consumes more tokens | ✅ Initial tokens minimal, cost controllable |
+| **Answer Relevance** | Early topics may interfere with current understanding | Each question processed independently, no interference |
+| **Privacy Security** | History persists in current session | Sensitive info not carried to new session |
+
+## Clear Memory
+
+When you need JiuwenClaw to forget all conversation history and user information, you can clear memory files.
+
+> **⚠️ Risk Warning:** Clearing memory is **permanent**, deleted memory files **cannot be recovered**. Before proceeding, confirm:
+> - Whether important memories are backed up
+> - Whether you really need to delete (or just want to start a new session)
+
+**Difference from Session Clearing:**
+
+| Operation | Scope | Impact | Use Case |
+|-----------|-------|--------|----------|
+| **New Session** | Current chat window | Does not delete any memory, only starts new thread | Want to switch topics but keep historical memory for reference |
+| **Clear Memory** | All memory files | Permanently deletes all history, user info, project memory | Completely clear all history, protect privacy, or reset to initial state |
+
+**Use Cases:**
+- **Privacy Protection**: Clear history containing sensitive information
+- **Fresh Start**: Start a completely different project or topic, avoid historical interference
+- **Debug Troubleshooting**: Reset when memory files are corrupted or content is abnormal
+- **User Switching**: Clear previous user info in multi-user environments
-- Run frontend service
+**Steps to Clear Memory:**
- Two methods are available for running the frontend service:
+Memory files are stored in `{workspace_dir}/memory/` directory:
- - Static frontend service (suitable for production deployment)
- ```bash
- npm run build
- cd ../../
- jiuwenclaw-init
- jiuwenclaw-start
- ```
+**Method 1: Delete via Agent**
+Tell JiuwenClaw: "Please delete all memory files" or "Clear my memory", Agent will call file tools to delete files in the memory directory.
+![](../assets/images/jiuwenclaw_delete_memory.png)
- - Dynamic frontend service (suitable for development and debugging)
- ```bash
- cd ../../
- # Start directly (without using uv run)
- jiuwenclaw-init
- jiuwenclaw-start dev
- ```
+**Method 2: Manual Delete**
+Stop JiuwenClaw service, then directly delete all Markdown files in the `memory/` directory.
+![](../assets/images/jiuwenclaw_memory.png)
- After running, you can access the JiuwenClaw web UI.
+> ⚠️ **Note**: Memory cannot be recovered after clearing, proceed with caution. Regularly backup important memory files.
diff --git a/docs/zh/Quickstart.md b/docs/zh/Quickstart.md
index d518c4c9ca..629fef3b71 100644
--- a/docs/zh/Quickstart.md
+++ b/docs/zh/Quickstart.md
@@ -2,59 +2,63 @@
> **⚠️ 版本同步**: 本文档应与英文版 [`docs/en/Quickstart.md`](../en/Quickstart.md) 保持同步。更新一版时请同时更新另一版。
-JiuwenClaw提供两种安装方式:`pip安装`或`源码安装`。
+## 安装
-安装前准备:
-- JiuwenClaw代码下载
- ```bash
- git clone https://gitcode.com/openjiuwen/jiuwenclaw.git
- ```
-- 环境依赖:
- - python:>=3.11,<3.14
- - nodejs:>=18.0.0(仅源码前端构建或 browser-use 功能需要,推荐 20 LTS)
+### 环境要求
-**注意:用户可根据自己实际需要,基于以下任意一种方案安装。**
+在安装 JiuwenClaw 之前,请确保您的系统满足以下要求:
-## **方式一:pip安装**
+| 依赖项 | 版本要求 | 说明 |
+|--------|----------|------|
+| 操作系统 | Windows 10/11, macOS 10.15+, Linux | 支持主流操作系统 |
+| Python | ≥3.11, <3.14 | 推荐使用 Python 3.11 |
+| Node.js | 18.x 或更高版本 | 用于前端界面 |
+| Git | 最新版本 | 用于源码安装 |
-​适合自行管理Python环境的用户。具体操作如下:
-- 创建虚拟环境 & 安装 jiuwenclaw 项目
+检查 Node.js 版本:
- ```bash
- # 创建名为 Jiuwenclaw 的虚拟环境
- python -m venv jiuwenclaw
+```bash
+node --version
+# 预期输出:v18.x.x 或更高
+```
- # 激活 Jiuwenclaw 虚拟环境
- jiuwenclaw\Scripts\activate
+### pip 安装
- # 安装 Jiuwenclaw
- pip install jiuwenclaw
- ```
+```bash
+# 创建虚拟环境
+python -m venv jiuwenclaw
-- 初始化 & 启动 jiuwenclaw 项目
+# 激活虚拟环境
+# Windows:
+jiuwenclaw\Scripts\activate
+# Linux/Mac:
+source jiuwenclaw/bin/activate
- ```bash
- # 初始化 JiuwenClaw (首次启动)
- jiuwenclaw-init
+# 安装 JiuwenClaw
+pip install jiuwenclaw
+```
- # 启动 JiuwenClaw
- jiuwenclaw-start
- ```
+## 启动服务
- 运行完成后即可在网页前端访问JiuwenClaw服务,默认网页本地访问 `http://localhost:5173`。
+```bash
+# 初始化(首次运行)
+jiuwenclaw-init
- **注:** 如需远程访问可以执行入下命令:
+# 启动服务
+jiuwenclaw-start
+```
- ``````
- # 启动web服务
- jiuwenclaw-web --host 0.0.0.0 --port 自定义端口
+启动成功后,终端会显示后端服务运行状态:
- # 启动后端服务
- jiuwenclaw-app
- ``````
+```
+[INFO] Starting JiuwenClaw server...
+[INFO] API server running at http://localhost:8000
+[INFO] Web server running at http://localhost:5173
+```
-## **方式二:源码运行**
+当看到类似上述提示时,表示服务已启动,在浏览器中访问 `http://localhost:5173` 即可使用。
+<<<<<<< HEAD
​适合基于JiuwenClaw进行二次开发适配的用户。
### `uv`方式安装
@@ -67,7 +71,7 @@ JiuwenClaw提供两种安装方式:`pip安装`或`源码安装`。
```
- 执行uv同步操作
-
+
进入项目根目录`jiuwenclaw/`执行:
```bash
uv sync
@@ -110,7 +114,7 @@ JiuwenClaw提供两种安装方式:`pip安装`或`源码安装`。
# 或 conda create -n JiuwenClaw python=3.13
```
- 安装python依赖
-
+
进入项目根目录`jiuwenclaw/`执行:
```bash
# 模式1:开发模式安装(推荐,便于修改代码)
@@ -149,3 +153,130 @@ JiuwenClaw提供两种安装方式:`pip安装`或`源码安装`。
```
运行完成后即可在网页前端访问JiuwenClaw服务。
+
+---
+
+## 快速上手
+
+#### 1️⃣ 对话模式
+
+| 方式 | 说明 |
+|------|-------------------------------------------|
+| **Web前端** | 启动服务后访问 `http://localhost:5173`,通过浏览器直接对话 |
+| **小艺频道** | 华为手机用户可直接唤醒小艺,与JiuwenClaw对话 |
+| **飞书频道** | 完成渠道配置后,在飞书中与JiuwenClaw畅聊 |
+
+#### 2️⃣ 配置模型
+
+### 远程访问(可选)
+
+如需远程访问,执行以下命令:
+
+```bash
+# 启动 Web 服务
+jiuwenclaw-web --host 0.0.0.0 --port <custom-port>
+
+# 启动后端服务
+jiuwenclaw-app
+```
+
+## 配置模型
+
+在 Web 页面左侧找到「配置信息」,进入配置页面:
+
+![](../assets/images/jiuwenclaw_configuration_Info.png)
+
+完善以下基本配置,完成后点击右上角「保存」:
+
+![](../assets/images/jiuwenclaw_config_api.png)
+
+**配置项说明:**
+
+| Field | Environment variable | Description | Required |
+|--------|------------------------|-------------|----------|
+| `model_name` | `MODEL_NAME` | 模型名称,如 `deepseek-chat`、`gpt-4o` | ✅ 必填 |
+| `api_base` | `API_BASE` | 模型 API 基础 URL,如 `https://api.deepseek.com` | ✅ 必填 |
+| `api_key` | `API_KEY` | 模型 API 密钥 | ✅ 必填 |
+| `model_provider` | `MODEL_PROVIDER` | 模型提供商,如 `OpenAI`、`DeepSeek`、`Anthropic` | ✅ 必填 |
+
+**配置后测试:**
+
+填写完配置后,建议点击「测试」按钮验证模型是否可用。测试通过会显示 ✅ 提示,若失败请检查:
+- API Key 是否正确
+- API Base URL 是否可访问
+- 模型名称和 Provider 是否匹配
+
+**注意事项:**
+
+- **保存后自动重启**:点击保存后,后端会自动重启以加载新配置
+- **必填项**:以上四项是模型运行的基础配置,必须填写完整才能正常使用
+- **模型供应商**:`OpenAI`、`DashScope`、`SiliconFlow`、`InferenceAffinity`
+
+## 开始对话
+
+在 Web 页面左侧找到「对话」,输入问题即可开始:
+
+![](../assets/images/jiuwenclaw_example.png)
+
+## 会话管理
+
+点击下方的「+」号,可清空当前会话并开启新会话:
+
+![](../assets/images/jiuwenclaw_new_session.png)
+
+清理后页面显示:
+
+![](../assets/images/jiuwenclaw_clear_session.png)
+
+**什么时候需要清空会话?**
+
+| 场景 | 说明 |
+|------|------|
+| **话题切换** | 当前对话已完成,想开始一个完全不同的新话题 |
+| **上下文混乱** | 当前会话中讨论内容过多,模型理解出现偏差 |
+| **重复/错误回复** | 模型陷入循环回复或给出与之前请求不相关的答案 |
+| **隐私/敏感信息** | 当前会话中包含临时敏感信息,需要立即清除 |
+
+**清空 vs 不清空会话的效果差异:**
+
+| 对比项 | 不清空(继续当前会话) | 清空(开启新会话) |
+|--------|------------------------|-------------------|
+| **上下文保留** | ✅ 保留所有历史对话,模型了解完整背景 | ❌ 不保留任何对话历史,模型从零开始 |
+| **Token 消耗** | ⚠️ 随对话增长,消耗更多 Token | ✅ 初始 Token 最少,成本更可控 |
+| **回答相关性** | 早期话题可能干扰当前问题理解 | 每个问题独立处理,无历史干扰 |
+| **隐私安全** | 历史对话持续存在于当前会话 | 敏感信息不会带入新会话 |
+
+## 清空记忆
+
+当你需要让 JiuwenClaw 忘记之前的所有对话历史和用户信息时,可以清空记忆文件。
+
+> **⚠️ 风险提示:** 清空记忆是**永久性操作**,删除的记忆文件**无法恢复**。操作前请确认:
+> - 重要记忆是否已备份
+> - 是否确实需要删除(还是仅想开始新的会话)
+
+**与会话清理的区别:**
+
+| 操作 | 作用范围 | 影响 | 适用场景 |
+|------|---------|------|---------|
+| **新建会话** | 当前对话窗口 | 不删除任何记忆,仅开启新对话线程 | 想换一个话题,但保留历史记忆供后续参考 |
+| **清空记忆** | 所有记忆文件 | 永久删除所有历史对话、用户信息、项目记忆 | 彻底清除所有历史,保护隐私,或重置到初始状态 |
+
+**适用场景:**
+- **隐私保护**:清除包含敏感信息的历史记录
+- **全新开始**:开始一个完全不同的项目或话题,避免历史信息干扰
+- **调试排错**:记忆文件损坏或内容异常时重置
+- **用户切换**:多用户共用环境时,清除上一个用户的信息
+
+**清空记忆操作步骤:**
+
+记忆文件存储在 `{workspace_dir}/memory/` 目录下:
+
+**方式一:通过 Agent 删除**
+直接告诉 JiuwenClaw:"请删除所有记忆文件" 或 "清空我的记忆",Agent 会调用文件工具删除 memory 目录下的文件。
+![](../assets/images/jiuwenclaw_delete_memory.png)
+
+**方式二:手动删除**
+停止 JiuwenClaw 服务后,直接删除 `memory/` 目录下的所有 Markdown 文件即可。
+![](../assets/images/jiuwenclaw_memory.png)
+
+> ⚠️ **注意**:清空记忆后无法恢复,请谨慎操作。建议定期备份重要的记忆文件。