feat: Enhance wiki functionality with recent activity log

This commit introduces a new "Recent Activity" section in the WikiBrowser component, allowing users to view the latest changes made to the wiki. The implementation includes:

- Addition of a toggleable recent activity log displaying the last five entries.
- Backend support for fetching the activity log from the knowledge base.
- Updates to the wiki ingest process to ensure draft pages are published post-ingest.
- Improvements to the deduplication process for entities and concepts during wiki page creation.

These enhancements aim to improve user engagement and provide better insights into wiki updates.
This commit is contained in:
wizardchen
2026-04-07 14:46:45 +08:00
parent 3386c0786b
commit 16a0bff7bd
5 changed files with 267 additions and 4 deletions
@@ -117,6 +117,15 @@ func (s *agentService) CreateAgentEngine(
systemPromptTemplate = config.ResolveSystemPrompt(config.WebSearchEnabled)
}
// 4.5 Append wiki guidelines if any search target is a wiki KB
for _, target := range config.SearchTargets {
kb, err := s.knowledgeBaseService.GetKnowledgeBaseByIDOnly(ctx, target.KnowledgeBaseID)
if err == nil && kb != nil && kb.Type == types.KnowledgeBaseTypeWiki {
systemPromptTemplate += "\n" + agent.WikiAgentSystemPromptAddendum
break
}
}
// 5. Create engine
engine := agent.NewAgentEngine(
config, chatModel, toolRegistry, eventBus,