Skip to content

Commit f500386

Browse files
committed
Add agent feature flags and AgentsService skeleton
Introduces 'use_rag', 'use_mcp', and 'coding_tools' flags to agent definitions in the default team JSON, TeamAgent model, and TeamService. Adds a new AgentsService skeleton for converting team configurations to agent descriptors, and updates service exports to include AgentsService.
1 parent a34b3ad commit f500386

File tree

5 files changed

+149
-5
lines changed

5 files changed

+149
-5
lines changed

data/agent_teams/default_team.json

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"system_message": "You are an AI Agent. You have knowledge about HR (e.g., human resources), policies, procedures, and onboarding guidelines.",
1515
"description": "Handles employee onboarding, HR policies, and human resources management tasks.",
1616
"icon": "Person",
17-
"index_name": ""
17+
"index_name": "",
18+
"use_rag": false,
19+
"use_mcp": false,
20+
"coding_tools": false
1821
},
1922
{
2023
"input_key": "tech-support-001",
@@ -24,7 +27,10 @@
2427
"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.",
2528
"description": "Provides technical support for mobile plans, telecommunications, and IT services.",
2629
"icon": "Phone",
27-
"index_name": ""
30+
"index_name": "",
31+
"use_rag": false,
32+
"use_mcp": false,
33+
"coding_tools": false
2834
},
2935
{
3036
"input_key": "procurement-001",
@@ -34,7 +40,10 @@
3440
"system_message": "You are a Procurement agent. You specialize in purchasing, vendor management, supply chain operations, and inventory control. You help with creating purchase orders, managing vendors, tracking orders, and ensuring efficient procurement processes.",
3541
"description": "Manages purchasing decisions, add-ons, and procurement processes.",
3642
"icon": "ShoppingBag",
37-
"index_name": ""
43+
"index_name": "",
44+
"use_rag": false,
45+
"use_mcp": false,
46+
"coding_tools": false
3847
},
3948
{
4049
"input_key": "marketing-001",
@@ -44,7 +53,10 @@
4453
"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.",
4554
"description": "Creates marketing content, press releases, and promotional materials.",
4655
"icon": "DocumentEdit",
47-
"index_name": ""
56+
"index_name": "",
57+
"use_rag": false,
58+
"use_mcp": false,
59+
"coding_tools": false
4860
},
4961
{
5062
"input_key": "generic-001",
@@ -54,7 +66,10 @@
5466
"system_message": "You are a Generic agent that can help with general questions and provide basic information. You can search for information and perform simple calculations.",
5567
"description": "Provides general assistance and handles miscellaneous tasks that don't require specialized expertise.",
5668
"icon": "Bot",
57-
"index_name": ""
69+
"index_name": "",
70+
"use_rag": false,
71+
"use_mcp": false,
72+
"coding_tools": false
5873
}
5974
],
6075
"description": "Business Operations team handles employee onboarding, telecommunications support, procurement, and marketing tasks for comprehensive business operations management.",

src/backend/common/models/messages_kernel.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ class TeamAgent(KernelBaseModel):
160160
description: str = ""
161161
icon: str
162162
index_name: str = ""
163+
use_rag: bool = False
164+
use_mcp: bool = False
165+
coding_tools: bool = False
163166

164167

165168
class StartingTask(KernelBaseModel):

src/backend/v3/common/services/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
from .base_api_service import BaseAPIService
1010
from .mcp_service import MCPService
1111
from .foundry_service import FoundryService
12+
from .agents_service import AgentsService
1213

1314
__all__ = [
1415
"BaseAPIService",
1516
"MCPService",
1617
"FoundryService",
18+
"AgentsService",
1719
]
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
"""
2+
AgentsService (skeleton)
3+
4+
Lightweight service that receives a TeamService instance and exposes helper
5+
methods to convert a TeamConfiguration into a list/array of agent descriptors.
6+
7+
This is intentionally a simple skeleton — the user will later provide the
8+
implementation that wires these descriptors into Semantic Kernel / Foundry
9+
agent instances.
10+
"""
11+
12+
from typing import Any, Dict, List, Union
13+
import logging
14+
15+
from v3.common.services.team_service import TeamService
16+
from common.models.messages_kernel import TeamConfiguration, TeamAgent
17+
18+
19+
class AgentsService:
20+
"""Service for building agent descriptors from a team configuration.
21+
22+
Responsibilities (skeleton):
23+
- Receive a TeamService instance on construction (can be used for validation
24+
or lookups when needed).
25+
- Expose a method that accepts a TeamConfiguration (or raw dict) and
26+
returns a list of agent descriptors. Descriptors are plain dicts that
27+
contain the fields required to later instantiate runtime agents.
28+
29+
The concrete instantiation logic (semantic kernel / foundry) is intentionally
30+
left out and should be implemented by the user later (see
31+
`instantiate_agents` placeholder).
32+
"""
33+
34+
def __init__(self, team_service: TeamService):
35+
self.team_service = team_service
36+
self.logger = logging.getLogger(__name__)
37+
38+
async def get_agents_from_team_config(
39+
self, team_config: Union[TeamConfiguration, Dict[str, Any]]
40+
) -> List[Dict[str, Any]]:
41+
"""Return a list of lightweight agent descriptors derived from a
42+
TeamConfiguration or a raw dict.
43+
44+
Each descriptor contains the basic fields from the team config and a
45+
placeholder where a future runtime/agent object can be attached.
46+
47+
Args:
48+
team_config: TeamConfiguration model instance or a raw dict
49+
50+
Returns:
51+
List[dict] -- each dict contains keys like:
52+
- input_key, type, name, system_message, description, icon,
53+
index_name, agent_obj (placeholder)
54+
"""
55+
if not team_config:
56+
return []
57+
58+
# Accept either the pydantic TeamConfiguration or a raw dictionary
59+
if hasattr(team_config, "agents"):
60+
agents_raw = team_config.agents or []
61+
elif isinstance(team_config, dict):
62+
agents_raw = team_config.get("agents", [])
63+
else:
64+
# Unknown type; try to coerce to a list
65+
try:
66+
agents_raw = list(team_config)
67+
except Exception:
68+
agents_raw = []
69+
70+
descriptors: List[Dict[str, Any]] = []
71+
for a in agents_raw:
72+
if isinstance(a, TeamAgent):
73+
desc = {
74+
"input_key": a.input_key,
75+
"type": a.type,
76+
"name": a.name,
77+
"system_message": getattr(a, "system_message", ""),
78+
"description": getattr(a, "description", ""),
79+
"icon": getattr(a, "icon", ""),
80+
"index_name": getattr(a, "index_name", ""),
81+
"use_rag": getattr(a, "use_rag", False),
82+
"use_mcp": getattr(a, "use_mcp", False),
83+
"coding_tools": getattr(a, "coding_tools", False),
84+
# Placeholder for later wiring to a runtime/agent instance
85+
"agent_obj": None,
86+
}
87+
elif isinstance(a, dict):
88+
desc = {
89+
"input_key": a.get("input_key"),
90+
"type": a.get("type"),
91+
"name": a.get("name"),
92+
"system_message": a.get("system_message") or a.get("instructions"),
93+
"description": a.get("description"),
94+
"icon": a.get("icon"),
95+
"index_name": a.get("index_name"),
96+
"use_rag": a.get("use_rag", False),
97+
"use_mcp": a.get("use_mcp", False),
98+
"coding_tools": a.get("coding_tools", False),
99+
"agent_obj": None,
100+
}
101+
else:
102+
# Fallback: keep raw object for later introspection
103+
desc = {"raw": a, "agent_obj": None}
104+
105+
descriptors.append(desc)
106+
107+
return descriptors
108+
109+
async def instantiate_agents(self, agent_descriptors: List[Dict[str, Any]]):
110+
"""Placeholder for instantiating runtime agent objects from descriptors.
111+
112+
The real implementation should create Semantic Kernel / Foundry agents
113+
and attach them to each descriptor under the key `agent_obj` or return a
114+
list of instantiated agents.
115+
116+
Raises:
117+
NotImplementedError -- this is only a skeleton.
118+
"""
119+
raise NotImplementedError(
120+
"Agent instantiation is not implemented in the skeleton"
121+
)

src/backend/v3/common/services/team_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ def _validate_and_parse_agent(self, agent_data: Dict[str, Any]) -> TeamAgent:
145145
description=agent_data.get("description", ""),
146146
icon=agent_data["icon"],
147147
index_name=agent_data.get("index_name", ""),
148+
use_rag=agent_data.get("use_rag", False),
149+
use_mcp=agent_data.get("use_mcp", False),
150+
coding_tools=agent_data.get("coding_tools", False),
148151
)
149152

150153
def _validate_and_parse_task(self, task_data: Dict[str, Any]) -> StartingTask:

0 commit comments

Comments
 (0)