From 3fb19768867fa9ff3b7cf1885dd338232946c470 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Tue, 12 May 2026 11:01:54 +0200 Subject: [PATCH] multi_agent_chat/main_agent: route KB work through task(knowledge_base) in --- .../markdown/main_agent_tool_routing.md | 25 ++++++++++++------- .../markdown/providers/google.md | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/markdown/main_agent_tool_routing.md b/surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/markdown/main_agent_tool_routing.md index e91075c35..5b0fbea89 100644 --- a/surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/markdown/main_agent_tool_routing.md +++ b/surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/markdown/main_agent_tool_routing.md @@ -1,15 +1,22 @@ -Use **task** for anything beyond your direct SurfSense tools: calendar, mail, -chat, tickets, documents in third-party systems, connector-specific discovery, -deliverables (reports, podcasts, images, etc.), and other specialized routes. -The live list of specialists you may target with **task** for this workspace is in -`` (later in this prompt). +Use **task** for any work beyond your direct SurfSense tools. Two builtin +specialists are always available: + +- **knowledge_base** — owns the user's workspace (documents and folders). Route + here whenever the user wants to create, read, edit, search, organise, or + remove a document or folder (e.g. *"save these notes to my KB"*, *"find my Q2 + roadmap"*, *"rename this folder"*). +- **general_purpose** — ad-hoc multi-step work that doesn't fit any specialist. + +The connector specialists listed in `` (later in this +prompt) cover calendar, mail, chat, tickets, third-party documents, +deliverables, and other route-specific work. Your **direct** SurfSense tools are only: **update_memory**, **web_search**, -**scrape_webpage**, and **search_surfsense_docs**. The runtime may also attach -deep-agent helpers (e.g. todos, filesystem, **task** itself). Use **task** whenever -the user needs capabilities **not** listed in the `` section (that section appears -later in this system prompt, after citation rules). +**scrape_webpage**, and **search_surfsense_docs**. The runtime also attaches +deep-agent helpers (todos, **task** itself). **You have no filesystem tools** — +any workspace read or write goes through **task(knowledge_base, …)**, never +through a `write_file` call on this agent. Do not treat live third-party state as if it were already in the indexed knowledge base; reach it via **task**. diff --git a/surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/markdown/providers/google.md b/surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/markdown/providers/google.md index c72c1bc72..dc5073538 100644 --- a/surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/markdown/providers/google.md +++ b/surfsense_backend/app/agents/multi_agent_chat/main_agent/system_prompt/markdown/providers/google.md @@ -14,5 +14,5 @@ Workflow (Understand → Plan → Act → Verify): Discipline: - Do not imply access to connectors, MCP tools, or deliverable generators except via **task**. -- Path arguments for filesystem tools must be exact strings from tool results — never invent paths. +- Pass paths to **task(knowledge_base, …)** only when you saw them in `` or ``. Otherwise describe the document in natural language and let the subagent resolve it.