Skip to content

Commit 02d3880

Browse files
authored
Merge pull request microsoft#449 from microsoft/macae-v3-dev-marktayl
fix MStep agent name issue, fix json definitions
2 parents 544111e + 4ea2a06 commit 02d3880

File tree

7 files changed

+56
-82
lines changed

7 files changed

+56
-82
lines changed

data/agent_teams/hr.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"id": "3",
3-
"team_id": "team-3",
2+
"id": "1",
3+
"team_id": "team-1",
44
"name": "Human Resources Team",
55
"status": "visible",
66
"created": "",
@@ -10,15 +10,15 @@
1010
"input_key": "",
1111
"type": "",
1212
"name": "HRHelperAgent",
13-
"deployment_name": "gpt-4.1",
13+
"deployment_name": "gpt-4.1-mini",
1414
"icon": "",
1515
"system_message": "You have access to a number of HR related MCP tools for tasks like employee onboarding, benefits management, policy guidance, and general HR inquiries. Use these tools to assist employees with their HR needs efficiently and accurately.If you need more information to accurately call these tools, do not make up answers, call the ProxyAgent for clarification.",
1616
"description": "An agent that has access to various HR tools to assist employees with onboarding, benefits, policies, and general HR inquiries.",
1717
"use_rag": false,
1818
"use_mcp": true,
1919
"use_bing": false,
2020
"use_reasoning": false,
21-
"index_name": "macae-index",
21+
"index_name": "",
2222
"index_foundry_name": "",
2323
"index_endpoint": "",
2424
"coding_tools": false
@@ -27,30 +27,30 @@
2727
"input_key": "",
2828
"type": "",
2929
"name": "TechnicalSupportAgent",
30-
"deployment_name": "gpt-4.1",
30+
"deployment_name": "gpt-4.1-mini",
3131
"icon": "",
3232
"system_message": "You have access to a number of technical support MCP tools for tasks such as provisioning laptops, setting up email accounts, troubleshooting, software/hardware issues, and IT support. Use these tools to assist employees with their technical needs efficiently and accurately. If you need more information to accurately call these tools, do not make up answers, call the ProxyAgent for clarification.",
3333
"description": "An agent that has access to various technical support tools to assist employees with IT needs like laptop provisioning, email setup, troubleshooting, and software/hardware issues.",
3434
"use_rag": false,
3535
"use_mcp": true,
3636
"use_bing": false,
3737
"use_reasoning": false,
38-
"index_name": "macae-index",
38+
"index_name": "",
3939
"index_foundry_name": "",
40-
"coding_tools": true
40+
"coding_tools": false
4141
},
4242
{
4343
"input_key": "",
4444
"type": "",
4545
"name": "ProxyAgent",
46-
"deployment_name": "gpt-4.1",
46+
"deployment_name": "",
4747
"icon": "",
4848
"system_message": "",
4949
"description": "",
5050
"use_rag": false,
5151
"use_mcp": false,
5252
"use_bing": false,
53-
"use_reasoning": true,
53+
"use_reasoning": false,
5454
"index_name": "",
5555
"index_foundry_name": "",
5656
"coding_tools": false

data/agent_teams/marketing.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
11
{
2-
"id": "1",
3-
"team_id": "team-1",
2+
"id": "2",
3+
"team_id": "team-2",
44
"name": "Product Marketing Team",
5-
"status": "",
5+
"status": "visible",
66
"created": "",
77
"created_by": "",
88
"agents": [
99
{
1010
"input_key": "",
1111
"type": "",
12-
"name": "CustomerDataAgent",
13-
"deployment_name": "gpt-4.1",
12+
"name": "ProductAgent",
13+
"deployment_name": "gpt-4.1-mini",
1414
"icon": "",
15-
"system_message": "You have access to internal customer data through a secure index. Use this data to answer questions about customers, their interactions with customer service, satisfaction, etc. Be mindful of privacy and compliance regulations when handling customer data.",
16-
"description": "An agent that has access to internal customer data, ask this agent if you have questions about customers or their interactions with customer service, satisfaction, etc.",
17-
"use_rag": true,
18-
"use_mcp": false,
15+
"system_message": "You are a Product agent. You have knowledge about product management, development, and compliance guidelines. When asked to call a function, you should summarize back what was done.",
16+
"description": "This agent specializes in product management, development, and related tasks. It can provide information about products, manage inventory, handle product launches, analyze sales data, and coordinate with other teams like marketing and tech support.",
17+
"use_rag": false,
18+
"use_mcp": true,
1919
"use_bing": false,
2020
"use_reasoning": false,
21-
"index_name": "macae-index",
21+
"index_name": "",
2222
"index_foundry_name": "",
2323
"index_endpoint": "",
2424
"coding_tools": false
2525
},
2626
{
2727
"input_key": "",
2828
"type": "",
29-
"name": "OrderDataAgent",
30-
"deployment_name": "gpt-4.1",
29+
"name": "MarketingAgent",
30+
"deployment_name": "gpt-4.1-mini",
3131
"icon": "",
32-
"system_message": "You have access to internal order, inventory, product, and fulfilment data through a secure index. Use this data to answer questions about products, shipping delays, customer orders, warehouse management, etc. Be mindful of privacy and compliance regulations when handling customer data.",
33-
"description": "An agent that has access to internal order, inventory, product, and fulfilment data. Ask this agent if you have questions about products, shipping delays, customerr orders, warehouse management, etc.",
34-
"use_rag": true,
35-
"use_mcp": false,
32+
"system_message": "You are a Marketing agent. You specialize in marketing strategy, campaign development, content creation, and market analysis. You help create effective marketing campaigns, analyze market data, and develop promotional content for products and services.",
33+
"description": "This agent specializes in marketing, campaign management, and analyzing market data.",
34+
"use_rag": false,
35+
"use_mcp": true,
3636
"use_bing": false,
3737
"use_reasoning": false,
38-
"index_name": "macae-index",
38+
"index_name": "",
3939
"index_foundry_name": "",
4040
"coding_tools": true
4141
},
4242
{
4343
"input_key": "",
4444
"type": "",
45-
"name": "AnalysisRecomendationAgent",
46-
"deployment_name": "o4-mini",
45+
"name": "ProxyAgent",
46+
"deployment_name": "gpt-4.1-mini",
4747
"icon": "",
48-
"system_message": "You are a reasoning agent that can analyze customer data and provide recommendations for improving customer satisfaction and retention. You do not have access to any data sources, but you can reason based on the information provided to you by other agents. Use your reasoning skills to identify patterns, trends, and insights that can help improve customer satisfaction and retention. Provide actionable recommendations based on your analysis. You have access to other agents that can answer questions and provide data about customers, products, orders, inventory, and fulfilment. Use these agents to gather information as needed.",
49-
"description": "A reasoning agent that can analyze customer data and provide recommendations for improving customer satisfaction and retention.",
48+
"system_message": "",
49+
"description": "",
5050
"use_rag": false,
5151
"use_mcp": false,
5252
"use_bing": false,
53-
"use_reasoning": true,
53+
"use_reasoning": false,
5454
"index_name": "",
5555
"index_foundry_name": "",
5656
"coding_tools": false
5757
}
5858
],
5959
"protected": false,
60-
"description": "Team focused on individualized customer relationship management and overall customer satisfaction.",
60+
"description": "Team focused on products and product marketing.",
6161
"logo": "",
6262
"plan": "",
6363
"starting_tasks": [
6464
{
6565
"id": "task-1",
66-
"name": "Satisfaction Plan",
67-
"prompt": "Create a plan to improve Emily Thompson's satisfaction.",
66+
"name": "Draft a press release",
67+
"prompt": "Write a press release about our current products",
6868
"created": "",
6969
"creator": "",
7070
"logo": ""

data/agent_teams/retail.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"input_key": "",
1111
"type": "",
1212
"name": "CustomerDataAgent",
13-
"deployment_name": "gpt-4.1",
13+
"deployment_name": "gpt-4.1-mini",
1414
"icon": "",
1515
"system_message": "You have access to internal customer data through a secure index. Use this data to answer questions about customers, their interactions with customer service, satisfaction, etc. Be mindful of privacy and compliance regulations when handling customer data.",
1616
"description": "An agent that has access to internal customer data, ask this agent if you have questions about customers or their interactions with customer service, satisfaction, etc.",
@@ -27,7 +27,7 @@
2727
"input_key": "",
2828
"type": "",
2929
"name": "OrderDataAgent",
30-
"deployment_name": "gpt-4.1",
30+
"deployment_name": "gpt-4.1-mini",
3131
"icon": "",
3232
"system_message": "You have access to internal order, inventory, product, and fulfilment data through a secure index. Use this data to answer questions about products, shipping delays, customer orders, warehouse management, etc. Be mindful of privacy and compliance regulations when handling customer data.",
3333
"description": "An agent that has access to internal order, inventory, product, and fulfilment data. Ask this agent if you have questions about products, shipping delays, customerr orders, warehouse management, etc.",

src/backend/app_kernel.py

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import asyncio
33
import logging
44
import os
5-
65
# Azure monitoring
76
import re
87
import uuid
@@ -13,40 +12,22 @@
1312
from azure.monitor.opentelemetry import configure_azure_monitor
1413
from common.config.app_config import config
1514
from common.database.database_factory import DatabaseFactory
16-
from common.models.messages_kernel import (
17-
AgentMessage,
18-
AgentType,
19-
HumanClarification,
20-
HumanFeedback,
21-
InputTask,
22-
Plan,
23-
PlanStatus,
24-
PlanWithSteps,
25-
Step,
26-
UserLanguage,
27-
)
15+
from common.models.messages_kernel import (AgentMessage, AgentType,
16+
HumanClarification, HumanFeedback,
17+
InputTask, Plan, PlanStatus,
18+
PlanWithSteps, Step, UserLanguage)
2819
from common.utils.event_utils import track_event_if_configured
29-
20+
from common.utils.utils_date import format_dates_in_messages
3021
# Updated import for KernelArguments
3122
from common.utils.utils_kernel import rai_success
32-
3323
# FastAPI imports
34-
from fastapi import (
35-
FastAPI,
36-
HTTPException,
37-
Query,
38-
Request,
39-
WebSocket,
40-
WebSocketDisconnect,
41-
)
24+
from fastapi import (FastAPI, HTTPException, Query, Request, WebSocket,
25+
WebSocketDisconnect)
4226
from fastapi.middleware.cors import CORSMiddleware
4327
from kernel_agents.agent_factory import AgentFactory
44-
4528
# Local imports
4629
from middleware.health_check import HealthCheckMiddleware
47-
from common.utils.utils_date import format_dates_in_messages
4830
from v3.api.router import app_v3
49-
5031
# Semantic Kernel imports
5132
from v3.orchestration.orchestration_manager import OrchestrationManager
5233

src/backend/v3/magentic_agents/proxy_agent.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ def __init__(self, user_id: str = None, **kwargs):
100100
effective_user_id = user_id or current_user_id.get() or ""
101101
super().__init__(
102102
name="ProxyAgent",
103-
description="""Call this agent when you need to clarify requests by asking the human user
104-
for more information. Ask it for more details about any unclear requirements, missing information,
105-
or if you need the user to elaborate on any aspect of the task.""",
103+
description="Call this agent when you need to clarify requests by asking the human user for more information. Ask it for more details about any unclear requirements, missing information, or if you need the user to elaborate on any aspect of the task.",
106104
user_id=effective_user_id,
107105
**kwargs
108106
)

src/backend/v3/models/models.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,9 @@ class PlanStatus(str, Enum):
1616

1717
class MStep(BaseModel):
1818
"""model of a step in a plan"""
19-
_agent: str = ""
19+
agent: str = ""
2020
action: str = ""
2121

22-
@property
23-
def agent(self):
24-
return self._agent
25-
26-
@agent.setter
27-
def agent(self, value):
28-
self._agent = value if value is not None else ""
29-
30-
3122
class MPlan(BaseModel):
3223
"""model of a plan"""
3324
id: str = Field(default_factory=lambda: str(uuid.uuid4()))

src/backend/v3/orchestration/human_approval_manager.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from semantic_kernel.agents.orchestration.magentic import (
1313
MagenticContext, StandardMagenticManager)
1414
from semantic_kernel.agents.orchestration.prompts._magentic_prompts import \
15-
ORCHESTRATOR_TASK_LEDGER_PLAN_PROMPT
15+
ORCHESTRATOR_TASK_LEDGER_FACTS_PROMPT
1616
from semantic_kernel.contents import ChatMessageContent
1717
from v3.config.settings import (connection_config, current_user_id,
1818
orchestration_config)
@@ -37,14 +37,12 @@ def __init__(self, *args, **kwargs):
3737
# object.__setattr__(self, 'current_user_id', None)
3838

3939
custom_addition = """
40-
Before creating the final plan, please ask each agent - team member to list all relevant tools (including MCP tools, plug-ins, etc.) they have access to. For each tool, list its required parameters.
41-
Obtain every required parameter that is not specified in the users request. These questions should be sent to the proxy agent. Do not ask for information that is outside of this list of required parameters.
42-
43-
Once this information is obtained, replan to create a final bullet-point plan to address the original request using the data and clarifications obtained.
44-
Each step in the plan should start with a specific agent which is responsible for executing it.
40+
As part of the plan, ask the team members regarding what relevant tools they have access to, and what information those tools require. Please query the user through
41+
the ProxyAgent if you need any additional information to supply required data to use these tools. Always clarify with the user if you are unsure about any aspect of
42+
the request or the information you need to complete it.
4543
"""
4644

47-
kwargs['task_ledger_plan_prompt'] = ORCHESTRATOR_TASK_LEDGER_PLAN_PROMPT + custom_addition
45+
kwargs['task_ledger_facts_prompt'] = ORCHESTRATOR_TASK_LEDGER_FACTS_PROMPT + custom_addition
4846

4947
super().__init__(*args, **kwargs)
5048

@@ -66,6 +64,7 @@ async def plan(self, magentic_context: MagenticContext) -> Any:
6664
# First, let the parent create the actual plan
6765
print(" Creating execution plan...")
6866
plan = await super().plan(magentic_context)
67+
print(f" Plan created: {plan}")
6968
self.magentic_plan = self.plan_to_obj( magentic_context, self.task_ledger)
7069

7170
self.magentic_plan.user_id = current_user_id.get()
@@ -110,6 +109,11 @@ async def plan(self, magentic_context: MagenticContext) -> Any:
110109
# content="Plan execution was cancelled by the user."
111110
# )
112111

112+
async def replan(self,magentic_context: MagenticContext) -> Any:
113+
print(f"\nHuman-in-the-Loop Magentic Manager replanned:")
114+
replan = await super().replan(magentic_context=magentic_context)
115+
print(replan)
116+
return replan
113117

114118
async def _wait_for_user_approval(self, m_plan_id: Optional[str] = None) -> Optional[messages.PlanApprovalResponse]: # plan_id will not be optional in future
115119
"""Wait for user approval response."""

0 commit comments

Comments
 (0)