Can subagents in deepagents output structured response?

I have a bunch of subagents and I am looking to output structured responses from the subagents but I am not sure if the framework supports it in deepagents package.

My use-case is to validate subagents responses.

Thank you for your help!

Hey there! Yes, you could modify your subagents to use structured output if you create the subagent separately using create_agent that has a response format, then add it to your deep agent via CompiledSubagent! You could also achieve this via middleware if you prefer.

Very cool! Thanks for sharing!
I need to look into how the main agent consumes that but doesn’t seem too complex.

I have the problem that my subagents pass the structured output to the main (deep) agent but the main agent often paraphrases, summarizes, or re-formats this output before presenting it to the user.
Is there a strategy to stop the main agent from processing the structured output?

hi @SeccoMaracuja

could you please create a new post for that as this one is already Solved?

Of course: Preventing sub agents structured output post processing in a deep agent

1 Like