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:
@@ -369,9 +369,17 @@ func (e *AgentEngine) buildMessagesWithLLMContext(
|
||||
}
|
||||
|
||||
if len(llmContext) > 0 {
|
||||
// Redact KB tool results from previous turns to prevent the LLM
|
||||
// from reusing stale retrieval data when the KB has been modified.
|
||||
sanitized := redactHistoryKBResults(llmContext)
|
||||
var sanitized []chat.Message
|
||||
if e.config.RetainRetrievalHistory {
|
||||
sanitized = llmContext
|
||||
logger.Infof(context.Background(), "Retaining full retrieval history in context (RetainRetrievalHistory=true)")
|
||||
} else {
|
||||
// Redact KB tool results from previous turns to prevent the LLM
|
||||
// from reusing stale retrieval data when the KB has been modified.
|
||||
sanitized = redactHistoryKBResults(llmContext)
|
||||
logger.Infof(context.Background(), "Added %d history messages to context (KB tool results redacted)", len(llmContext))
|
||||
}
|
||||
|
||||
for _, msg := range sanitized {
|
||||
if msg.Role == "system" {
|
||||
continue
|
||||
@@ -380,7 +388,6 @@ func (e *AgentEngine) buildMessagesWithLLMContext(
|
||||
messages = append(messages, msg)
|
||||
}
|
||||
}
|
||||
logger.Infof(context.Background(), "Added %d history messages to context (KB tool results redacted)", len(llmContext))
|
||||
}
|
||||
|
||||
// Build user message with runtime context safety tag
|
||||
|
||||
Reference in New Issue
Block a user