Everything the Model Sees (Context Engineering)

Context engineering as an experience map for software engineers — everything the model sees, the idea of minimal effective context, and why reliability often starts with what you put in the window.

iMORPHr · · 5 min read
Everything the Model Sees (Context Engineering)

Part 2 of 4 · ← Previous: agents & skills · Next: RAG →

In the first post I shared what “agent” meant after I stopped guessing: an LLM with tools and guidance in a loop, plus skills when the task playbook keeps changing.

That clarity did not make agents reliable by itself. Prompt tweaks were not enough either. The craft that kept showing up — in study and in practice — was context engineering: designing everything the model sees before it answers.


Prompt engineering vs context engineering

Prompt engineering is mostly about one string (or a few): the instruction, the wording, the examples.

Context engineering is designing dynamic systems that give an LLM the right information and capabilities, in the right format, at the right time. It is about the whole window — not a cleverer paragraph.

That shift mattered for me as a software engineer. It reframed agent work as systems design: what enters the request, what stays out, what is retrieved on demand, and what the harness is responsible for.


What “context” includes

Before the model answers, context can include:

  • System instructions, rules, examples
  • Skills — packaged task guidance the agent can follow for this kind of work
  • The user message
  • Short-term memory (conversation history / turn state)
  • Long-term memory (preferences, prior work, durable facts surfaced when needed)
  • Retrieved knowledge (docs, records, search — RAG)
  • Available tools / capabilities
  • Structured output schemas

Tools are part of that picture. They are not the whole picture. Skills, history, retrieved knowledge, instructions, and output contracts shape behavior as much as which functions exist.


The harness vs the model

It helps to separate two layers:

  • The model predicts the next useful response or tool call given what it sees.
  • The agent harness wraps the model: runs tools, manages history, applies guardrails, and decides what lands in context for this step.

A lot of “agent engineering” is harness judgment. Demo agents that feel magical often assemble context well — calendar, past messages, contacts, the right tools for this turn — more than they invent a unique model.

The line that stuck from the writing I studied: many agent failures are context failures, not model failures.


Language for when context goes wrong

Three labels were enough to make messy demos discussable:

Term What it feels like
Context rot Quality drops as the window fills — often well before the advertised limit
Context pollution Irrelevant, redundant, or conflicting information distracts the model
Context confusion Instructions blur into data; rules conflict; similar capabilities fight each other

Related ideas you will hear: offloading, reduction, retrieval, isolation. As experience, they all point the same way — do not treat the context window as a junk drawer.


Minimal effective context

The goal is not “stuff more into the window.” The goal is the minimal effective context for the next step.

That sounds obvious. It is hard in practice. Agents accumulate history. Tool results are verbose. Retrieved snippets pile up. Instructions grow. Suddenly the model is negotiating noise.

Industry write-ups go deep on tactics — stable prefixes, reversible memory, small action spaces, how sub-agents should communicate instead of dumping full shared history. I took the principle, not a playbook: prefer less, better-timed context; retrieve when needed; keep failures visible enough to learn from; avoid turning every capability into permanent clutter.

I am still figuring out how to manage context well while shipping. When you create an agent, that is the hard part. Model choice matters; context judgment matters more day to day.


How I’d approach learning this

For another software engineer on this path:

  1. Learn the map of what can enter context before optimizing prompts alone.
  2. When something fails, ask “what did the model see?” before “which model should we switch to?”
  3. Read practitioner blogs for mental models — then stop before turning them into a checklist on day one.
  4. Expect this to stay unfinished; context craft improves with real tasks and observation.

Useful reading that shaped this map (principles, not a tutorial syllabus):

  1. The New Skill in AI is Not Prompting, It’s Context Engineering — Philipp Schmid
  2. Context Engineering for AI Agents: Part 2 — Philipp Schmid
  3. Context Engineering for AI Agents: Lessons from Building Manus — Yichao ‘Peak’ Ji

What’s next

One of the biggest context levers is knowledge that is not already in the weights or the chat: retrieval from your own datastore — and, when the question is about meaning, finding the right pieces semantically.

  • Post 3: RAG — your datastore into context, then meaning search.
  • Post 4: MCP — portable capabilities across agent harnesses.

Series

  1. What “Agent” Meant After I Stopped Guessing
  2. Everything the Model Sees (Context Engineering) (this post)
  3. Grounding Agents in Your Own Data (RAG)
  4. Same System, Different Agent Harnesses (MCP)

Earlier series — LLM trilogy

  1. A Practical LLM Map for Full-Stack Engineers
  2. LLM Vocabulary for Engineers: Embeddings, Evals, Quantization, and LoRA
  3. Tools Make the LLM Useful: Lessons from an ERPNext Chatbot Experiment