From fc0f8f5538cda2e045f69a419d0d44baefbaa80f Mon Sep 17 00:00:00 2001 From: "nick.yi" Date: Fri, 24 Jul 2026 11:09:24 +0800 Subject: [PATCH 1/2] optimize user_goal_agent,next_action_agent --- .../functions/route_to_agent.json | 4 ++-- .../templates/reasoner.naive.liquid | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/functions/route_to_agent.json b/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/functions/route_to_agent.json index 8cb8b99ac..286e3f8b7 100644 --- a/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/functions/route_to_agent.json +++ b/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/functions/route_to_agent.json @@ -6,7 +6,7 @@ "properties": { "next_action_agent": { "type": "string", - "description": "Agent for next action based on user latest response" + "description": "Agent for next action based on user's latest response and active goal." }, "next_action_reason": { "type": "string", @@ -14,7 +14,7 @@ }, "user_goal_agent": { "type": "string", - "description": "Agent who can achieve the user's active request." + "description": "Agent who can achieve the user's active goal." }, "conversation_end": { "type": "boolean", diff --git a/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid b/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid index 94400f673..ffe762b3a 100644 --- a/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid +++ b/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid @@ -3,11 +3,12 @@ Route to the last handling agent in priority. {% if expected_next_action_agent != empty -%} Expected next action agent is {{ expected_next_action_agent }}. {%- else -%} -Next action agent is inferred based on user lastest response. +next_action_agent is determined from the latest user message in the context of the active user_goal_agent. +If the user only provides requested information, keep the previous next_action_agent or fall back to the active user_goal_agent. {%- endif %} {% if expected_user_goal_agent != empty -%} Expected user goal agent is {{ expected_user_goal_agent }}. {%- else -%} -User goal agent is inferred based on the user's active request. -If the latest user message starts a new request, use the latest request; otherwise keep the existing active request. +user_goal_agent is inferred from the user's active goal. +Keep the existing user_goal_agent unless the latest user message explicitly starts a different task or workflow. {%- endif %} \ No newline at end of file From 3114becbe46357f1808c03ccbbaed01b5c3a7340 Mon Sep 17 00:00:00 2001 From: "nick.yi" Date: Fri, 24 Jul 2026 14:06:16 +0800 Subject: [PATCH 2/2] optimize reasoner.naive --- .../templates/reasoner.naive.liquid | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid b/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid index ffe762b3a..1861ab36b 100644 --- a/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid +++ b/src/Infrastructure/BotSharp.Core/data/agents/01fcc3e5-9af7-49e6-ad7a-a760bd12dc4a/templates/reasoner.naive.liquid @@ -3,12 +3,12 @@ Route to the last handling agent in priority. {% if expected_next_action_agent != empty -%} Expected next action agent is {{ expected_next_action_agent }}. {%- else -%} -next_action_agent is determined from the latest user message in the context of the active user_goal_agent. -If the user only provides requested information, keep the previous next_action_agent or fall back to the active user_goal_agent. +Next action agent is determined from the latest user message in the context of the active user goal. +If the user only provides requested information, keep the previous next action agent or fall back to the agent for the active user goal. {%- endif %} {% if expected_user_goal_agent != empty -%} Expected user goal agent is {{ expected_user_goal_agent }}. {%- else -%} -user_goal_agent is inferred from the user's active goal. -Keep the existing user_goal_agent unless the latest user message explicitly starts a different task or workflow. +User goal agent is inferred from the user's active goal. +Keep the existing user goal agent unless the latest user message explicitly starts a different task or workflow. {%- endif %} \ No newline at end of file