An agent does not consult a hidden second brain between turns.
On each reason step, it only "knows" what you place in the context window for that call: system rules, tools, user goal, prior messages, and tool results you chose to keep.
That makes context the real control surface of agent behavior.
Change the window, and you change the next decision - even with the same model weights.
Every agent decision is a function of the current context package; tool results and history only matter if they are present, legible, and not drowned in noise.
Insight: Most "random" agent behavior is explainable as missing constraints, truncated observations, contradictory instructions, or context bloat that pushed the goal out of view.
When to Use This Model: Designing prompts, trimming tool outputs, debugging wrong tool choice, or budgeting tokens across multi-turn runs.
Limitations/Trade-offs: Perfect context management cannot fix broken tools or impossible goals. Over-summarization can drop the one fact that mattered.
Think of the model call as a closed-book exam where you write the open notes page yourself every turn.
If the notes omit the order id, the model cannot look it up from "memory" outside those notes.
If the notes include two conflicting policies, the model will sometimes pick the wrong one.
In the agent loop, perceive is exactly this notes assembly.
Reason is the exam answer (tool call or final text).
Observe edits the notes for next time.
Retrieval is just more context.
Bad retrieval is worse than none because it steers the agent with confident irrelevance.
Gate retrieval with task type and score thresholds.
See memory/RAG sections later in this guide for storage mechanics; here the rule is: retrieved text still has to earn its seat in the window.
If you stop at max turns, the final context is the whole story of failure or success.
Saving that package (redacted) is the best debugging artifact you have.
Handoffs fail when agent A passes prose without the structured facts agent B needs.
Pass state objects (ids, constraints, open questions), not only chat transcripts.
Some providers cache stable system+tool prefixes.
That encourages keeping policy stable and putting volatile trajectory at the end.
Verify cache behavior at build for your provider.
Instead of 40 tools always present, expose tool groups by phase (read tools first, write tools after plan approval).
That is context design, not only safety design.
"The agent remembers everything from earlier in the company." It only remembers what you store and re-feed as context or retrieve deliberately.
"Larger context windows fix agent quality." They raise the ceiling but also let you accumulate more noise if you are undisciplined.
"If it fit in the window, the model used it." Fitting is necessary, not sufficient; placement, structure, and competition matter.
"System prompts are set-and-forget." They compete with later long tool dumps; pin restatements when runs are long.
"More retrieved docs mean better grounding." Irrelevant docs are adversarial context.
"Hiding tool results from the model protects safety." If the model must decide next steps, it needs accurate observations; hide secrets from logs/UI separately.