Figure 3

What the optimizer changes

The parts of a harness by kind: the instructions, tool descriptions and skill instructions are text, written by the rewriter; the model, reasoning effort, prompt caching, built-in tools and the context manager are set by a Bayesian optimizer; memory and code are not changed. A table shows the configuration after each of ten search steps, two rounds of five, in a search that chooses between two context-manager strategies. Round 1 picks the summarize strategy and alternates rewriting the instructions, from v1 to v3, with setting the context use at which it summarizes, from its starting value 70% to 60%, then 65%. Round 2 switches to the truncate strategy, which truncates tool results over 2,500 tokens to start, keeps instructions v3, and alternates rewriting them, to v4 and then v5, with setting the token limit, to 1,500 and then 2,000Parts of the harnessYour agentand its harnessTextwritten by the rewriterSettingsset by a Bayesian optimizerAaInstructionsor system promptAaTool descriptionsone per toolAaSkill instructionseach SKILL.md◇Modelone of a list◇Reasoning effortauto · low · … · high◇Prompt cachingauto · on · off◇Built-in toolseach on · offv1v2v2v3v3v4v4v5v5▣Context managerSummarize#at context useSummarize#at context useTruncate#tool results overTruncate#tool results overSummarizeTruncate70%60%60%65%65%2,5001,5001,5002,000Memoryfresh copy per trialCodenot changedConfiguration after each search stepContext managerIts settingInstructionsRound 1at context useRound 2tool results over⋮step 1Summarize70%v1step 2Summarize70%v2step 3Summarize60%v2step 4Summarize60%v3step 5Summarize65%v3step 6Truncate2,500v3step 7Truncate2,500v4step 8Truncate1,500v4step 9Truncate1,500v5step 10Truncate2,000v5Changed in this stepStarting value of a new optionCarried over
The left side of the figure shows the parts of a Strands harness that the optimizer can change. The rewriter changes the text, shown in purple, and a Bayesian optimizer chooses the settings, shown in blue. The optimizer doesn't change the agent's memory or code. The right side shows how the configuration changes over the first two rounds of an example search that rewrites the instructions and chooses between two context-manager strategies, each with one setting. Each round has five steps. The first step picks a strategy, and the next four alternate between rewriting the instructions and tuning that strategy's setting. Each step starts from the best configuration found so far and changes one part of it. The left side shows the configuration in the outlined row.