2 Answers
- Newest
- Most votes
- Most comments
2
Hi,
Are you using advanced prompts? Something like post-processing prompt can delay the response. When you check the trace, which step takes the most? If you enable orchestration template, that also has a hit in performance.
Here are more checks to consider for the performance: https://docs.aws.amazon.com/bedrock/latest/userguide/agents-optimize-performance.html The more template and more instructions, it can also slow it down. Analyzing the traces can help you understand at which step the agent takes the most so you can target that for optimization.
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated 2 months ago

Hi, In advanced prompts I am only using orchestration prompt where i am providing the sql database schemas and the response formatting instructions with examples. In the trace most of the time is taken by orchestration prompt itself. Even my database query lambda tool hardly takes 1-3 seconds for response.
Can you move the Orchestration example to the Agent instruction box and disable Orchestration template?
I am getting this error "Validation failed for quota max-instruction-size. The maximum number of resources is 4000, but account requested 7951 resources. Retry the request with fewer resources." I also noticed that without the orchestration prompt my agent group is not invoked and the database query lambda tool is not getting called. I am also providing the sql database schemas in orchestration prompt which i can't provide in instructions because of the 4000 character limit
Understood. First take a look at the description field for each action item. Ensure the schema description is used as well to make your agent aware what these API are and what used for. Sometimes the instructions in the instructions box are built up over-time. Try to re-sort and optimize the duplicate instructions. Finally, for text2sql prompt engineering, you are int he right track. Check this blog if the construct of the orchestration in this example helps optimizing it: https://github.com/build-on-aws/bedrock-agent-txt2sql
Let me know if these instructions helped with your agent performance.