Your Agent Is Wasting Tokens and You Don't Know It - Erik Hanchett, AWS

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

Five practical techniques to reduce token costs when building AI agents: (1) cache the system prompt so only the first call sends the full prompt, (2) route tasks by difficulty using cheaper models like Claude Haiku for simple tasks and frontier models for complex ones, (3) offload large tool results by storing them externally and using summarization instead of passing them in every loop, (4) cap tool loop iterations to prevent runaway calls and use observability tools to monitor usage, and (5) trim conversation history using a sliding window approach combined with summarization to avoid sending entire chat histories on every turn.

5m watch time
2 Impressions