When working with AWS Bedrock Multi-Agent configurations, you might encounter an error message similar to this:
An error occurred (dependencyFailedException) when calling the InvokeAgent operation: Dependency resource: received model timeout/error exception from Bedrock. Try the request again.
This occurred when invoking the agent with the following call:
response = bedrock_agent_runtime.invoke_agent(
agentId=agent_id,
agentAliasId=agent_alias_id,
sessionId=session_id,
inputText=agent_input,
)
To investigate this issue, I added enableTrace=True to the previous call. This provided deeper insights into the problem:
{
"agentAliasId": "BJIGGB72UG",
"agentId": "DMMRLXVFLT",
"agentVersion": "5",
"callerChain": [
{
"agentAliasArn": "arn:aws:bedrock:us-east-1:479047237979:agent-alias/DMMRLXVFLT/BJIGGB72UG"
}
],
"sessionId": "89ec67ae-132a-4ecd-9182-ffef774cea68",
"trace": {
"failureTrace": {
"failureReason": "Dependency resource: received model timeout/error exception from Bedrock. Try the request again.",
"traceId": "4d5612ec-5f45-4797-94bb-c6f2b6276de6-0"
}
}
}
While this trace didn’t explicitly identify the root cause, it became clear that the issue related to model performance and the specific Bedrock foundational model used in a collaborator agent within the multi-agent setup.
According to the AWS documentation, the dependencyFailedException means:
"There was an issue with a dependency. Check the resource configurations and retry the request."
This definition is somewhat unclear and generic, and in this specific scenario, it wasn't actually a configuration issue but rather a performance limitation in the selected foundational model.
Solution
Switching from Amazon Nova Pro to Claude Sonnet 3.7 resolved the issue entirely. The request started working smoothly after this change.
Steps to Fix:
Enable tracing in your agent invocation to gather detailed error context:
response = bedrock_agent_runtime.invoke_agent(
agentId=agent_id,
agentAliasId=agent_alias_id,
sessionId=session_id,
inputText=agent_input,
enableTrace=True
)
Analyze the trace logs provided by the Bedrock runtime.
Change the underlying foundation model used by the collaborator agent (e.g., switch from Amazon Nova Pro to Claude Sonnet 3.7).
Conclusion
This experience highlights how model selection within a multi-agent configuration can significantly impact stability and performance. Importantly, even though the error indicates a dependencyFailedException, it doesn't necessarily mean a collaborator agent dependency is misconfigured. Instead, it often points to one of the models being unable to generate a timely response or another non-obvious issue.
Top comments (0)