Improved planning via introduction of sub steps in MagUI plans#267
Improved planning via introduction of sub steps in MagUI plans#267raghav-2002-os wants to merge 5 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces enhanced planning functionality to the MagUI orchestrator by adding support for hierarchical sub-steps within plan steps. The enhancement allows complex steps to be broken down into smaller, more granular sub-steps that can be executed by agents more effectively.
Key changes:
- Added new enhanced planning prompt that generates hierarchical plans with sub-steps
- Implemented validation and formatting logic for the new enhanced plan structure
- Modified orchestrator to conditionally use enhanced planning when enabled
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/magentic_ui/teams/orchestrator/_prompts.py |
Adds enhanced planning prompt template and validation function for hierarchical plans |
src/magentic_ui/teams/orchestrator/_orchestrator.py |
Integrates enhanced planning into orchestrator workflow with format conversion logic |
Comments suppressed due to low confidence (1)
src/magentic_ui/teams/orchestrator/_orchestrator.py:416
- [nitpick] The function name 'change_format' is vague. Consider a more descriptive name like 'convert_enhanced_plan_to_standard_format' or 'flatten_enhanced_plan'
async def change_format(self,response):
| content=self._get_task_ledger_plan_prompt( | ||
| self._team_description | ||
| ), | ||
| content=self._get_task_ledger_plan_prompt_enhanced(self._team_description,user_query), |
There was a problem hiding this comment.
Missing space after comma in function call. Should be: self._get_task_ledger_plan_prompt_enhanced(self._team_description, user_query)
| content=self._get_task_ledger_plan_prompt_enhanced(self._team_description,user_query), | |
| content=self._get_task_ledger_plan_prompt_enhanced(self._team_description, user_query), |
|
Hello do you mind running "poe check" on your code to make sure it does formatting and pyright checks? Thank you! |
|
Hi Hussein, |
@raghav-2002-os Do you mind replying to this please? A few questions:
|
55ba63b to
977cba1
Compare
3c1c0bc to
d8b80a4
Compare
|
@microsoft-github-policy-service agree company="Microsoft" |
|
Regarding the questions:
|
The pull request contains code for the implementation of enhanced planning, i.e. generating sub steps for each step in Magentic UI plans. As steps generated in MagUI plan can be at times complex to be performed by the agent to which it is assigned, we can break down each of the steps into smaller sub steps. This provides a more granular plan for the agents to complete the task at hand and improves the overall pipeline
Below is the format of the generated plan dictionary with sub steps for each step:
{{
"terms": ["term1", "term2", ...],
"task": "summary of the goal and objective",
"needs_plan": true,
"response": "Short natural language summary of the plan",
"plan_summary": "Concise overview of the plan",
"steps": {{
"Step 1": {{
"title": "Title of the step",
"details": "Purpose and scope of this step",
"agent_name": "Agent responsible for this step",
"substeps": {{
"1.1": {{
"title": "Title of the sub-step",
"details": "What this sub-step does",
"status": "Current state in plan, recap prev steps and highlights next steps"
}},
"1.2": {{
...
}}
}}
}},
"Step 2": {{
...
}}
}}
}}