WeKnora/internal/agent
wizardchen d199628701 fix(agent): exclude wiki-only KBs from quick-answer (RAG) mode
Quick-answer agent mode retrieves purely through vector/keyword chunk
search and ships with no `allowed_tools`, so the existing capability
filter (which only reads from `allowed_tools`) let wiki-only KBs through
in every entry point. End result: users could @-mention, select, and
receive suggested questions from wiki-only KBs in quick-answer mode,
but the underlying retrieval always returned empty.

Treat "RAG-only" as an implicit property of `agent_mode = quick-answer`
and union it with the tool-derived filter. The same predicate is now
used everywhere the user can pick or be steered toward a KB:

Backend
- `tools.DeriveKBFilterForAgent` / `KBSatisfiesAgentRequirements`
  layer the implicit quick-answer requirement on top of tool derivation.
- `ListKnowledgeBases`, `SearchKnowledge` (shared-agent `@file`),
  `resolveKnowledgeBasesFromAgent` (chat runtime), `/search` IM command,
  and `GetSuggestedQuestions` now all use the agent-mode-aware variant.
- `GetSuggestedQuestions` also skips the wiki-page fallback for
  quick-answer agents to cover the `selected` / explicit-kb-ids paths
  where a wiki-only KB could still slip through.

Frontend
- `deriveKbFilterForAgent` / `kbSatisfiesAgentRequirements` mirror the
  Go helpers.
- `@` mention dropdown (`Input-field.vue`) uses the new helper.
- Agent editor's "specified KB" picker (`AgentEditorModal.vue`) grays
  out wiki-only KBs for quick-answer agents with a tooltip, and the
  pre-save warning fires for quick-answer mode too.
- i18n: add `agentEditor.agentType.kbMismatch.quickAnswer` across all
  four locales.
2026-05-12 16:27:28 +08:00
..
approval fix(agent): enhance user authorization and concurrency handling in tool approval 2026-05-10 22:57:12 +08:00
memory feat(agent): enhance message consolidation and context management 2026-03-25 22:08:29 +08:00
skills feat: adapt preloaded skills to smart-reasoning agent 2026-02-04 20:08:49 +08:00
token feat(agent): enhance message consolidation and context management 2026-03-25 22:08:29 +08:00
tools fix(agent): exclude wiki-only KBs from quick-answer (RAG) mode 2026-05-12 16:27:28 +08:00
act.go fix(agent): 加固 MCP 工具人审批的跨实例与并发语义 2026-05-10 22:57:12 +08:00
const.go feat: Implement wiki_config updates in knowledge base management 2026-04-22 21:17:21 +08:00
engine.go refactor(agent): rebuild multi-turn history from DB, drop llmcontext layer 2026-05-12 12:26:24 +08:00
engine_image_test.go feat: auto-describe MCP tool result images via VLM 2026-03-25 21:38:15 +08:00
engine_test.go refactor(agent): rebuild multi-turn history from DB, drop llmcontext layer 2026-05-12 12:26:24 +08:00
finalize.go fix(agent): 修复WeKnora对话完前端未显示结束标记问题 2026-05-07 16:34:20 +08:00
langfuse_test.go feat(observability): instrument agent ReAct loop and tool calls in Langfuse 2026-04-24 19:58:08 +08:00
observe.go refactor(agent): rebuild multi-turn history from DB, drop llmcontext layer 2026-05-12 12:26:24 +08:00
observe_test.go fix(agent): terminate ReAct loop on final_answer regardless of arg parse success 2026-04-23 19:36:28 +08:00
prompts.go feat: Update agent type presets and prompt templates for improved knowledge base handling 2026-04-22 21:18:34 +08:00
prompts_wiki.go fix(ingest): stop hallucinating summaries from filenames on empty PDFs 2026-05-06 11:23:32 +08:00
prompts_wiki_test.go feat: Enhance wiki extraction and configuration options 2026-04-22 21:18:32 +08:00
think.go chore(agent): log natural-stop candidate when no tool calls 2026-05-07 18:28:28 +08:00