WEB-259Recommended
Layer agent content with a budget per layer
Arrange agent content in layers, each with a token budget, and link each layer to the next as Markdown.
How to do it
Set the budgets once, for example 2,000 tokens for the discovery file and 15,000 for each navigation file. Allow 5,000 for each unit page, such as one rule or one product, and 2,000 for each answer from search. Label bulk JSON as being for tools, not for reading. Then an agent reads the discovery file, picks a branch, and reads only the page it needs. State each file's size as State the size of every agent file in tokens says.
Examples
JSON example
{
"discovery": { "files": ["/llms.txt"], "maxTokens": 2000 },
"navigation": { "files": ["/guide/*/index.md"], "maxTokens": 15000 },
"unit": { "files": ["/guide/*/*.md"], "maxTokens": 5000 },
"answer": { "files": ["/ask"], "maxTokens": 2000 }
}
How to check
The build counts every agent file's tokens and fails when one passes its layer's budget.
Related rules
- WEB-258 State the size of every agent file in tokens in Website
- WEB-263 Split large agent content into named parts behind an index in Website
- WEB-251 Publish a topic index for agents in Website
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/ready-for-ai-agents/layer-budgets">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.