feat: Introduce Wiki Fixer agent and related functionalities
- Added a new built-in agent, "Wiki Fixer," designed to repair and optimize Wiki pages based on linter issues, with multilingual support for enhanced accessibility. - Implemented a corresponding system prompt detailing the agent's role, mission, and workflow for effective issue resolution. - Introduced new API functions for listing and updating wiki issues, allowing for better management of content conflicts and errors. - Enhanced the frontend with new UI elements to display pending issues and facilitate auto-fixing, improving user interaction with the Wiki content. These changes significantly enhance the agent's capabilities for maintaining the accuracy and quality of Wiki pages, fostering a more reliable knowledge base.
This commit is contained in:
@@ -37,6 +37,9 @@ type AgentConfig struct {
|
||||
// Whether to retrieve knowledge base only when explicitly mentioned with @ (default: false)
|
||||
RetrieveKBOnlyWhenMentioned bool `json:"retrieve_kb_only_when_mentioned"`
|
||||
|
||||
// Whether to retain retrieval history (like wiki_read_page results) across turns (default: false)
|
||||
RetainRetrievalHistory bool `json:"retain_retrieval_history"`
|
||||
|
||||
// Skills configuration (Progressive Disclosure pattern)
|
||||
SkillsEnabled bool `json:"skills_enabled"` // Whether skills are enabled (default: false)
|
||||
SkillDirs []string `json:"skill_dirs"` // Directories to search for skills
|
||||
|
||||
@@ -22,6 +22,10 @@ const (
|
||||
BuiltinKnowledgeGraphExpertID = "builtin-knowledge-graph-expert"
|
||||
// BuiltinDocumentAssistantID is the ID for the built-in document assistant agent
|
||||
BuiltinDocumentAssistantID = "builtin-document-assistant"
|
||||
// BuiltinWikiResearcherID is the ID for the built-in wiki researcher agent
|
||||
BuiltinWikiResearcherID = "builtin-wiki-researcher"
|
||||
// BuiltinWikiFixerID is the ID for the built-in wiki fixer agent
|
||||
BuiltinWikiFixerID = "builtin-wiki-fixer"
|
||||
)
|
||||
|
||||
// AgentMode constants for agent running mode
|
||||
@@ -115,6 +119,9 @@ type CustomAgentConfig struct {
|
||||
// When false, knowledge base retrieval happens according to KBSelectionMode
|
||||
RetrieveKBOnlyWhenMentioned bool `yaml:"retrieve_kb_only_when_mentioned" json:"retrieve_kb_only_when_mentioned"`
|
||||
|
||||
// Whether to retain retrieval history across turns
|
||||
RetainRetrievalHistory bool `yaml:"retain_retrieval_history" json:"retain_retrieval_history"`
|
||||
|
||||
// ===== Image Upload / Multimodal Settings =====
|
||||
// Whether image upload is enabled for this agent (default: false)
|
||||
ImageUploadEnabled bool `yaml:"image_upload_enabled" json:"image_upload_enabled"`
|
||||
@@ -288,6 +295,8 @@ var BuiltinAgentRegistry = map[string]func(uint64) *CustomAgent{}
|
||||
var builtinAgentIDsOrdered = []string{
|
||||
BuiltinQuickAnswerID,
|
||||
BuiltinSmartReasoningID,
|
||||
BuiltinWikiResearcherID,
|
||||
BuiltinWikiFixerID,
|
||||
BuiltinDeepResearcherID,
|
||||
BuiltinDataAnalystID,
|
||||
BuiltinKnowledgeGraphExpertID,
|
||||
|
||||
@@ -52,6 +52,13 @@ type WikiPageService interface {
|
||||
// RebuildLinks re-parses all pages and rebuilds bidirectional link references.
|
||||
RebuildLinks(ctx context.Context, kbID string) error
|
||||
|
||||
// InjectCrossLinks scans specified pages and injects [[wiki-links]] for mentions
|
||||
// of other wiki page titles/aliases in the content.
|
||||
InjectCrossLinks(ctx context.Context, kbID string, affectedSlugs []string)
|
||||
|
||||
// RebuildIndexPage regenerates the index page.
|
||||
RebuildIndexPage(ctx context.Context, kbID string) error
|
||||
|
||||
// ListAllPages retrieves all wiki pages in a knowledge base without pagination.
|
||||
// Used for index rebuild, graph generation, cross-link injection, etc.
|
||||
ListAllPages(ctx context.Context, kbID string) ([]*types.WikiPage, error)
|
||||
|
||||
@@ -169,6 +169,7 @@ type WikiStats struct {
|
||||
OrphanCount int64 `json:"orphan_count"` // pages with no inbound links
|
||||
RecentUpdates []*WikiPage `json:"recent_updates"` // last N updated pages
|
||||
PendingTasks int64 `json:"pending_tasks"` // number of documents waiting to be ingested
|
||||
PendingIssues int64 `json:"pending_issues"` // number of pending wiki issues
|
||||
IsActive bool `json:"is_active"` // whether wiki ingestion is currently running
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user