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
doc: 配置文档修改
renquanjia08eb22514021
diff --git a/docs/assets/images/config-model-test.png b/docs/assets/images/config-model-test.pngnew file mode 100644index 0000000000..e8b92c6ae8Binary files /dev/null and b/docs/assets/images/config-model-test.png differdiff --git a/docs/assets/images/config-vision-model-test-en.png b/docs/assets/images/config-vision-model-test-en.pngnew file mode 100644index 0000000000..0a0c9339dbBinary files /dev/null and b/docs/assets/images/config-vision-model-test-en.png differdiff --git a/docs/assets/images/config-vision-model-test.png b/docs/assets/images/config-vision-model-test.pngnew file mode 100644index 0000000000..52cfb2d2d6Binary files /dev/null and b/docs/assets/images/config-vision-model-test.png differdiff --git a/docs/assets/images/config.png b/docs/assets/images/config.pngindex 5c96b6f68a..22aac3fbeb 100644Binary files a/docs/assets/images/config.png and b/docs/assets/images/config.png differdiff --git a/docs/assets/images/config_audio_model_demo.png b/docs/assets/images/config_audio_model_demo.pngnew file mode 100644index 0000000000..5328f8f4c1Binary files /dev/null and b/docs/assets/images/config_audio_model_demo.png differdiff --git a/docs/assets/images/config_context_compress.png b/docs/assets/images/config_context_compress.pngnew file mode 100644index 0000000000..912e50bbdaBinary files /dev/null and b/docs/assets/images/config_context_compress.png differdiff --git a/docs/assets/images/config_model_connect_test.png b/docs/assets/images/config_model_connect_test.pngnew file mode 100644index 0000000000..7a87b75536Binary files /dev/null and b/docs/assets/images/config_model_connect_test.png differdiff --git a/docs/assets/images/config_self_evolve.png b/docs/assets/images/config_self_evolve.pngnew file mode 100644index 0000000000..ef85dbf107Binary files /dev/null and b/docs/assets/images/config_self_evolve.png differdiff --git a/docs/assets/images/config_tool_security_guard.png b/docs/assets/images/config_tool_security_guard.pngnew file mode 100644index 0000000000..7c4c7cb276Binary files /dev/null and b/docs/assets/images/config_tool_security_guard.png differdiff --git a/docs/assets/images/config_video_model_demo.png b/docs/assets/images/config_video_model_demo.pngnew file mode 100644index 0000000000..f3eb137d02Binary files /dev/null and b/docs/assets/images/config_video_model_demo.png differdiff --git a/docs/en/Configuration.md b/docs/en/Configuration.mdindex 93683bd69d..085c1734b3 100644--- a/docs/en/Configuration.md+++ b/docs/en/Configuration.md@@ -1,371 +1,401 @@-# Configuration+# Configuration Information-JiuwenClaw reads settings from `config/config.yaml`, `.env`, and the web UI. This document explains **what you can change in the UI**, **what must be edited in files**, and what each option does.+JiuwenClaw configuration serves as the foundational setup for your interactions with the agent. Proper configuration allows you to connect to various model services, enable multimodal capabilities, integrate third-party services, and adjust system behavior parameters.++This document details each configuration option in the JiuwenClaw frontend panel to help you get started quickly and fully leverage the system's capabilities.++---++## 1. Configuration entry++Open **Configuration** from the left navigation bar to view and edit settings for models, third-party services, free search, and more. Click **Save** after changes; whether you need to wait for services to become ready depends on your deployment.++++The configuration panel contains the following main sections:++- **Model Configuration**: Default chat model, video/audio/vision models (see [2. Model Configuration](#2-model-configuration))+- **Embedding Configuration**: Vector embedding service (see [3. Embedding Configuration](#3-embedding-configuration))+- **Third-Party Services**: Jina, Bocha, Serper, Perplexity, GitHub, etc. (see [4. Third-Party Service Configuration](#4-third-party-service-configuration))+- **Self-Evolution Configuration**: Automatic skill improvement (see [5. Self-Evolution Configuration](#5-self-evolution-configuration))+- **Context Compression**: Dialogue history management (see [6. Context Compression](#6-context-compression))+- **Tool Security Guardrails**: Tool invocation permission checks (see [7. Tool Security Guardrails](#7-tool-security-guardrails))++> 💡 **Tip**: Model configuration (`api_base`, `api_key`, `model`, `model_provider`) is required; all other configurations are optional.----## 1. Configurable in the web UI+## 2. Model Configuration++> Before using JiuwenClaw, you must obtain an API key from your chosen model provider. Visit the provider's official website and follow instructions to apply for an API key.++### 2.1 Supported Model Types++JiuwenClaw supports multiple model types to meet diverse scenario requirements:++| Model Type | Purpose | Capability Requirements | Required |+| ---------------- | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -------- |+| **Default Model** | Core dialogue model; handles text chat, task planning, tool calling, etc | Must support **Function Calling** and multi-turn dialogue | ✅ Yes |+| **Video Model** | Video understanding and analysis; supports video Q&A, scene detection | Must support **video understanding** and process video input | ⭕ No |+| **Audio Model** | Speech recognition and processing; supports ASR, audio content analysis | Must support **speech recognition / audio understanding** | ⭕ No |+| **Vision Model** | Image understanding and analysis; supports image Q&A, OCR, captioning | Must support **image understanding** and process image input | ⭕ No |+| **Image Generation Model** | Generate images from text descriptions; supports AI painting, image creation | Must support **image generation** and create images from text | ⭕ No |++> 💡 **Tip**: The default model is essential for system operation and must be configured correctly. Video, audio, vision, and image generation models are optional; configure them only when multimodal capabilities are needed.++### 2.2 Configuration Fields++Each model type supports the following parameters:++| Field | Description | Remarks |+| ------------------ | ---------------------------- | -------------------------------------------------------------------------------------------- |+| `api_base` | Base URL for model API | Use the provider's API endpoint; **do not include `/chat/completions`**; appended automatically |+| `api_key` | Model API key | Obtained from the model provider; keep confidential |+| `model` | Model identifier | Use exact model ID such as `gpt-4o`, `claude-3-opus`, `deepseek-chat` |+| `model_provider` | Model provider type | Supports `OpenAI`, `Azure`, `SiliconFlow`, etc., for API format adaptation |++> 💡 **Test Function**: The configuration panel provides a **Test button**. After filling in the model configuration, you can click "Test" to verify the API connection. The system will send a simple test request and display "Test Successful" if successful, or show error information otherwise.-These can be changed in the web app; values are written back to `.env` or config as appropriate.+-**Path**: left sidebar → **Configuration**+#### Configuration Examples-+**OpenAI-compatible API**-**Saved to**: `.env` (environment variables)+```+api_base: https://api.openai.com/v1+api_key: sk-your-openai-api-key+model: gpt-4o+model_provider: OpenAI+```-| Field | Environment variable | Description |-|--------|------------------------|-------------|-| `api_base` | `API_BASE` | Model API base URL (e.g. `https://api.deepseek.com`) |-| `api_key` | `API_KEY` | Model API key |-| `model` | `MODEL_NAME` | Model name (e.g. `deepseek-chat`) |-| `model_provider` | `MODEL_PROVIDER` | Provider (e.g. `OpenAI`) |-| `embed_api_base` | `EMBED_API_BASE` | Embedding API base URL |-| `embed_api_key` | `EMBED_API_KEY` | Embedding API key |-| `embed_model` | `EMBED_MODEL` | Embedding model name |-| `video_model` | `VIDEO_MODEL_NAME` | Video processing model |-| `audio_model` | `AUDIO_MODEL_NAME` | Audio processing model |-| `vision_model` | `VISION_MODEL_NAME` | Vision model |-| `image_gen_model` | `IMAGE_GEN_MODEL_NAME` | Image generation model |-| `jina_api_key` | `JINA_API_KEY` | Jina search API key |-| `serper_api_key` | `SERPER_API_KEY` | Serper search API key |-| `perplexity_api_key` | `PERPLEXITY_API_KEY` | Perplexity API key |-| `github_token` | `GITHUB_TOKEN` | GitHub PAT; SkillNet search/install uses the GitHub API |-| `free_search_proxy_url` | `FREE_SEARCH_PROXY_URL` | Optional HTTP/HTTPS proxy for free search, webpage fetch, and SkillNet network requests. The UI asks for username/password and stores `http://username:[email protected]:8080`. |-| `evolution_auto_scan` | `EVOLUTION_AUTO_SCAN` | Auto-scan evolvable skills after each turn (`true`/`false`) |+> 💡 **Tip**: Most model providers offer OpenAI-compatible APIs. You can adjust `api_base` and `model` parameters based on your actual provider.-**Note**: After saving, the backend restarts to load new settings. Model fields (`api_base`, `api_key`, `model`, `model_provider`) are required.+### 2.3 Multi-Model Management and Aliases-### Multi-model management and aliases+The **Model List** section in the configuration panel supports maintaining multiple models simultaneously for quick switching between different models.-The **model list** block in the Configuration panel supports maintaining multiple models simultaneously. Fields for each model entry:+Each model entry contains the following fields:| Field | Required | Description |-|-------|----------|-------------|-| `model_name` | Yes | API-level model identifier (e.g. `gpt-4o`, `deepseek-chat`) |-| `alias` | No | Display name / switch identifier; defaults to `model_name` if left empty |-| `api_base` | Yes | API base URL for this model |+|------|---------|------|+| `model_name` | Yes | Model name at the API layer (e.g., `gpt-4o`, `deepseek-chat`) |+| `alias` | No | Display name / switch identifier; defaults to `model_name` if empty |+| `api_base` | Yes | API endpoint for this model || `api_key` | Yes | API key for this model |-| `model_provider` | Yes | Provider (e.g. `OpenAI`, `DeepSeek`) |+| `model_provider` | Yes | Provider (e.g., `OpenAI`, `DeepSeek`) || `temperature` | No | Sampling temperature, default `0.95` |-**`alias` rules**:-- If left blank, the stored value is automatically set to `model_name`.-- Must be globally unique across all configured models: cannot match another model's `alias` or `model_name`.-- When switching models (web dropdown / CLI `\model <name>`), either `alias` or `model_name` can be used as the identifier.+**`alias` Rules**:+- If empty, it automatically defaults to `model_name` when saved;+- Must be globally unique across all configured models: cannot duplicate another model's `alias` or `model_name`;+- When switching models (Web dropdown / CLI `\model <name>`), you can use either `alias` or `model_name` as the identifier.++The first item in the list is the default model; you can drag to reorder or click "Set as Default" to change the default.++### 2.4 Multimodal Model Usage Examples++Once video, audio, or vision models are configured, JiuwenClaw enables corresponding multimodal features automatically.++#### Video Model++Using **GLM-4.6V-Flash11** video understanding API as an example:++```+api_base: https://open.bigmodel.cn/api/paas/v4+api_key: your-zhipu-api-key+model: GLM-4.6V-Flash11+model_provider: ZhiPu+```++When you send a video file to JiuwenClaw, the system will invoke the video model for analysis:++```+User: Analyze this video and list the main scenes.+[Attachment: meeting_recording.mp4]++JiuwenClaw: Based on video analysis, the main scenes are:+1. Opening remarks (0:00–2:30)+2. Project progress report (2:30–8:15)+3. Issue discussion (8:15–12:00)+4. Summary and next steps (12:00–15:00)+```++++#### Audio Model++Using **GLM-ASR-2512** audio model as an example:++```+api_base: https://open.bigmodel.cn/api/paas/v4+api_key: your-zhipu-api-key+model: glm-asr-2512+model_provider: ZhiPu+```++When you send an audio file, the system will invoke the audio model for speech recognition or analysis:++```+User: Transcribe this audio recording.+[Attachment: voice_message.m4a]++JiuwenClaw: Transcription:+"Project review meeting at 3 PM tomorrow in Conference Room B. Please prepare materials in advance..."+```++++#### Vision Model++Using **GLM-4.6V-Flash11** vision model as an example:++```+api_base: https://open.bigmodel.cn/api/paas/v4+api_key: your-zhipu-api-key+model: GLM-4.6V-Flash11+model_provider: ZhiPu+```++```+User: Extract data from the table in this image.+[Attachment: data_chart.png]++JiuwenClaw: Extracted sales data:+- January: 1.2M+- February: 1.35M+- March: 1.48M+Showing an upward trend...+```++++#### Image Generation Model++Using **GLM-4.6V-Flash11** image generation model as an example:++```+api_base: https://open.bigmodel.cn/api/paas/v4+api_key: your-zhipu-api-key+model: GLM-4.6V-Flash11+model_provider: ZhiPu+```++When you request image generation, the system will invoke the image generation model:++```+User: Generate an image of a beach at sunset.++JiuwenClaw: [Generated image]+Generated an image of a beach at sunset, golden sunlight sparkling on the shimmering sea...+```++---++## 3. Embedding Configuration++Embedding models convert text into vector representations and form the core of JiuwenClaw's memory system for semantic retrieval.++### 3.1 Purpose++- **Semantic search**: Vectorize memory content for similarity-based retrieval rather than simple keyword matching+- **Memory recall**: Improve accuracy when querying historical information+- **Hybrid retrieval**: Combine with BM25 full-text search for optimal recall++> 💡 **Tip**: Embedding configuration is optional. If not set, the system uses a mock provider for basic retrieval. Configuring an embedding model improves semantic search precision. See the [Memory](Memory.md) documentation for details.++### 3.2 Configuration Fields-Multi-model configuration is saved to the `models.defaults` list in `config.yaml`. Example:+| Field | Description | Remarks |+| ------------------ | ------------------------------- | ----------------------------------------- |+| `embed_api_base` | Base URL for embedding API | Embedding service API endpoint |+| `embed_api_key` | Embedding service API key | Obtained from the service provider |+| `embed_model` | Embedding model name | Chinese-optimized embedding recommended |++#### Configuration Example++**SiliconFlow**++```+embed_api_base: https://api.siliconflow.cn/v1+embed_api_key: sk-your-siliconflow-api-key+embed_model: BAAI/bge-large-zh-v1.5+```++---++## 4. Third-Party Service Configuration++This section mirrors **§1.4** and **§1.5** for readers who jump here first. All items below appear on the **Configuration** page (all optional).++| Field | Description | Reference |+| --- | --- | --- |+| `jina_api_key` | Jina; fetch and some search flows | [Jina](https://jina.ai/) |+| `bocha_api_key` | Bocha Web Search | [Bocha Open Platform](https://open.bochaai.com/) |+| `serper_api_key` | Serper | [Serper](https://serper.dev/) |+| `perplexity_api_key` | Perplexity | [Perplexity](https://www.perplexity.ai/) |+| `github_token` | GitHub; SkillNet, etc. | [GitHub tokens](https://github.com/settings/tokens) |+| `teamskills_hub_token` | TeamSkillsHub user token | [TeamSkillsHub](https://teamskills.openjiuwen.com) |++> ⚠️ **Note**: All optional. If unset, related features may be unavailable or fall back; exact behavior depends on your product version.++---++## 5. Self-Evolution Configuration++Self-evolution controls the automatic improvement of JiuwenClaw's Skills.++++### Toggle++- **Field**: `evolution.enabled`+- **Default**: `false` (disabled)+- **Purpose**: When enabled, the system detects issues in Skill execution and generates improvement suggestions to continuously optimize performance.++When enabled, the system will:++1. Monitor Skill execution and dialogue history+2. Detect execution failures, user feedback, and improvement signals+3. Automatically generate and log refinement suggestions++> 📖 For details on the self-evolution mechanism, see [Skill self-evolution](SkillSelfEvolution.md).++---++## 6. Context Compression++Context compression manages dialogue history retention strategies.++++### Toggle++- **Field**: `context_engine.enabled`+- **Default**: `true` (enabled)+- **Purpose**: Automatically compress and offload dialogue history when exceeding context window limits to maintain fluent interaction.++When enabled, the system will:++1. Monitor message count and token usage+2. Archive low-priority content when thresholds are reached+3. Preserve lightweight indexes to free space for ongoing tasks++> 📖 For details, see [Context Compression & Offloading](ContextCompression.md).++---++## 7. Tool Security Guardrails++Security guardrails enforce permission checks during tool invocation.++++### Toggle++- **Field**: `permissions.enabled`+- **Default**: `false` (disabled)+- **Purpose**: When enabled, the system performs permission checks before sensitive tool operations and follows policies to allow, prompt for confirmation, or deny actions.++When enabled, the system will:++1. Check permission rules for each tool call+2. Resolve action: `allow`, `ask`, or `deny`+3. Prompt user confirmation for `ask`-classified operations++### Example Permission Rules```yaml-models:+permissions:+ enabled: truedefaults:- - alias: my-gpt # display name; used for switching in both UI and CLI- model_client_config:- api_base: https://api.openai.com/v1- api_key: ${API_KEY}- model_name: gpt-4o- client_provider: OpenAI- timeout: 1800- verify_ssl: false- model_config_obj:- temperature: 0.95+ "*": "allow" # Allow all actions by default+ tools:+ mcp_exec_command:+ "*": "ask" # Require confirmation for command execution+ patterns:+ - pattern: "rm -rf"+ action: "deny" # Reject dangerous commands```-The first entry in the list is the default model; use the UI to drag-reorder or click "Set as default" to change it.--## 2. Not configurable in the web UI--Edit **`config/config.yaml`** or **`.env`** directly; there is no UI for these.--### 2.1 `config.yaml` — file-only fields--| Path | Description |-|------|-------------|-| `react.agent_name` | Agent name, default `main_agent` |-| `react.enable_task_loop` | Enable task loop, default `false` |-| `react.max_iterations` | Max iterations, default 100 |-| `react.model_name` | Model name override for the agent (env: `MODEL_NAME`, default `deepseek-chat`) |-| `react.answer_chunk_size` | Answer streaming chunk size, default 500 |-| `react.stream_chunk_threshold` | Stream chunk threshold, default 50 |-| `react.stream_character_threshold` | Stream character threshold, default 2000 |-| `react.context_engine_config.enable_reload` | Enable context reload |-| `react.context_engine_config.enable_kv_cache_release` | Enable KV cache release |-| `react.context_engine_config.enabled` | Enable context engine, default `true` |-| `react.subagents.code_agent.enabled` | Enable code sub-agent, default `false` |-| `react.subagents.research_agent.enabled` | Enable research sub-agent, default `false` |-| `react.evolution.enabled` | Enable online skill evolution |-| `react.evolution.auto_scan` | Auto-scan skills after each turn |-| `react.evolution.skill_create` | Enable SkillCreateRail (single agent) and TeamSkillCreateRail (leader) |-| `react.evolution.skill_base_dir` | Skill root, default `agent/skills` |-| `react.a2x_registry.base_url` | A2X registry base URL |-| `react.a2x_registry.timeout` | A2X registry timeout, default 30.0 |-| `react.a2x_registry.dataset` | Dataset name, default `team_pool` |-| `react.a2x_registry.role` | Role: `teammate` or `teamleader` |-| `tools` | Enabled tool list, e.g. `[todo, skill]` |-| `browser.remote_debugging_address` | Remote debugging address |-| `browser.remote_debugging_port` | Remote debugging port |-| `browser.user_data_dir` | Chrome user data directory |-| `browser.profile_directory` | Chrome profile directory |-| `browser.chrome_path` | Chrome executable path (string or per-OS map) |--See also:-- [Modes](Modes.md) — `modes` section configuration-- [Tool Permissions & Security](ToolPermissionsSecurity.md) — `permissions` section configuration--### 2.2 `models` section (Multi-Model Configuration)--Configure multiple model profiles for different use cases (main agent, video, audio, vision, image generation).--| Path | Description |-|------|-------------|-| `models.default.model_client_config` | Default (main) model connection: `api_base`, `api_key`, `model_name`, `client_provider`, `timeout`, `verify_ssl`, `custom_headers` |-| `models.default.model_config_obj` | Default model generation params: `temperature`, etc. |-| `models.default.is_default` | Mark this profile as the default, default `true` |-| `models.video.model_client_config` | Video processing model |-| `models.audio.model_client_config` | Audio processing model |-| `models.vision.model_client_config` | Vision / image understanding model |-| `models.image_gen.model_client_config` | Image generation model |-| `models.image_gen.model_config_obj` | Image generation params: `temperature`, etc. |--Each sub-model section supports the same `model_client_config` keys: `api_base`, `api_key`, `model_name`, `client_provider`, `timeout`, `verify_ssl`. Environment variable substitution (e.g. `${VIDEO_API_BASE}`) is used throughout.--### 2.2b `embed` section (Embedding Configuration)--| Path | Description |-|------|-------------|-| `embed.embed_api_key` | Embedding API key |-| `embed.embed_base_url` | Embedding API base URL |-| `embed.embed_model` | Embedding model name |--### 2.3 memory section (Memory System)--| Path | Description |-|------|-------------|-| `memory.mode` | Builtin memory storage mode: `local` \| `cloud` (env: `MEMORY_MODE`, default `local`) |-| `memory.engine` | Engine switch: `builtin` \| `external` \| `both` \| `none` |-| `memory.external.provider` | Provider name: `openjiuwen` \| `mem0` \| `openviking` \| `<plugin>` |-| `memory.external.user_id` | Data isolation identifier |-| `memory.external.scope_id` | Scope identifier |--See [Memory](Memory.md) for details.--### 2.4 team section (Distributed Team)--| Path | Description |-|------|-------------|-| `team.team_name` | Team name, default `jiuwen_team` |-| `team.lifecycle` | Lifecycle mode: `persistent` |-| `team.runtime.mode` | Runtime mode: `local` \| `distributed` |-| `team.runtime.role` | Process role: `leader` \| `teammate` |-| `team.runtime.member_name` | Teammate name identifier |-| `team.teammate_mode` | Teammate build method: `build_mode` |-| `team.spawn_mode` | Teammate process mode: `inprocess` |-| `team.leader.member_name` | Leader member name, default `team_leader` |-| `team.leader.display_name` | Leader display name |-| `team.leader.persona` | Leader persona description |-| `team.agents.leader.workspace.stable_base` | Leader workspace stable base |-| `team.agents.leader.max_iterations` | Leader max iterations, default 200 |-| `team.agents.leader.completion_timeout` | Leader completion timeout, default 600.0 |-| `team.agents.teammate.workspace.stable_base` | Teammate workspace stable base |-| `team.agents.teammate.max_iterations` | Teammate max iterations, default 200 |-| `team.agents.teammate.completion_timeout` | Teammate completion timeout, default 600.0 |-| `team.workspace.enabled` | Enable team workspace, default `true` |-| `team.transport.type` | Transport type: `inprocess` |-| `team.storage.type` | Storage type: `sqlite` |--See [Distributed Team](DistributedTeam.md) for details.--### 2.5 task_memory section (Experience Memory)--| Path | Description |-|------|-------------|-| `task_memory.enabled` | Enable experience memory tools, default `true` |-| `task_memory.llm_model` | LLM model for experience memory (empty = main model) |-| `task_memory.embedding_model` | Embedding model for experience memory |-| `task_memory.api_key` | API key for experience memory (empty = main key) |-| `task_memory.api_base` | API base URL for experience memory (empty = main base) |-| `task_memory.retrieval_algo` | Retrieval algorithm: `ACE` \| `ReasoningBank` \| `ReMe`, default `ACE` |-| `task_memory.summary_algo` | Summary algorithm: `ACE` \| `ReasoningBank` \| `ReMe`, default `ACE` |--When enabled, the agent gains `experience_retrieve`, `experience_learn`, and `experience_clear` tools. Available retrieval algorithms: `ACE`, `ReasoningBank`, `ReMe`. Default: `ACE`.--### 2.6 email_settings section (Email)--| Path | Description |-|------|-------------|-| `email_settings.email_address` | Sender email address |-| `email_settings.token` | Email authorization code |-| `email_settings.smtp_server` | SMTP server, default `smtp.gmail.com` (env: `SMTP_SERVER`) |-| `email_settings.port` | SMTP port, default `587` (env: `EMAIL_PORT`) |--### 2.7 extensions section (Extension Packages)--| Path | Description |-|------|-------------|-| `extensions.extension_dirs` | Extension search directories, semicolon-separated (e.g. `E:/a;D:/b`), maps to env var `EXTENSION_DIRS` |--### 2.8 mcp section (MCP Servers)--| Path | Description |-|------|-------------|-| `mcp.servers` | MCP server list; each entry includes `name`, `enabled`, `transport` (`stdio`/`sse`/`streamable-http`), `command`, `args`, `url`, etc. |--Browser MCP runtime is configured via environment variables (see below).--### 2.9 channels section (Channel Configuration)--Per-channel settings in `config.yaml`. See [Channels](Channels.md) for the full per-channel configuration reference.--Supported channels: `feishu`, `feishu_enterprise`, `xiaoyi`, `dingtalk`, `telegram`, `discord`, `whatsapp`, `wechat`, `wecom`.--### 2.10 updater section (Auto-Update)--| Path | Description |-|------|-------------|-| `updater.enabled` | Enable auto-update, default `true` |-| `updater.repo_owner` | GitHub repository owner |-| `updater.repo_name` | GitHub repository name |-| `updater.release_api_url` | Custom release API URL (empty = use default) |-| `updater.asset_name_pattern` | Release asset name pattern |-| `updater.sha256_name_pattern` | SHA256 checksum file name pattern |-| `updater.timeout_seconds` | Update check timeout, default `20` |-----### 2.11 gateway section (Gateway Routing)--| Key | Type | Default | Description |-|-----|------|---------|-------------|-| `gateway.session_map_scope` | string | `per_chat_bot` | SessionMap scope: `per_chat_bot` (shared session per chat+bot) or `per_chat_bot_user` (session per user). Enterprise channels only (e.g. Feishu Enterprise). |--### 2.12 logging section (Logging)--| Key | Type | Default | Description |-|-----|------|---------|-------------|-| `logging.level` | string | `INFO` | Global log level |-| `logging.console_level` | string | `INFO` | Console log level |-| `logging.gateway` | string | `INFO` | Gateway module log level |-| `logging.channel` | string | `INFO` | Channel module log level |-| `logging.agent_server` | string | `INFO` | Agent server log level |-| `logging.full` | string | `INFO` | Full (aggregate) log level |--Log files are stored in `~/.jiuwenclaw/agent/.logs/`, split into `gateway.log`, `channel.log`, `agent_server.log`; `full.log` is the aggregate.--### 2.13 telemetry section (OpenTelemetry)--| Key | Type | Default | Description |-|-----|------|---------|-------------|-| `telemetry.enabled` | bool | `false` | Master switch (env var `OTEL_ENABLED` takes priority) |-| `telemetry.exporter` | string | `otlp` | Exporter type: `otlp` / `console` / `none` |-| `telemetry.endpoint` | string | `http://localhost:4317` | OTLP endpoint |-| `telemetry.protocol` | string | `grpc` | Transport protocol: `grpc` / `http` |-| `telemetry.headers` | map | `{}` | Common OTLP headers; can be overridden by traces/metrics |-| `telemetry.log_messages` | bool | `true` | Whether to record full message content in span events |-| `telemetry.service_name` | string | `jiuwenclaw` | Service name identifier |-| `telemetry.provider_factory` | string | | Custom Provider Factory, format `module:function` |-| `telemetry.traces.exporter` | string | | Trace exporter; falls back to `telemetry.exporter` |-| `telemetry.traces.endpoint` | string | | Trace endpoint; falls back to `telemetry.endpoint` |-| `telemetry.traces.protocol` | string | | Trace protocol; falls back to `telemetry.protocol` |-| `telemetry.traces.headers` | map | `{}` | Trace-specific headers |-| `telemetry.metrics.exporter` | string | | Metrics exporter; falls back to `telemetry.exporter` |-| `telemetry.metrics.endpoint` | string | | Metrics endpoint; falls back to `telemetry.endpoint` |-| `telemetry.metrics.protocol` | string | | Metrics protocol; falls back to `telemetry.protocol` |-| `telemetry.metrics.headers` | map | `{}` | Metrics-specific headers |--### 2.14 Other Settings--| Key | Type | Default | Description |-|-----|------|---------|-------------|-| `preferred_language` | string | `zh` | Agent default reply language (`zh` / `en`) |--### 2.15 Environment-only fields--| Variable | Description |-|----------|-------------|-| `HEARTBEAT_TIMEOUT` | Heartbeat request timeout (seconds) |-| `HEARTBEAT_RELAY_CHANNEL_ID` | Heartbeat relay channel (overrides `target` in config) |-| `HEARTBEAT_INTERVAL` | Heartbeat interval (seconds), overrides `every` in config |-| `BROWSER_RUNTIME_MCP_ENABLED` | Enable browser MCP runtime (`0`/`1`), default `1` |-| `BROWSER_RUNTIME_MCP_CLIENT_TYPE` | MCP client type (`stdio` / `sse` / `streamable-http`), recommended `streamable-http` |-| `BROWSER_RUNTIME_MCP_SERVER_ID` | MCP server identifier, default `playwright_runtime_wrapper` |-| `BROWSER_RUNTIME_MCP_SERVER_NAME` | MCP server display name, default `playwright-runtime-wrapper` |-| `BROWSER_RUNTIME_MCP_SERVER_PATH` | MCP server URL/path (default `http://127.0.0.1:8940/mcp` for streamable-http) |-| `BROWSER_RUNTIME_MCP_TIMEOUT_S` | MCP server request timeout (seconds), default `300` |-| `BROWSER_RUNTIME_MCP_HOST` | MCP server host, default `127.0.0.1` |-| `BROWSER_RUNTIME_MCP_PORT` | MCP server port, default `8940` |-| `BROWSER_RUNTIME_MCP_PATH` | MCP server path, default `/mcp` |-| `BROWSER_RUNTIME_MCP_COMMAND` | MCP server command (stdio mode, empty = use current python executable) |-| `BROWSER_RUNTIME_MCP_ARGS` | MCP server args (stdio mode, empty = use built-in default) |-| `BROWSER_RUNTIME_MCP_AUTO_SSE_FALLBACK` | Auto SSE fallback in stdio mode (`0`/`1`), default `1` |-| `PLAYWRIGHT_CDP_URL` | Playwright CDP URL for Chrome, default `http://127.0.0.1:9222` |-| `PLAYWRIGHT_TOOL_TIMEOUT_S` | Playwright tool timeout (seconds), default `300` |-| `BROWSER_TIMEOUT_S` | Browser task timeout (seconds), default `300` |-| `BROWSER_DRIVER` | Browser driver mode: `managed` / `remote` / `extension` |-| `BROWSER_ALLOW_SHORT_TIMEOUT_OVERRIDE` | Allow model-provided timeout shorter than `BROWSER_TIMEOUT_S`; default `0` (off) |-| `BROWSER_PROFILE_NAME` | Browser profile name, default `Default` |-| `PLAYWRIGHT_MCP_COMMAND` | Playwright MCP command, default `npx` |-| `PLAYWRIGHT_MCP_ARGS` | Playwright MCP args, default `-y @playwright/mcp@latest` |-| `CUSTOM_HEADERS` | Custom HTTP headers for model API calls (JSON or empty) |-| `VIDEO_API_BASE` | Video model API base URL |-| `VIDEO_API_KEY` | Video model API key |-| `VIDEO_MODEL_NAME` | Video model name |-| `VIDEO_PROVIDER` | Video model provider |-| `AUDIO_API_BASE` | Audio model API base URL |-| `AUDIO_API_KEY` | Audio model API key |-| `AUDIO_MODEL_NAME` | Audio model name, default `openai/gpt-4o-audio-preview` |-| `AUDIO_PROVIDER` | Audio model provider |-| `VISION_API_BASE` | Vision model API base URL |-| `VISION_API_KEY` | Vision model API key |-| `VISION_MODEL_NAME` | Vision model name, default `bytedance-seed/seed-2.0-mini` |-| `VISION_PROVIDER` | Vision model provider |-| `IMAGE_GEN_API_BASE` | Image generation model API base URL, default `https://dashscope.aliyuncs.com/api/v1` |-| `IMAGE_GEN_API_KEY` | Image generation model API key |-| `IMAGE_GEN_MODEL_NAME` | Image generation model name, default `qwen-image-max` |-| `IMAGE_GEN_PROVIDER` | Image generation model provider, default `DashScope` |-| `JINA_API_KEY` | Jina search API key |-| `SERPER_API_KEY` | Serper search API key |-| `PERPLEXITY_API_KEY` | Perplexity API key |-| `GITHUB_TOKEN` | GitHub Personal Access Token |-| `FREE_SEARCH_PROXY_URL` | Optional HTTP/HTTPS proxy for free search |-| `FREE_SEARCH_DDG_URL` | DuckDuckGo HTML endpoint URL, default `https://html.duckduckgo.com/html/` |-| `FREE_SEARCH_SSL_VERIFY` | Enable SSL verification for free search; default `true`, set `false` behind corporate proxies |-| `NO_PROXY` | Comma-separated hosts to bypass proxy |-| `EMAIL_ADDRESS` | Sender email address (maps to `email_settings.email_address`) |-| `EMAIL_TOKEN` | Email authorization code (maps to `email_settings.token`) |-| `SMTP_SERVER` | SMTP server (maps to `email_settings.smtp_server`) |-| `EMAIL_PORT` | SMTP port (maps to `email_settings.port`) |-| `EVOLUTION_AUTO_SCAN` | Auto-scan evolvable skills after each turn (`true`/`false`) |-| `SKILLNET_DOWNLOAD_TIMEOUT` | SkillNet download timeout (seconds), default 60 |-| `SKILLNET_MAX_RETRIES` | SkillNet download max retries, default 3 |-| `TEAM_SKILLS_HUB_BASE_URL` | TeamSkillsHub market URL (empty = default `https://teamskills.openjiuwen.com`) |-| `TEAM_SKILLS_HUB_USER_TOKEN` | TeamSkillsHub user token (mutually exclusive with system token) |-| `TEAM_SKILLS_HUB_SYSTEM_TOKEN` | TeamSkillsHub system token (mutually exclusive with user token) |-| `TEAM_SKILLS_HUB_TIMEOUT` | TeamSkillsHub request timeout (seconds), default 60 |-| `TEAM_SKILLS_HUB_ALLOWED_DOWNLOAD_HOSTS` | TeamSkillsHub ZIP download host allowlist, comma-separated |-| `MEMORY_MODE` | Memory mode (empty = `local` default) |-| `MEMORY_ENGINE` | Memory engine: `builtin` \| `external` \| `both` \| `none` |-| `MEMORY_EXTERNAL_PROVIDER` | External memory provider: `openjiuwen` \| `mem0` \| `openviking` \| `<plugin>` |-| `MEM0_API_KEY` | Mem0 API key |-| `MEM0_USER_ID` | Mem0 user ID, default `jiuwenclaw-user` |-| `MEM0_AGENT_ID` | Mem0 agent ID, default `jiuwenclaw` |-| `OPENVIKING_ENDPOINT` | OpenViking endpoint, default `http://127.0.0.1:1933` |-| `OPENVIKING_API_KEY` | OpenViking API key |-| `OPENVIKING_ACCOUNT` | OpenViking account, default `root` |-| `OPENVIKING_USER` | OpenViking user, default `default` |-| `EXTENSION_DIRS` | Extension search directories, semicolon-separated (maps to `extensions.extension_dirs`) |-| `OTEL_ENABLED` | Enable OpenTelemetry (`true`/`false`), takes priority over `telemetry.enabled` |-| `OTEL_EXPORTER` | OTLP exporter type (maps to `telemetry.exporter`) |-| `OTEL_ENDPOINT` | OTLP endpoint (maps to `telemetry.endpoint`) |-| `JIUWENCLAW_CONFIG_DIR` | Custom config directory path |-| `JIUWENCLAW_DATA_DIR` | Absolute path to the user data root (`config/`, `agent/`, `.logs`, etc.). If unset, defaults to `~/.jiuwenclaw`. Set in the shell or service environment **before** starting the process so workspace paths resolve from the first import; defining it only in `config/.env` is often too late for that bootstrap. |-| `JIUWENCLAW_DISABLE_CRON_TOOLS` | Set to `1` to disable Agent-side cron tool registration and hide cron-tool prompt text |--See `.env.template` for more variables.+## 8. Advanced Configuration++Beyond the **Configuration** page, the product may use a **main configuration** for timeouts, temperature, heartbeat interval, context thresholds, and toggles that work together with **context compression**, **permissions**, **memory restrictions**, and similar UI switches. **This document does not state where those files live on disk**; for offline edits or bulk rollout, contact your administrator.++### 8.1 Common logical keys (conceptual paths)++These are **conceptual** paths in the main configuration for cross-reference with ops or release notes; they are **not** a one-to-one list of every UI field.++| Item (conceptual path) | Description | Typical default |+| --- | --- | --- |+| `preferred_language` | UI language | `zh` |+| `models.*.model_client_config.timeout` | Model request timeout (seconds) | `1800` |+| `models.*.model_client_config.verify_ssl` | Verify SSL | `false` |+| `models.*.model_config_obj.temperature` | Temperature | `0.95` |+| `heartbeat.every` | Heartbeat interval (seconds) | `3600` |+| `context_engine.max_messages` | Message count threshold | `100` |+| `context_engine.max_tokens` | Token threshold | `100000` |++<a id="dotenv-configuration"></a>++### 8.2 Runtime parameters outside the Configuration page++Fine-grained options for browser automation, network proxies, or some search paths may be supplied by the **runtime or deployment template** and **may not** appear on the **Configuration** page. Typical users only need required UI fields and business keys; leave the rest to admins or ops.++### 8.3 Precedence (conceptual)++Generally, from highest to lowest: **values you save in the web Configuration UI** → **environment-injected variables** → **built-in product defaults**. Exact behavior depends on your version and deployment.++> 💡 **Tip**: If changes do not seem to apply immediately, wait briefly or ask an admin whether services have reloaded.----### 2.16 Precedence+## 9. FAQ++### Q: Configurations not taking effect after saving?-- **Environment variables** override **`config.yaml`**-- Example: `react.model_name: ${MODEL_NAME:-deepseek-chat}` reads `MODEL_NAME` first, then falls back to `deepseek-chat`.-- Values saved from the Config panel go to `.env` and take effect on next start.+A: The backend restarts automatically after saving. Please wait a few moments and retry. If issues persist, verify configuration format correctness.++### Q: How to view the currently active model?++A: Model information is displayed on the configuration panel. You may also check system logs for the actual model being called.++### Q: Are multimodal models required?++A: No. Video, audio, and vision models are optional and only required for their respective multimodal functions.++### Q: Which embedding model is recommended?++A: `BAAI/bge-large-zh-v1.5` is recommended for high-quality Chinese embeddings. Other models may be selected based on language requirements.++### Q: How to test if the configured model is working?++A: After configuration, you can test the model with these methods:++1. **Send a simple message**: Send a simple message like "Hello" via the web frontend and check if you receive a normal response+2. **Check logs**: Review backend logs to confirm successful model calls without errors+3. **Test multimodal**: If multimodal models are configured, send images/audio/video to test++++### Q: How to troubleshoot configuration errors?++A: When configuration issues occur, follow these steps:++1. **Check API Key**: Verify the API Key is correct, not expired, and has sufficient quota+2. **Check API Base**: Verify the API address is correct, note that `/chat/completions` suffix should not be included+3. **Check Model Name**: Verify the model name is correct, different providers may have different naming conventions+4. **View Logs**: Backend logs will show specific error messages like authentication failure, model not found, etc.++Common errors and solutions:++| Error Message | Possible Cause | Solution |+| ------------ | -------------- | -------- |+| `401 Unauthorized` | Invalid or expired API Key | Check and update API Key |+| `404 Not Found` | Incorrect API address or model name | Check api_base and model configuration |+| `429 Too Many Requests` | Rate limit exceeded | Wait and retry, or upgrade plan |+| `Connection Error` | Network issue or API address unreachable | Check network connection and API address |++---diff --git "a/docs/zh/\351\205\215\347\275\256\344\277\241\346\201\257.md" "b/docs/zh/\351\205\215\347\275\256\344\277\241\346\201\257.md"index fbef0b9dbc..667fbf7341 100644--- "a/docs/zh/\351\205\215\347\275\256\344\277\241\346\201\257.md"+++ "b/docs/zh/\351\205\215\347\275\256\344\277\241\346\201\257.md"@@ -1,44 +1,81 @@-# 配置说明+# 配置信息-JiuwenClaw 的配置来源包括:`config/config.yaml`、`.env` 环境变量、以及 Web 前端各面板。本文档说明**哪些可在前端配置**、**哪些需手动修改文件**,以及各配置项的作用。+JiuwenClaw 的配置信息是您与智能体交互的基础设置。通过合理的配置,您可以连接不同的模型服务、启用多模态能力、配置第三方服务,以及调整系统行为参数。++本文档将详细介绍 JiuwenClaw 前端配置面板中的各项配置,帮助您快速上手并充分发挥系统能力。++---++## 一、配置入口++在左侧导航栏打开 **配置信息**,即可在网页上查看和修改与模型、第三方服务、免费搜索等相关的设置。修改后请点击保存;是否需等待服务就绪,以您使用的部署方式为准。++++配置面板包含以下主要区域:++- **模型配置**:默认对话模型、视频/音频/视觉模型(详见 [二、模型配置](#二模型配置))+- **Embed 配置**:向量嵌入服务(详见 [三、Embed 配置](#三embed-配置))+- **第三方服务**:Jina、博查、Serper、Perplexity、GitHub 等(详见 [四、第三方服务配置](#四第三方服务配置))+- **自演进配置**:技能自动改进能力(详见 [五、自演进配置](#五自演进配置))+- **上下文压缩**:对话历史管理策略(详见 [六、上下文压缩](#六上下文压缩))+- **工具安全护栏**:工具调用权限检查(详见 [七、工具安全护栏](#七工具安全护栏))++> 💡 **提示**:模型配置(`api_base`、`api_key`、`model`、`model_provider`)为必填项,其他配置均为可选。----## 一、前端配置面板可配置+## 二、模型配置++> 在使用 JiuwenClaw 之前,您需要先向模型提供商申请 API 密钥。请访问相应提供商的官网,按照指引申请 API 密钥。++### 2.1 支持配置的模型++JiuwenClaw 支持配置多种类型的模型,以满足不同场景的需求:++| 模型类型 | 作用 | 能力要求 | 是否必选 |+| ------------ | ------------------------------------------------------ | -------------------------------------------------------- | -------- |+| **默认模型** | 主对话核心模型,处理所有文本对话、任务规划、工具调用等 | 需具备**工具调用(Function Calling)**能力,支持多轮对话 | ✅ 必选 |+| **视频模型** | 视频理解与分析,支持视频内容问答、场景识别等 | 需具备**视频理解**能力,能处理视频输入 | ⭕ 可选 |+| **音频模型** | 语音识别与处理,支持语音转文字、音频内容分析等 | 需具备**语音识别/音频理解**能力 | ⭕ 可选 |+| **视觉模型** | 图像理解与分析,支持图像问答、OCR、场景描述等 | 需具备**图像理解**能力,能处理图片输入 | ⭕ 可选 |+| **图片生成模型** | 根据文本描述生成图片,支持AI绘画、图像创作等 | 需具备**图像生成**能力,能根据文本生成图片 | ⭕ 可选 |++> 💡 **提示**:默认模型是系统运行的基础,必须正确配置。视频、音频、视觉、图片生成模型为可选配置,当您需要相应多模态能力时再配置即可。-以下配置可通过 Web 端对应面板修改并保存,系统会自动写回配置文件或 `.env`。+### 2.2 配置项说明-**入口**:左侧导航 → **配置**+每种模型类型都包含以下配置项:-+| 配置项 | 说明 | 备注 |+| ---------------- | ----------------- | ------------------------------------------------------------ |+| `api_base` | 模型 API 基础地址 | 填写服务商提供的 API 地址,**无需包含 `/chat/completions` 后缀**,系统会自动补齐 |+| `api_key` | 模型 API 密钥 | 从模型服务商官网获取,注意保密 |+| `model` | 模型名称 | 填写具体的模型 ID,如 `gpt-4o`、`claude-3-opus`、`deepseek-chat` 等 |+| `model_provider` | 模型提供商类型 | 支持 `OpenAI`、`Azure`、`SiliconFlow` 等,用于适配不同服务商的 API 格式 |-**保存目标**:`.env`(环境变量)+> 💡 **测试功能**:配置面板提供了**测试按钮**,填写完模型配置后,可以点击"测试"按钮验证 API 连接是否正常。系统会发送一个简单的测试请求,如果成功会显示"测试成功",否则会提示错误信息。-| 配置项 | 环境变量 | 说明 |-|--------|----------|------|-| `api_base` | `API_BASE` | 模型 API 基础地址(如 `https://api.deepseek.com`) |-| `api_key` | `API_KEY` | 模型 API 密钥 |-| `model` | `MODEL_NAME` | 模型名称(如 `deepseek-chat`) |-| `model_provider` | `MODEL_PROVIDER` | 模型提供商(如 `OpenAI`) |-| `embed_api_base` | `EMBED_API_BASE` | Embed 服务 API 地址 |-| `embed_api_key` | `EMBED_API_KEY` | Embed 服务 API 密钥 |-| `embed_model` | `EMBED_MODEL` | Embed 模型名称 |-| `video_model` | `VIDEO_MODEL_NAME` | 视频处理调用模型 |-| `audio_model` | `AUDIO_MODEL_NAME` | 音频处理调用模型 |-| `vision_model` | `VISION_MODEL_NAME` | 图像处理调用模型 |-| `image_gen_model` | `IMAGE_GEN_MODEL_NAME` | 图片生成模型 |-| `jina_api_key` | `JINA_API_KEY` | Jina 搜索 API 密钥 |-| `serper_api_key` | `SERPER_API_KEY` | Serper 搜索 API 密钥 |-| `perplexity_api_key` | `PERPLEXITY_API_KEY` | Perplexity API 密钥 |-| `github_token` | `GITHUB_TOKEN` | GitHub Personal Access Token;SkillNet 搜索/安装走 GitHub API |-| `free_search_proxy_url` | `FREE_SEARCH_PROXY_URL` | 免费搜索和网页抓取使用的可选 HTTP/HTTPS 代理,例如 `http://username:[email protected]:8080` |-| `evolution_auto_scan` | `EVOLUTION_AUTO_SCAN` | 是否每轮对话后自动扫描可演进技能(`true`/`false`) |+-**说明**:保存后后端会重启以加载新配置。模型配置(`api_base`、`api_key`、`model`、`model_provider`)为必填项。+#### 配置示例-### 多模型管理与别名+以 OpenAI 兼容 API 为例:-配置面板的**模型列表**区块支持同时维护多个模型。每个模型条目的字段:+```+api_base: https://api.openai.com/v1+api_key: sk-your-openai-api-key+model: gpt-4o+model_provider: OpenAI+```++> 💡 **提示**:大多数模型服务商都提供 OpenAI 兼容的 API,您可以根据实际使用的服务商调整 `api_base` 和 `model` 参数。++### 2.4 多模型管理与别名++配置面板的**模型列表**区块支持同时维护多个模型,方便在不同模型间快速切换。++每个模型条目包含以下字段:| 字段 | 是否必填 | 说明 ||------|---------|------|@@ -54,318 +91,233 @@ JiuwenClaw 的配置来源包括:`config/config.yaml`、`.env` 环境变量、- 在所有已配置模型中必须全局唯一:不能与其他模型的 `alias` 或 `model_name` 相同;- 切换模型时(Web 下拉 / CLI `\model <name>`)可用 `alias` 或 `model_name` 作为标识符。-多模型配置保存后写入 `config.yaml` 的 `models.defaults` 列表,示例:+列表首位为默认使用的模型;可在 UI 中拖拽排序或点击"设为默认"调整首位。++### 2.3 多模态模型效果展示++当您配置了视频、音频或视觉模型后,JiuwenClaw 将自动启用相应的多模态能力。以下是各模型的应用场景示例:++#### 视频模型应用++以 **GLM-4.6V-Flash11** 视频理解 API 为例:++当您向 JiuwenClaw 发送视频文件并提问时,系统会调用视频模型进行分析:++```+用户:请分析这个视频,告诉我视频中有哪些主要场景?+[发送视频文件:meeting_recording.mp4]++JiuwenClaw:根据视频分析,该视频包含以下主要场景:+1. 会议室开场介绍(0:00-2:30)+2. 项目进度汇报(2:30-8:15)+3. 问题讨论环节(8:15-12:00)+4. 总结与下一步计划(12:00-15:00)+```++++#### 音频模型应用++以 **GLM-ASR-2512** 音频模型为例:++当您发送音频文件时,系统会调用音频模型进行语音识别或分析:++```+用户:请帮我转录这段录音的内容+[发送音频文件:voice_message.m4a]++JiuwenClaw:转录结果如下:+"明天下午三点在会议室B开项目评审会,请各位提前准备好相关材料..."+```++++#### 视觉模型应用++以 **GLM-4.6V-Flash11** 视觉模型为例:++当您发送图片并提问时,系统会调用视觉模型进行图像理解:++```+用户:这张图片中的表格数据是什么?+[发送图片:data_chart.png]++JiuwenClaw:根据图像分析,这是一个销售数据统计表:+- 一月销售额:120万+- 二月销售额:135万+- 三月销售额:148万+整体呈上升趋势...+```++++---++## 三、Embed 配置++Embed(嵌入)模型用于将文本转换为向量表示,是 JiuwenClaw 记忆系统实现语义检索的核心组件。++### 3.1 作用说明++Embed 模型的主要作用:++- **语义检索**:将记忆内容转换为向量,支持基于语义相似度的检索,而非简单的关键词匹配+- **记忆召回**:当您询问历史信息时,系统能更准确地找到相关记忆+- **混合检索**:与 BM25 全文检索结合,提供最佳的召回效果++> 💡 **提示**:Embed 配置为可选。若不配置,系统将使用 Mock Provider 进行基础检索。配置后可获得更精准的语义搜索能力。关于记忆系统的详细内容,请参考 [记忆](记忆.md) 文档。++### 3.2 配置项说明++| 配置项 | 说明 | 参考格式 | 备注 |+| ---------------- | ----------------------- | ------------------------------- | ----------------------------- |+| `embed_api_base` | Embed 服务 API 基础地址 | `https://api.siliconflow.cn/v1` | 填写 Embed 服务商的 API 地址 |+| `embed_api_key` | Embed 服务 API 密钥 | `sk-xxxxxxxxxxxxxxxx` | 从服务商官网获取 |+| `embed_model` | Embed 模型名称 | `BAAI/xxx` | 建议使用支持中文的 Embed 模型 |+++---++## 四、第三方服务配置++本节与 **「一、1.4」「一、1.5」** 对应,便于单独查阅「搜索与外部服务」相关能力。以下配置项均在 **配置信息** 面板中展示(均为可选)。++| 配置项 | 说明 | 参考 |+| --- | --- | --- |+| `jina_api_key` | Jina;网页抓取及部分搜索能力 | [Jina](https://jina.ai/) |+| `bocha_api_key` | 博查 Bocha Web Search | [博查开放平台](https://open.bochaai.com/) |+| `serper_api_key` | Serper 搜索 | [Serper](https://serper.dev/) |+| `perplexity_api_key` | Perplexity | [Perplexity](https://www.perplexity.ai/) |+| `github_token` | GitHub;SkillNet 等 | [GitHub Tokens](https://github.com/settings/tokens) |+| `teamskills_hub_token` | TeamSkillsHub 用户 Token | [TeamSkillsHub](https://teamskills.openjiuwen.com) |++> ⚠️ **注意**:均为可选。不填写时,对应能力可能不可用或走降级策略,以实际产品行为为准。++---++## 五、自演进配置++自演进配置控制 JiuwenClaw 的 Skills 自动改进能力。++++### 开关说明++- **配置项**:`evolution.enabled`+- **默认值**:`false`(关闭)+- **作用**:启用后,系统会自动检测 Skills 执行过程中的问题,并生成改进建议,持续优化技能表现++当开启自演进后,系统会:++1. 监听 Skills 执行过程和对话内容+2. 检测执行错误、用户反馈等改进信号+3. 自动生成改进建议并记录++> 📖 **详情**:关于自演进机制的详细说明,请参考 [Skill 自演进](Skill自演进.md) 文档。++---++## 六、上下文压缩++上下文压缩配置控制对话历史的管理策略。++++### 开关说明++- **配置项**:`context_engine.enabled`+- **默认值**:`true`(开启)+- **作用**:启用后,当对话内容超出上下文窗口限制时,系统会自动压缩和卸载部分内容,保持对话流畅++当开启上下文压缩后,系统会:++1. 监控对话消息数量和 Token 数量+2. 当超出阈值时,自动识别并归档"大而次要"的内容+3. 保留简要索引,为当前任务腾出空间++> 📖 **详情**:关于上下文压缩机制的详细说明,请参考 [上下文压缩卸载](上下文压缩卸载.md) 文档。++---++## 七、工具安全护栏++工具安全护栏配置控制工具调用时的权限检查机制。++++### 开关说明++- **配置项**:`permissions.enabled`+- **默认值**:`false`(关闭)+- **作用**:启用后,系统会在执行敏感工具操作前进行权限检查,根据配置策略决定是否需要用户确认++当开启工具安全护栏后,系统会:++1. 检查每个工具调用的权限配置+2. 根据规则判断行为:`allow`(直接执行)、`ask`(询问用户)、`deny`(拒绝执行)+3. 对于 `ask` 类操作,会弹出确认框让用户决定++### 权限规则示例```yaml-models:+permissions:+ enabled: truedefaults:- - alias: my-gpt # 显示名称,UI 和 CLI 均以此标识切换- model_client_config:- api_base: https://api.openai.com/v1- api_key: ${API_KEY}- model_name: gpt-4o- client_provider: OpenAI- timeout: 1800- verify_ssl: false- model_config_obj:- temperature: 0.95+ "*": "allow" # 默认允许所有操作+ tools:+ mcp_exec_command:+ "*": "ask" # 命令执行默认需确认+ patterns:+ - pattern: "rm -rf"+ action: "deny" # 危险命令直接拒绝```-列表首位为默认使用的模型;可在 UI 中拖拽排序或点击"设为默认"调整首位。+----## 二、前端不可配置--以下配置需通过**直接编辑 `config/config.yaml`** 或 **`.env`** 修改,无 Web 界面。--### 1. config.yaml 中仅文件可改的项--| 路径 | 说明 |-|------|------|-| `react.agent_name` | Agent 名称,默认 `main_agent` |-| `react.enable_task_loop` | 是否启用任务循环,默认 `false` |-| `react.max_iterations` | 最大迭代轮数,默认 100 |-| `react.model_name` | Agent 使用的模型名称(环境变量 `MODEL_NAME`,默认 `deepseek-chat`) |-| `react.answer_chunk_size` | Answer 流式输出块大小,默认 500 |-| `react.stream_chunk_threshold` | 流式输出块阈值,默认 50 |-| `react.stream_character_threshold` | 流式字符阈值,默认 2000 |-| `react.context_engine_config.enable_reload` | 是否启用上下文重载 |-| `react.context_engine_config.enable_kv_cache_release` | 是否启用 KV Cache 释放 |-| `react.context_engine_config.enabled` | 是否启用上下文引擎,默认 `true` |-| `react.subagents.code_agent.enabled` | 是否启用 Code 子 Agent,默认 `false` |-| `react.subagents.research_agent.enabled` | 是否启用 Research 子 Agent,默认 `false` |-| `react.evolution.enabled` | 是否启用 Skills 在线自演进 |-| `react.evolution.auto_scan` | 每轮对话后是否自动扫描可演进技能 |-| `react.evolution.skill_create` | 是否启用 SkillCreateRail(单 Agent)及 TeamSkillCreateRail(leader) |-| `react.evolution.skill_base_dir` | Skill 根目录,默认 `agent/skills` |-| `react.a2x_registry.base_url` | A2X 注册表基础地址 |-| `react.a2x_registry.timeout` | A2X 注册表超时时间,默认 30.0 |-| `react.a2x_registry.dataset` | 数据集名称,默认 `team_pool` |-| `react.a2x_registry.role` | 角色:`teammate` 或 `teamleader` |-| `tools` | 启用的工具列表,如 `[todo, skill]` |-| `browser.remote_debugging_address` | 远程调试地址 |-| `browser.remote_debugging_port` | 远程调试端口 |-| `browser.user_data_dir` | Chrome 用户数据目录 |-| `browser.profile_directory` | Chrome 配置文件目录 |-| `browser.chrome_path` | Chrome 可执行文件路径(字符串或按 OS 分的 map) |--另见:-- [模式配置](模式系统.md) — `modes` 配置段-- [工具权限与安全](工具权限与安全防护.md) — `permissions` 配置段--### 2. models 配置段(多模型配置)--可配置多个模型 Profile,分别用于主 Agent、视频、音频、视觉、图像生成等场景。--| 路径 | 说明 |-|------|------|-| `models.default.model_client_config` | 默认(主)模型连接配置:`api_base`、`api_key`、`model_name`、`client_provider`、`timeout`、`verify_ssl`、`custom_headers` |-| `models.default.model_config_obj` | 默认模型生成参数:`temperature` 等 |-| `models.default.is_default` | 是否为默认模型配置,默认 `true` |-| `models.video.model_client_config` | 视频处理模型 |-| `models.audio.model_client_config` | 音频处理模型 |-| `models.vision.model_client_config` | 视觉 / 图像理解模型 |-| `models.image_gen.model_client_config` | 图像生成模型 |-| `models.image_gen.model_config_obj` | 图像生成参数:`temperature` 等 |--每个子模型段均支持相同的 `model_client_config` 键:`api_base`、`api_key`、`model_name`、`client_provider`、`timeout`、`verify_ssl`。全部支持环境变量替换(如 `${VIDEO_API_BASE}`)。--### 3. embed 配置段(Embedding 配置)--| 路径 | 说明 |-|------|------|-| `embed.embed_api_key` | Embedding API 密钥 |-| `embed.embed_base_url` | Embedding API 地址 |-| `embed.embed_model` | Embedding 模型名称 |--### 4. memory 配置段(记忆系统)--| 路径 | 说明 |-|------|------|-| `memory.mode` | 内置记忆存储位置:`local` \| `cloud`(环境变量 `MEMORY_MODE`,默认 `local`) |-| `memory.engine` | 记忆引擎总开关:`builtin` \| `external` \| `both` \| `none` |-| `memory.external.provider` | 外接记忆 Provider:`openjiuwen` \| `mem0` \| `openviking` \| `<plugin>` |-| `memory.external.user_id` | 数据隔离标识 |-| `memory.external.scope_id` | Scope 标识 |--详见 [记忆系统](记忆.md)。--### 5. team 配置段(分布式 Team)--| 路径 | 说明 |-|------|------|-| `team.team_name` | 团队名称,默认 `jiuwen_team` |-| `team.lifecycle` | 生命周期模式:`persistent` |-| `team.runtime.mode` | 运行模式:`local` \| `distributed` |-| `team.runtime.role` | 进程角色:`leader` \| `teammate` |-| `team.runtime.member_name` | teammate 名称标识 |-| `team.teammate_mode` | teammate 构建方式:`build_mode` |-| `team.spawn_mode` | teammate 进程模式:`inprocess` |-| `team.leader.member_name` | Leader 成员名称,默认 `team_leader` |-| `team.leader.display_name` | Leader 显示名称 |-| `team.leader.persona` | Leader 角色描述 |-| `team.agents.leader.workspace.stable_base` | Leader workspace 稳定基址 |-| `team.agents.leader.max_iterations` | Leader 最大迭代轮数,默认 200 |-| `team.agents.leader.completion_timeout` | Leader 完成超时时间,默认 600.0 |-| `team.agents.teammate.workspace.stable_base` | Teammate workspace 稳定基址 |-| `team.agents.teammate.max_iterations` | Teammate 最大迭代轮数,默认 200 |-| `team.agents.teammate.completion_timeout` | Teammate 完成超时时间,默认 600.0 |-| `team.workspace.enabled` | 是否启用 team workspace,默认 `true` |-| `team.transport.type` | 传输类型:`inprocess` |-| `team.storage.type` | 存储类型:`sqlite` |--详见 [分布式 Team](分布式Team.md)。--### 6. task_memory 配置段(经验记忆)--| 路径 | 说明 |-|------|------|-| `task_memory.enabled` | 是否启用经验记忆工具,默认 `true` |-| `task_memory.llm_model` | 经验记忆使用的 LLM 模型(留空则用主模型) |-| `task_memory.embedding_model` | 经验记忆使用的 Embedding 模型 |-| `task_memory.api_key` | 经验记忆 API 密钥(留空则用主密钥) |-| `task_memory.api_base` | 经验记忆 API 地址(留空则用主地址) |-| `task_memory.retrieval_algo` | 检索算法:`ACE` \| `ReasoningBank` \| `ReMe`,默认 `ACE` |-| `task_memory.summary_algo` | 摘要算法:`ACE` \| `ReasoningBank` \| `ReMe`,默认 `ACE` |--启用后 Agent 将获得 `experience_retrieve`、`experience_learn`、`experience_clear` 三个工具。--### 7. email_settings 配置段(邮件)--| 路径 | 说明 |-|------|------|-| `email_settings.email_address` | 发件邮箱地址 |-| `email_settings.token` | 邮箱授权码 |-| `email_settings.smtp_server` | SMTP 服务器,默认 `smtp.gmail.com`(环境变量 `SMTP_SERVER`) |-| `email_settings.port` | SMTP 端口,默认 `587`(环境变量 `EMAIL_PORT`) |--### 8. extensions 配置段(扩展包)--| 路径 | 说明 |-|------|------|-| `extensions.extension_dirs` | 扩展包搜索目录,分号分隔(如 `E:/a;D:/b`),对应环境变量 `EXTENSION_DIRS` |--### 9. mcp 配置段(MCP 服务)--| 路径 | 说明 |-|------|------|-| `mcp.servers` | MCP 服务列表,每项含 `name`、`enabled`、`transport`(`stdio`/`sse`/`streamable-http`)、`command`、`args`、`url` 等 |--浏览器 MCP 运行时通过环境变量配置(见下方)。--### 10. channels 配置段(Channel 配置)--各 channel 的详细配置见 `config.yaml` 中的 `channels` 段。详见 [频道](频道.md)。--支持的 channel:`feishu`、`feishu_enterprise`、`xiaoyi`、`dingtalk`、`telegram`、`discord`、`whatsapp`、`wechat`、`wecom`。--### 11. updater 配置段(自动更新)--| 路径 | 说明 |-|------|------|-| `updater.enabled` | 是否启用自动更新,默认 `true` |-| `updater.repo_owner` | GitHub 仓库 owner |-| `updater.repo_name` | GitHub 仓库名 |-| `updater.release_api_url` | 自定义 Release API URL(空则用默认) |-| `updater.asset_name_pattern` | 资源文件名模式 |-| `updater.sha256_name_pattern` | SHA256 校验文件名模式 |-| `updater.timeout_seconds` | 更新检查超时,默认 `20` |+## 八、高级配置----+除 **配置信息** 页中的表单项外,产品还可通过**主配置**调整超时、温度、心跳间隔、上下文窗口阈值等(与界面中的「上下文压缩」「权限」「记忆禁忌」等开关配合使用)。**本文不列出这些项在磁盘上的位置**;若您需要离线修改或批量下发,请咨询部署方或管理员。++### 8.1 主配置中常见的逻辑项(概念名)-### 12. gateway 配置段(网关路由)--| 键 | 类型 | 默认值 | 说明 |-|---|------|--------|------|-| `gateway.session_map_scope` | string | `per_chat_bot` | SessionMap 作用域:`per_chat_bot`(同 chat+bot 共享会话)或 `per_chat_bot_user`(按 user 分会话)。仅企业场景使用,如飞书企业版等通道。 |--### 13. logging 配置段(日志)--| 键 | 类型 | 默认值 | 说明 |-|---|------|--------|------|-| `logging.level` | string | `INFO` | 全局日志级别 |-| `logging.console_level` | string | `INFO` | 控制台日志级别 |-| `logging.gateway` | string | `INFO` | Gateway 模块日志级别 |-| `logging.channel` | string | `INFO` | Channel 模块日志级别 |-| `logging.agent_server` | string | `INFO` | Agent Server 模块日志级别 |-| `logging.full` | string | `INFO` | 汇总日志级别 |--日志文件存放在 `~/.jiuwenclaw/agent/.logs/` 下,按 `gateway.log`、`channel.log`、`agent_server.log` 分流;`full.log` 为汇总。--### 14. telemetry 配置段(OpenTelemetry 遥测)--| 键 | 类型 | 默认值 | 说明 |-|---|------|--------|------|-| `telemetry.enabled` | bool | `false` | 总开关(环境变量 `OTEL_ENABLED` 优先) |-| `telemetry.exporter` | string | `otlp` | 导出器类型:`otlp` / `console` / `none` |-| `telemetry.endpoint` | string | `http://localhost:4317` | OTLP endpoint |-| `telemetry.protocol` | string | `grpc` | 传输协议:`grpc` / `http` |-| `telemetry.headers` | map | `{}` | 公共 OTLP headers,可被 traces/metrics 覆盖 |-| `telemetry.log_messages` | bool | `true` | 是否在 span event 中记录完整消息内容 |-| `telemetry.service_name` | string | `jiuwenclaw` | 服务名称标识 |-| `telemetry.provider_factory` | string | | 自定义 Provider Factory,格式 `module:function` |-| `telemetry.traces.exporter` | string | | Trace 导出器,留空回退到 `telemetry.exporter` |-| `telemetry.traces.endpoint` | string | | Trace endpoint,留空回退到 `telemetry.endpoint` |-| `telemetry.traces.protocol` | string | | Trace 协议,留空回退到 `telemetry.protocol` |-| `telemetry.traces.headers` | map | `{}` | Trace 专用 headers |-| `telemetry.metrics.exporter` | string | | Metrics 导出器,留空回退到 `telemetry.exporter` |-| `telemetry.metrics.endpoint` | string | | Metrics endpoint,留空回退到 `telemetry.endpoint` |-| `telemetry.metrics.protocol` | string | | Metrics 协议,留空回退到 `telemetry.protocol` |-| `telemetry.metrics.headers` | map | `{}` | Metrics 专用 headers |--### 15. 其他配置项--| 键 | 类型 | 默认值 | 说明 |-|---|------|--------|------|-| `preferred_language` | string | `zh` | Agent 默认回复语言(`zh` / `en`) |--### 16. 仅环境变量可配置的项--| 环境变量 | 说明 |-|----------|------|-| `HEARTBEAT_TIMEOUT` | 单次心跳请求超时(秒) |-| `HEARTBEAT_RELAY_CHANNEL_ID` | 心跳回传 channel(覆盖 config.yaml 的 `target`) |-| `HEARTBEAT_INTERVAL` | 心跳间隔(秒),覆盖 config.yaml 的 `every` |-| `BROWSER_RUNTIME_MCP_ENABLED` | 是否启用浏览器 MCP 运行时(`0`/`1`),默认 `1` |-| `BROWSER_RUNTIME_MCP_CLIENT_TYPE` | MCP 客户端类型(`stdio` / `sse` / `streamable-http`),推荐 `streamable-http` |-| `BROWSER_RUNTIME_MCP_SERVER_ID` | MCP 服务标识符,默认 `playwright_runtime_wrapper` |-| `BROWSER_RUNTIME_MCP_SERVER_NAME` | MCP 服务显示名称,默认 `playwright-runtime-wrapper` |-| `BROWSER_RUNTIME_MCP_SERVER_PATH` | MCP 服务 URL/路径(streamable-http 默认为 `http://127.0.0.1:8940/mcp`) |-| `BROWSER_RUNTIME_MCP_TIMEOUT_S` | MCP 服务请求超时(秒),默认 `300` |-| `BROWSER_RUNTIME_MCP_HOST` | MCP 服务主机,默认 `127.0.0.1` |-| `BROWSER_RUNTIME_MCP_PORT` | MCP 服务端口,默认 `8940` |-| `BROWSER_RUNTIME_MCP_PATH` | MCP 服务路径,默认 `/mcp` |-| `BROWSER_RUNTIME_MCP_COMMAND` | MCP 服务命令(stdio 模式,空则使用当前 python 可执行文件) |-| `BROWSER_RUNTIME_MCP_ARGS` | MCP 服务参数(stdio 模式,空则使用内置默认) |-| `BROWSER_RUNTIME_MCP_AUTO_SSE_FALLBACK` | stdio 模式下自动切换 SSE 回退(`0`/`1`),默认 `1` |-| `PLAYWRIGHT_CDP_URL` | Playwright 连接 Chrome 的 CDP 地址,默认 `http://127.0.0.1:9222` |-| `PLAYWRIGHT_TOOL_TIMEOUT_S` | Playwright 工具超时(秒),默认 `300` |-| `BROWSER_TIMEOUT_S` | 浏览器任务超时(秒),默认 `300` |-| `BROWSER_DRIVER` | 浏览器驱动模式:`managed`(自管理)/ `remote`(远程)/ `extension`(插件) |-| `BROWSER_ALLOW_SHORT_TIMEOUT_OVERRIDE` | 是否允许模型提供的超时短于 `BROWSER_TIMEOUT_S`;默认 `0`(关闭) |-| `BROWSER_PROFILE_NAME` | 浏览器 Profile 名称,默认 `Default` |-| `PLAYWRIGHT_MCP_COMMAND` | Playwright MCP 命令,默认 `npx` |-| `PLAYWRIGHT_MCP_ARGS` | Playwright MCP 参数,默认 `-y @playwright/mcp@latest` |-| `CUSTOM_HEADERS` | 模型 API 调用自定义 HTTP headers(JSON 格式或空) |-| `VIDEO_API_BASE` | 视频处理模型 API 地址 |-| `VIDEO_API_KEY` | 视频处理模型 API 密钥 |-| `VIDEO_MODEL_NAME` | 视频处理模型名称 |-| `VIDEO_PROVIDER` | 视频处理模型提供商 |-| `AUDIO_API_BASE` | 音频处理模型 API 地址 |-| `AUDIO_API_KEY` | 音频处理模型 API 密钥 |-| `AUDIO_MODEL_NAME` | 音频处理模型名称,默认 `openai/gpt-4o-audio-preview` |-| `AUDIO_PROVIDER` | 音频处理模型提供商 |-| `VISION_API_BASE` | 视觉/图像理解模型 API 地址 |-| `VISION_API_KEY` | 视觉/图像理解模型 API 密钥 |-| `VISION_MODEL_NAME` | 视觉/图像理解模型名称,默认 `bytedance-seed/seed-2.0-mini` |-| `VISION_PROVIDER` | 视觉/图像理解模型提供商 |-| `IMAGE_GEN_API_BASE` | 图像生成模型 API 地址,默认 `https://dashscope.aliyuncs.com/api/v1` |-| `IMAGE_GEN_API_KEY` | 图像生成模型 API 密钥 |-| `IMAGE_GEN_MODEL_NAME` | 图像生成模型名称,默认 `qwen-image-max` |-| `IMAGE_GEN_PROVIDER` | 图像生成模型提供商,默认 `DashScope` |-| `JINA_API_KEY` | Jina 搜索 API 密钥 |-| `SERPER_API_KEY` | Serper 搜索 API 密钥 |-| `PERPLEXITY_API_KEY` | Perplexity API 密钥 |-| `GITHUB_TOKEN` | GitHub Personal Access Token |-| `FREE_SEARCH_PROXY_URL` | 免费搜索可选 HTTP/HTTPS 代理 |-| `FREE_SEARCH_DDG_URL` | DuckDuckGo HTML 端点 URL,默认 `https://html.duckduckgo.com/html/` |-| `FREE_SEARCH_SSL_VERIFY` | 免费搜索 SSL 证书验证;默认 `true`,在企业代理后设为 `false` |-| `NO_PROXY` | 逗号分隔的跳过代理的主机列表 |-| `EMAIL_ADDRESS` | 发件邮箱地址(对应 `email_settings.email_address`) |-| `EMAIL_TOKEN` | 邮箱授权码(对应 `email_settings.token`) |-| `SMTP_SERVER` | SMTP 服务器(对应 `email_settings.smtp_server`) |-| `EMAIL_PORT` | SMTP 端口(对应 `email_settings.port`) |-| `EVOLUTION_AUTO_SCAN` | 是否每轮对话后自动扫描可演进技能(`true`/`false`) |-| `SKILLNET_DOWNLOAD_TIMEOUT` | SkillNet 下载超时(秒),默认 60 |-| `SKILLNET_MAX_RETRIES` | SkillNet 下载最大重试次数,默认 3 |-| `TEAM_SKILLS_HUB_BASE_URL` | TeamSkillsHub 市场地址(空则用默认 `https://teamskills.openjiuwen.com`) |-| `TEAM_SKILLS_HUB_USER_TOKEN` | TeamSkillsHub 用户 Token(与系统 Token 二选一) |-| `TEAM_SKILLS_HUB_SYSTEM_TOKEN` | TeamSkillsHub 系统 Token(与用户 Token 二选一) |-| `TEAM_SKILLS_HUB_TIMEOUT` | TeamSkillsHub 请求超时(秒),默认 60 |-| `TEAM_SKILLS_HUB_ALLOWED_DOWNLOAD_HOSTS` | TeamSkillsHub ZIP 下载主机白名单,逗号分隔 |-| `MEMORY_MODE` | 记忆模式(空则默认 `local`) |-| `MEMORY_ENGINE` | 记忆引擎:`builtin` \| `external` \| `both` \| `none` |-| `MEMORY_EXTERNAL_PROVIDER` | 外接记忆 Provider:`openjiuwen` \| `mem0` \| `openviking` \| `<plugin>` |-| `MEM0_API_KEY` | Mem0 API 密钥 |-| `MEM0_USER_ID` | Mem0 用户标识,默认 `jiuwenclaw-user` |-| `MEM0_AGENT_ID` | Mem0 Agent 标识,默认 `jiuwenclaw` |-| `OPENVIKING_ENDPOINT` | OpenViking 端点,默认 `http://127.0.0.1:1933` |-| `OPENVIKING_API_KEY` | OpenViking API 密钥 |-| `OPENVIKING_ACCOUNT` | OpenViking 账户,默认 `root` |-| `OPENVIKING_USER` | OpenViking 用户,默认 `default` |-| `EXTENSION_DIRS` | 扩展包搜索目录,分号分隔(对应 `extensions.extension_dirs`) |-| `OTEL_ENABLED` | 是否启用 OpenTelemetry(`true`/`false`),优先于 `telemetry.enabled` |-| `OTEL_EXPORTER` | OTLP 导出器类型(对应 `telemetry.exporter`) |-| `OTEL_ENDPOINT` | OTLP endpoint(对应 `telemetry.endpoint`) |-| `JIUWENCLAW_CONFIG_DIR` | 自定义 config 目录路径 |-| `JIUWENCLAW_DATA_DIR` | 用户数据根目录的绝对路径(其下为 `config/`、`agent/`、日志等)。未设置时默认为 `~/.jiuwenclaw`。须在**启动进程前**在系统或 Shell 环境中设置,以便首次加载时解析路径;仅写在 `config/.env` 中通常无法在首次解析数据根时生效。 |-| `JIUWENCLAW_DISABLE_CRON_TOOLS` | 设为 `1` 时禁用 Agent 侧 cron 定时任务工具注册,并从提示词中隐藏相关说明 |--更多环境变量见 `.env.template`。+下列为**主配置**里常见的逻辑路径名称,仅供与运维文档或发行说明对照;**不是**「配置信息」页上的每一个字段。++| 配置项(概念路径) | 说明 | 默认值(常见) |+| --- | --- | --- |+| `preferred_language` | 界面语言 | `zh` |+| `models.*.model_client_config.timeout` | 模型请求超时(秒) | `1800` |+| `models.*.model_client_config.verify_ssl` | 是否校验 SSL | `false` |+| `models.*.model_config_obj.temperature` | 温度 | `0.95` |+| `heartbeat.every` | 心跳间隔(秒) | `3600` |+| `context_engine.max_messages` | 上下文消息数阈值 | `100` |+| `context_engine.max_tokens` | 上下文 Token 阈值 | `100000` |++<a id="dotenv-configuration"></a>++### 8.2 与界面以外的运行参数++浏览器自动化、网络代理、部分搜索链路的细粒度开关等,可能由**运行环境或部署模板**提供,**不一定**出现在 **配置信息** 页。普通用户只需完成界面上的必填项与业务相关密钥即可;其余由管理员或运维处理。++### 8.3 配置生效的优先顺序(概念)++从高到低一般为:**您在 Web「配置信息」中保存的设置** → **运行环境注入的变量** → **产品内置默认**。具体行为以您使用的版本与部署方式为准。++> 💡 **提示**:保存后若短时间内未生效,可稍候重试或联系管理员确认服务是否已重载。----### 17. 配置优先级+## 常见问题++### Q: 配置保存后没有生效?++A: 配置保存后系统会自动重启后端服务,请等待几秒钟后再试。如果仍未生效,请检查配置格式是否正确。++### Q: 如何查看当前使用的模型?++A: 在配置面板中可以看到当前配置的模型信息。也可以通过系统日志查看实际调用的模型。++### Q: 多模态模型必须配置吗?++A: 不必须。视频、音频、视觉模型都是可选的。只有当您需要使用相应的多模态功能时才需要配置。-- **环境变量** > **config.yaml**-- 例如:`config.yaml` 中 `react.model_name: ${MODEL_NAME:-deepseek-chat}` 会先读 `MODEL_NAME` 环境变量,无则用默认值 `deepseek-chat`。-- 前端 ConfigPanel 保存的项会写入 `.env`,下次启动时优先加载。+---\ No newline at end of file