Rebuild the prompt fresh each turn, don't append the transcript

Flat prompt size across hundreds of decisions instead of linear growth Advanced 2 min read

In a long agent loop, appending every observation and action to a running transcript makes each turn cost more than the last. Instead, assemble a fresh, fixed-size user message per decision by typed retrieval from an external store, so prompt size stays constant no matter how long the run gets.

๐Ÿ”’ Pro tip ยท Advanced

Unlock this tip โ€” and 105 more

This is one of 106 advanced, fact-checked tactics reserved for Pro. Get the full 128-tip library, a searchable archive, and a new tip every morning. Free for 7 days, then $9/mo.

Prefer to browse? The 22 Beginner tips are free forever.