Your AI Agent Needs an Evidence Collector Before It Needs a Bigger Context Window
The easiest way to make an AI agent look smarter is to give it more context.
The harder way is to give it better evidence.
Most operators reach for the first fix because it feels obvious. The agent forgot what happened yesterday, so expand the context window. The agent missed a constraint, so paste more history. The agent repeated a failed approach, so feed it the whole transcript.
Raw history is not the same thing as useful state.
A long conversation can contain the answer, the false start, the corrected answer, three stale plans, a deployment log, a half-finished decision, and a sentence from the operator that changed the whole job. The model still has to infer which parts matter. When the task is code review, content publishing, client follow-up, or maintenance, that inference is where mistakes happen.
Before an AI agent needs a bigger context window, it needs an evidence collector.
Chat History Is Weak Evidence
Chat transcripts are convenient because they are already there.
They are also noisy.
A transcript captures conversation order, not operational truth. It records what people thought might be happening before they checked the repo, what an agent planned before tests failed, what a build said before a config fix, and what a human approved before the requirements changed.
That makes chat useful as background, but dangerous as the primary source of truth.
An agent asked to “continue from earlier” should not have to reconstruct the world from vibes. It should receive a short, fresh packet of evidence that says what actually changed, what failed, what remains open, and what acceptance condition matters now.
This is especially important for recurring jobs. Nightly coding, daily publishing, inbox, and operations agents all suffer from the same failure mode: each run starts with partial memory and too much surrounding context.
The answer is not to dump more into the prompt. The answer is to collect better inputs before the prompt exists.
What the Collector Should Gather
An evidence collector is a preflight job. It runs before the agent gets its next assignment and gathers the facts a competent operator would want on the desk before making the next move.
For a coding workflow, that packet should include changed files, branch name, open diffs, failing tests, build output, lint output, deployment state, linked issue or task, and any files touched since the last clean handoff.
For a content workflow, it should include the destination, recently published titles, draft status, target slug, indexing history, build result, canonical URL, and any distribution rule that constrains what the agent may do publicly.
For a customer or inbox workflow, it should include new messages, unresolved threads, reply deadlines, owner assignments, missing information, previous commitments, and the current state of each live conversation.
For an operations workflow, it should include service status, recent logs, disk pressure, failed cron jobs, config changes, deployment timestamps, and the last known healthy checkpoint.
A good evidence packet answers five questions:
- What changed?
- What broke?
- What is still undecided?
- What proof exists?
- What is the next bounded job?
That is the difference between continuity and context stuffing.
Compress Evidence Without Hiding Risk
Compression is where many agent systems get cute and lose the plot.
Summaries are useful only when they preserve risk. A summary that says “build had issues but was fixed” is weaker than a three-line receipt: build failed on missing environment variable, config fallback was added, second build passed at 08:14.
The goal is not to make the packet tiny at any cost. The goal is to remove noise while keeping the facts that would change the next decision.
Use plain sections.
Start with current objective. Then list changed artifacts. Then list verification results. Then list open decisions. Then list blockers. Then list the recommended next task.
Do not bury failures in prose. Put them where the next agent cannot miss them.
For example:
- Failed check:
npm run buildfailed before the content schema fix. - Current check:
npm run buildpassed after the frontmatter update. - Open risk: indexing script returned quota warning, so submit again tomorrow if not indexed.
- Next task: deploy the built site and request indexing for the canonical URL.
That is more useful than another thousand tokens of conversation about how the agent felt while debugging.
Give the Next Agent One Bounded Job
An evidence collector should not end with “continue.”
That word is too vague. Continue what? Review? Deploy? Debug? Write?
The handoff should name one bounded job with acceptance criteria. A strong handoff looks like this:
“Review the current diff for the new blog post, run the production build, deploy only if the build passes, then submit the canonical URL for indexing. Do not interact on X. Report title, URL, deploy result, indexing result, and a promo draft.”
That is a job. It has scope, constraints, verification, and reporting.
A weak handoff looks like this:
“Pick up where we left off.”
That is a memory test masquerading as work.
The more autonomous the agent, the more explicit the handoff needs to be. Autonomy does not remove the need for task boundaries. It raises the price of unclear ones.
Log the Result for Tomorrow
The evidence collector gets better when every run leaves receipts for the next one.
After the agent finishes, it should write down what changed, what passed, what failed, what it skipped, what it was not allowed to do, and what should happen next. This does not need to be a novel. In fact, it should not be.
The best receipt is short enough for a future collector to parse and specific enough for a future agent to trust.
For a publishing agent, that might be:
- Created post with title and slug
- Build passed
- Pages deploy succeeded
- Indexing request returned success
- No X interaction performed
- Promo draft prepared for the social lane
For a coding agent, it might be:
- Changed two files
- Added one test
- Unit tests passed
- Integration test still failing because staging token is missing
- Next move is to rerun integration after credential refresh
This is boring, which is why it compounds.
Bigger Context Still Has a Place
Long context windows are useful for source-heavy review, complex requirements, large documents, and multi-file reasoning. The mistake is treating them as an operating model.
An operator does not become effective by remembering every sentence from yesterday. An operator becomes effective by knowing where the truth lives, what changed, what proof exists, and which decision is next.
Agents need the same discipline.
If your agent keeps forgetting, repeating work, or confidently acting on stale assumptions, do not start by buying a bigger context window. Start by building an evidence collector.
Give the next run better facts.
Then ask the model to think.
More from the build log
Suggested
Want the full MarketMai stack?
Get the core MarketMai guides and operator playbooks in one premium bundle for $49.
View Bundle