Context
The projects that worked best with AI agents had been set up with files to provide context for the AI to apply when responding to prompts.
My team wasn't paying for the use of the underlying service, so we didn't need to concern ourselves with the cost / benefit analysis.
Now that I have a bit of independence and time to myself, I'm going to look into how those guiding references impact the cost of using AI agents.
Basically, I want to understand a bit more about how files like AGENTS.md work - are they somehow applied locally, or do they get fed into the interactions with the model?
Findings
I went to Google agents.md, but landed on a website that matches that as the domain name instead. Luckily enough that was specifically set up to document what the agents.md file is all about.
(Sidenote: I no longer rely on Google for searching the Internet, as they are so dysfunctional that they cannot index this Blog, even though Google owns the Blogger platform).
Digging around a little further, I came across the following that does a great job of summarising what I suspected would be some pros and cons of specifying context in the AGENTS.md file:
https://www.aihero.dev/a-complete-guide-to-agents-md
The basic gist is:
- The full content of the file is pulled in every time that the AI agent comes to respond to a prompt, so if the file grows then tokens get consumed.
- By establishing separate reference documents for the agent to link through to for specific purposes we can narrow down the scope of what is relevant, and reduce token consumption.
- In larger code repositories, you can specify an appropriate hierarchy of AGENTS.md files, so the agent can pick up the context that is most relevant to the current location.
Summary
As of March 2026, interactions with AI models involve tokens as the unit of consumption.
When we provide additional context for agents to respond to our prompts we need to be budget conscious about the token cost that is involved.
By carefully structuring AGENTS.md and supporting documentation we can gain the benefits of agents having sufficient context, without the costs of queries applying too much token cost from superfluous context.
No comments:
Post a Comment