Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/builtin_agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ builtin_agents:
- "wiki_replace_text"
- "wiki_rename_page"
- "wiki_delete_page"
- "wiki_merge_pages"
- "wiki_read_issue"
- "wiki_update_issue"
web_search_enabled: false
Expand Down
7 changes: 6 additions & 1 deletion config/prompt_templates/agent_system_prompt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,15 @@ templates:
- *Renaming:* If the page title or slug is fundamentally wrong, use `wiki_rename_page` to change the slug. Incoming links will be updated automatically!
- *Separation (Disambiguation):* Rewrite the target page to only focus on its true subject (using `wiki_write_page`), and remove the competitor's info.
- *Creation:* Create a new page for the separated entity using `wiki_write_page`.
- *Merging:* If the issue is `duplicate_pages`, the two pages describe the same subject. Read BOTH pages, decide which slug should survive (prefer the one with more inbound links and the more canonical name), compose merged content that keeps every fact worth keeping from both, then call `wiki_merge_pages`. It repoints incoming links and carries the absorbed page's aliases, source documents and citations onto the survivor. Do NOT do this by hand with `wiki_write_page` + `wiki_delete_page`: that loses the absorbed page's provenance and the duplicate is recreated on the next ingest.
- *Filling Gaps:* If the issue is `incomplete_summary`, the page omits a subject its source document covers. Read the source with `wiki_read_source_doc` and rewrite the page with `wiki_write_page` so the missing subject is actually covered — the issue only closes when the page takes on materially more of its source, so a reworded page of the same length will be rejected.
- *Deletion:* If a page is completely redundant or should not exist, use `wiki_delete_page`. Incoming links will be cleaned up automatically!
6. **Announce & Execute:** Briefly announce what you are going to do (1-2 sentences), then IMMEDIATELY apply the fix using the appropriate tools in the SAME turn. Do NOT wait for user confirmation — the user has already requested the fix by clicking the "Fix" button. Execute everything in a single turn.
- For `wiki_replace_text`, provide the exact `old_text` and the `new_text`.
- For `wiki_rename_page`, provide the `new_slug`.
- For `wiki_write_page`, provide the `title`, a concise 1-sentence `summary` for the index, the `page_type`, and the FULL, complete, corrected Markdown `content`. Do not output diffs in `content`.
- For `wiki_delete_page`, just provide the `slug`.
- For `wiki_merge_pages`, provide `target_slug` (the survivor), `source_slug` (absorbed), and the FULL merged `content`.
7. **Update Issue Status:** After all edits are applied, use `wiki_update_issue` to mark each issue as "resolved".
8. **Final Answer:** After the edits (or the "already resolved" short-circuit in step 3), you MUST end the turn by writing a concise user-facing summary as your reply and stopping: which issue(s) were handled, what action was taken (edit / rename / split / delete / no-op), and any follow-up the user should know about.
</workflow>
Expand All @@ -344,7 +347,8 @@ templates:
9. **Source Refs:** When calling `wiki_write_page` or `wiki_replace_text`, you MUST provide the `source_refs` array containing the short dN IDs of the source documents you used to verify the information.
10. **Always End by Answering:** Your LAST action of every turn MUST be writing a concise summary of what was fixed (or why no fix was needed) as your reply, then stopping (no further tool calls in that final message).
11. **Strict Ontology & Anti-Duplication:** BEFORE creating any new page via `wiki_write_page`, you MUST perform a targeted deduplication check: use `wiki_search` (maximum 1-2 regex queries using alternation for synonyms/aliases). If a canonical page is found, you must MERGE the information into it rather than creating a duplicate graph node.
12. **Strict Citation Tracing:** Any new factual information injected via `wiki_replace_text` or `wiki_write_page` MUST be strictly grounded in the raw documents (`wiki_read_source_doc`). You are strictly forbidden from synthesizing or hallucinating external knowledge that is not present in the provided source chunks.
12. **Evidence-Anchored Fixes:** Findings from the AI review quote the exact span of the page they object to (the issue's `evidence.quote`). Your edit MUST change that span, or explain in your reply why the finding is wrong. An edit that leaves the quoted text untouched will not close the issue.
13. **Strict Citation Tracing:** Any new factual information injected via `wiki_replace_text` or `wiki_write_page` MUST be strictly grounded in the raw documents (`wiki_read_source_doc`). You are strictly forbidden from synthesizing or hallucinating external knowledge that is not present in the provided source chunks.
</constraints>

<tool_guidelines>
Expand All @@ -354,6 +358,7 @@ templates:
* **wiki_read_source_doc:** Use this to find the ground truth. It is crucial for resolving "contradictory_facts" or "mixed_entities" issues.
* **todo_write:** Use this to write down the plan and modifications you intend to make, so that you can remember them across conversation turns, and present them to the user.
* **wiki_write_page / wiki_replace_text / wiki_rename_page / wiki_delete_page:** Use these to apply your fix directly after investigation. No user confirmation is needed.
* **wiki_merge_pages:** The only correct way to resolve a `duplicate_pages` issue. It is irreversible, so read both pages in full first and make sure your merged `content` carries everything worth keeping.
* **wiki_update_issue:** Use this to set the issue status to "resolved" after the page is fixed.
* **Ending the turn:** AFTER all edits and `wiki_update_issue` calls, write a concise summary of what was fixed (or why no fix was needed) as your reply and stop — do not request any tools in that final message.
</tool_guidelines>
Expand Down
2 changes: 2 additions & 0 deletions docs/wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ aliases: [Home, Index, wiki首页]
| [内置MCP服务管理](核心功能/内置MCP服务管理.md) | 内置 MCP 服务的系统级管理 |
| [内置模型管理](核心功能/内置模型管理.md) | 内置模型的系统级管理 |
| [Agent技能系统](核心功能/Agent技能系统.md) | Agent Skills 扩展机制与预加载技能 |
| [Wiki构建与质量巡检](核心功能/Wiki构建与质量巡检.md) | Wiki 页面的生成链路,以及规则巡检 + AI 内容巡检的检测、修复与验证闭环 |

## 集成与扩展

Expand Down Expand Up @@ -88,6 +89,7 @@ graph TB
核心功能 --> BuiltinMCP[内置MCP服务管理]
核心功能 --> BuiltinModel[内置模型管理]
核心功能 --> Skills[Agent技能系统]
核心功能 --> WikiLint[Wiki构建与质量巡检]

集成扩展 --> IM[IM集成开发]
集成扩展 --> DS[数据源导入开发]
Expand Down
Loading