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..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,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. +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 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