Spaces:
Sleeping
Sleeping
Commit ·
d5d5b46
1
Parent(s): 3eba5ca
feat: agents build on each other's responses in sequential chain
Browse filesCrewAI sequential process already passes earlier outputs to later tasks.
Updated task descriptions so agents explicitly reference, agree/disagree,
and build on teammates' input. CAD agent reviews full team discussion
before deciding whether to generate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- agents/crew_orchestrator.py +12 -5
- agents/prompts.py +3 -0
agents/crew_orchestrator.py
CHANGED
|
@@ -169,7 +169,12 @@ class CrewOrchestrator(BaseOrchestrator):
|
|
| 169 |
f"As the {agent_def.role}, respond to the user's latest message. "
|
| 170 |
f"Keep your response concise (2-4 sentences). "
|
| 171 |
f"Do NOT repeat anything from the conversation history. "
|
| 172 |
-
f"Add NEW information from your expertise."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
)
|
| 174 |
if agent_id != "cad":
|
| 175 |
task_description += (
|
|
@@ -182,9 +187,10 @@ class CrewOrchestrator(BaseOrchestrator):
|
|
| 182 |
)
|
| 183 |
else:
|
| 184 |
task_description += (
|
| 185 |
-
"\n\
|
| 186 |
-
"
|
| 187 |
-
"
|
|
|
|
| 188 |
"If NOT enough info, start your response with 'NOT READY:' "
|
| 189 |
"followed by a short list of what is still needed. "
|
| 190 |
"If enough info IS available, generate CadQuery Python code. "
|
|
@@ -196,7 +202,8 @@ class CrewOrchestrator(BaseOrchestrator):
|
|
| 196 |
expected_output=(
|
| 197 |
"A concise response from your expert perspective (2-4 sentences)."
|
| 198 |
if agent_id != "cad"
|
| 199 |
-
else "Valid CadQuery Python code that assigns result to a cq.Workplane
|
|
|
|
| 200 |
),
|
| 201 |
agent=crew_agent,
|
| 202 |
)
|
|
|
|
| 169 |
f"As the {agent_def.role}, respond to the user's latest message. "
|
| 170 |
f"Keep your response concise (2-4 sentences). "
|
| 171 |
f"Do NOT repeat anything from the conversation history. "
|
| 172 |
+
f"Add NEW information from your expertise.\n\n"
|
| 173 |
+
f"You can see what previous agents on the team said in this turn. "
|
| 174 |
+
f"Build on their input — agree, disagree, refine, or add to their "
|
| 175 |
+
f"points. Reference their suggestions when relevant (e.g. 'Building "
|
| 176 |
+
f"on the designer\\'s L-bracket suggestion, I\\'d recommend...'). "
|
| 177 |
+
f"Do NOT repeat what they already covered."
|
| 178 |
)
|
| 179 |
if agent_id != "cad":
|
| 180 |
task_description += (
|
|
|
|
| 187 |
)
|
| 188 |
else:
|
| 189 |
task_description += (
|
| 190 |
+
"\n\nReview what the other agents have discussed in this turn. "
|
| 191 |
+
"Use their suggestions and specs to evaluate whether there is "
|
| 192 |
+
"enough information to generate a 3D model. You need at minimum: "
|
| 193 |
+
"a clear shape/type, key dimensions, and major features. "
|
| 194 |
"If NOT enough info, start your response with 'NOT READY:' "
|
| 195 |
"followed by a short list of what is still needed. "
|
| 196 |
"If enough info IS available, generate CadQuery Python code. "
|
|
|
|
| 202 |
expected_output=(
|
| 203 |
"A concise response from your expert perspective (2-4 sentences)."
|
| 204 |
if agent_id != "cad"
|
| 205 |
+
else "Valid CadQuery Python code that assigns result to a cq.Workplane, "
|
| 206 |
+
"OR a 'NOT READY:' message listing missing information."
|
| 207 |
),
|
| 208 |
agent=crew_agent,
|
| 209 |
)
|
agents/prompts.py
CHANGED
|
@@ -71,6 +71,9 @@ def build_orchestrator_system_prompt(
|
|
| 71 |
"- Use the conversation history for context (know what was decided), "
|
| 72 |
"but ONLY respond to the user's latest message. Do NOT repeat or "
|
| 73 |
"paraphrase anything already said ��� always advance the discussion.\n"
|
|
|
|
|
|
|
|
|
|
| 74 |
"- Each agent should add DIFFERENT information. If one agent covers "
|
| 75 |
"dimensions, another should cover materials or tooling, not restate dimensions.\n"
|
| 76 |
f"- Do NOT include the CAD Coder agent unless the user explicitly uses one of "
|
|
|
|
| 71 |
"- Use the conversation history for context (know what was decided), "
|
| 72 |
"but ONLY respond to the user's latest message. Do NOT repeat or "
|
| 73 |
"paraphrase anything already said ��� always advance the discussion.\n"
|
| 74 |
+
"- Agents should build on each other's input — agree, disagree, refine, "
|
| 75 |
+
"or add to what others said. Reference other agents' suggestions when "
|
| 76 |
+
"relevant (e.g. 'Based on the designer's L-bracket idea, I'd specify...').\n"
|
| 77 |
"- Each agent should add DIFFERENT information. If one agent covers "
|
| 78 |
"dimensions, another should cover materials or tooling, not restate dimensions.\n"
|
| 79 |
f"- Do NOT include the CAD Coder agent unless the user explicitly uses one of "
|