← Research library

Context windows are a budget: managing what your agents remember

AI-assisted research. This note was prepared with the assistance of AI tools. It may contain errors and is not professional advice. See our Legal Disclosures.

Modern models accept large inputs, and marketing agents are often handed everything at once. The full brand book, every past campaign, the whole product catalog, and a long history all go into one call, because more context feels safer. In our research, it often makes agents worse.

Important instructions get buried, irrelevant details distract, costs rise with every call, and responses slow down. We treat context as a budget: limited, valuable, and worth allocating on purpose.

This post covers where the budget goes, how overspending shows up, and a simple audit for finding what to cut.

Where context goes

A typical marketing agent spends its context on five things. Naming them makes it easier to see which one is growing:

  1. Instructions: the role, goal, rules, and output format.
  2. Reference knowledge: brand voice, product facts, and approved claims.
  3. Task input: the brief, the data, or the draft to review.
  4. Working history: previous steps in this task.
  5. Tool results: search results, records, and query outputs.

Problems usually start when one of these crowds out the others. A long history pushes the original instructions far back in the input. A huge tool result swamps the brief. A reference document added "just in case" sits in every call and competes with the material the task needs.

The five categories also grow at different rates. Instructions and reference knowledge are mostly fixed per agent. Working history and tool results grow within a task, sometimes quickly, which is why long tasks degrade first.

Why more context can hurt

A larger window raises the ceiling on what an agent can accept. It does not guarantee that the agent weighs every part of the input equally. Material that is relevant, recent, and clearly marked tends to get attention. Material that is buried, repetitive, or ambiguous tends to get less.

Cost and speed scale with input too. Every token in the context is processed on every call, so a reference document that adds nothing still adds to the bill and the wait. For an agent that runs thousands of times a month, an unused section is a recurring expense. Our post on cost per task covers how to track this.

There is also a quality risk unique to marketing. When old campaigns sit in context, agents may reuse their claims, offers, or dates. An expired promotion quoted in a new email is a context problem before it is a copy problem.

Principles for spending the budget

Five principles cover most of what we recommend. Each one moves material out of the always-loaded context or makes what remains easier to use.

Put the most important things where they will be noticed. Core rules and the current goal should be short, clear, and prominent. They should not sit after pages of reference material.

Retrieve instead of preloading. Give the agent a way to look up the specific products it needs instead of including the whole catalog. We cover this in retrieval for marketing agents.

Summarize history. For long tasks, replace old steps with short summaries of what was decided and why. The details rarely matter later; the decisions do. For work that spans weeks, see memory patterns for long-running campaign agents.

Trim tool results. If a CRM lookup returns 50 fields and the agent needs five, filter before passing the result along. This is often best done in the tool itself, as described in tool design for agents.

Separate reference from instruction. Mark clearly which text is a rule and which is material the agent may draw on. Ambiguity here causes agents to treat example copy as instructions, or instructions as optional.

Signs your context is overspent

Overspending rarely announces itself. It shows up as quality problems that look like model weakness. Watch for these patterns:

  • Forgotten rules: the agent follows recent instructions but drops earlier ones.
  • Length decay: quality falls as tasks run longer.
  • Irrelevant quotes: the agent cites reference material that has nothing to do with the task.
  • Flat returns: cost per task rises while quality stays the same.

Any one of these is worth investigating. Two or more together usually point to context as the cause, before you consider a different model.

A simple audit

The audit takes an afternoon and needs only logs of what the agent received. Start by recording the full context for ten typical tasks, then work through it section by section:

  1. Label each section of the context with one of the five categories.
  2. Estimate the share of the input each category takes.
  3. For each section, ask whether removing it would change the output.
  4. Remove or move behind retrieval any section that never matters.
  5. Rerun the ten tasks and compare quality, cost, and response time.

Step three is the judgment call. You can answer it by reading outputs, or more reliably by running the task with and without the section on a small test set. Sections that change nothing are candidates for removal; sections that matter only sometimes are candidates for retrieval.

Consider a hypothetical lifecycle agent whose context includes a 30-page brand book on every call. The audit shows that only the voice rules and the banned-phrase list ever influence its drafts. Moving the rest behind a lookup leaves a short block of rules up front, and the full book stays available when a task needs it.

What to measure over time

One audit fixes today's context. Keeping it healthy needs a few numbers tracked alongside quality. We recommend recording, per agent, the average input size, the share taken by each category, cost per task, and the quality score from your test set.

The relationship between these numbers is the signal. If input size grows while quality stays flat, something is accumulating. If quality drops right after a section was added, that section is crowding out something else. Run histories that store the full input make this traceable; see observability for marketing agents.

The question we are studying next is how to budget context across agents that share it. When a planner passes material to several executors, each executor inherits choices it did not make. We expect handoff contracts to need explicit context budgets, not just lists of fields.

How to apply this: audit one agent's context this week. Move bulky reference material behind lookups, summarize long histories, and keep the core rules short and prominent, then compare quality and cost before and after.

Related research

Put this research to work

Marketix turns these patterns into software: agents, automated workflows, and a hub that keeps people in control. Sign up for early access.