Tool Schemas and System Prompts: Major Re-read Expense
Beyond conversational history, the constant re-sending of large system prompts and extensive tool schemas with every agent turn significantly contributes to context re-read costs; in one instance, tool schemas alone accounted for 11,000 tokens of a 14,000-token base.
The top 3
- System Prompts: The Dominant Fixed Re-read Cost: Lengthy system prompts, which are re-sent with every agent inference call, often represent a major fixed re-read expense, consuming a substantial portion of the context window and contributing disproportionately to overall token costs due to their constant repetition across turns. For instance, a 4,000-token system prompt over 20 turns can consume 80,000 tokens in repetition alone.
- Top 3 Strategies to Slash Agent Re-read Costs: Key techniques to reduce re-read expenses include optimizing system prompts for conciseness and dynamic loading, implementing prompt caching for repetitive instructions to achieve up to 90% cost reduction, and using retrieval-based context management to selectively inject relevant information.
- Most Costly Tool Schemas: Complexity's Toll: Overly complex tool schemas, particularly those with deep nesting or numerous functions, are major drivers of re-read inference costs, causing exponential expense growth.
Sources
Open the full topic