context engineeringAI workflowworked examplevisual planning

Context Engineering: A Four-Source Worked Example

Choose current evidence from four fictional documents, preserve unresolved conflicts and build a source-selection log before drafting an answer.

CodePic Team9 min read

Quick answer

Context engineering is the work of selecting and organizing the information available to a model for a particular task. A better prompt can clarify the request, but it cannot make an obsolete document current or turn an unanswered question into a fact. For a source-based answer, the useful artifact is a traceable context pack.

How we verified this: Official documentation checked October 29, 2026. Source packs, expected answers and walkthroughs are original authored teaching examples. No live external agent run, generated presentation or Notebook artifact, tool ranking, accuracy benchmark or cost saving is claimed.

Context engineering is the work of selecting and organizing the information available to a model for a particular task. A better prompt can clarify the request, but it cannot make an obsolete document current or turn an unanswered question into a fact. For a source-based answer, the useful artifact is a traceable context pack.

This example builds that pack from four fictional documents about a community room. You will choose the relevant version, preserve an unresolved conflict and attach source identifiers to a draft answer. The exercise demonstrates an information-design method; it does not claim measured token savings or better model accuracy.

Context engineering versus prompt engineering

Anthropic's context engineering article distinguishes instruction design from managing the broader information available during a task. In practical work, you need both: a clear question and evidence that is relevant, current enough and understandable in its original scope.

For this exercise, the prompt is “Can we plan a twenty-person workshop in the room next month?” The context includes room notes, dates, approval status and the distinction between capacity and attendance. Changing “please answer clearly” to “answer as an expert” does not resolve which room document governs the decision.

Keep the scope manageable. You do not need a complex retrieval system to learn the basic discipline. A four-document manifest can expose version confusion, unsupported inference and missing ownership before those problems become hidden inside a larger knowledge system.

Start with one decision and four documents

The fictional workshop coordinator has four files. Each has a source ID, a date, an owner and a status. These metadata fields matter because two files discuss the same room using different assumptions.

IDDocumentDate and statusRelevant content
D1Room note v1September 1; supersededSuggested capacity: 24 seated visitors
D2Room note v2October 20; approved for planningCapacity: 16 seated visitors with a clear aisle
D3Volunteer messageOctober 21; informalSomeone remembers fitting 20 people at a previous event
D4Catering noteOctober 22; draftSnacks ordered for 30; no room-capacity statement

All documents are authored teaching material. The exercise does not describe a real venue or provide a safety assessment. Its question is about evidence handling: which sources can support a planning answer, and which numbers are irrelevant or insufficient?

Download the four-document pack and selection log. Read the full statements before using the summary table. A manifest is an index to evidence, not a substitute for the underlying content.

Build a source-selection log

Keep D2 as the current planning constraint because the fixture explicitly identifies its status. Retain D1 in the audit log as superseded, but do not pass its old number forward as an alternative current capacity. D3 remains a conflict or question for the room owner. D4 is irrelevant to the capacity question, although it may matter to a separate catering decision.

The distinction between “excluded from this answer” and “deleted” is useful. You can omit D4 from the model's immediate evidence pack while retaining it in the source register. When someone later asks about refreshments, the file still exists and its relevance changes.

Record the reason for each choice. “D2 is newer” is incomplete; a newer draft can be less authoritative than an older approved policy. In this fictional pack, both date and explicit planning status support the choice. In your own documents, identify the actual owner and approval mechanism instead of treating a filename suffix as authority.

A selection log can use five fields: source ID, task relevance, current status, included passage and reason for inclusion or exclusion. Add an unresolved-question field when the status is unclear. That gives a reviewer something more precise to challenge than “we chose the best documents.”

Organize the context around the answer

The selected context pack should contain the task, the governing passage from D2, the D3 conflict and the output contract. Include only as much of each passage as the decision requires, while preserving units, dates and conditions. Do not compress “16 seated visitors with a clear aisle” into “capacity 16” if the missing condition could change the interpretation.

An original task brief might say:

Answer the planning question using D2 as the current fixture constraint. Note that D3 is an unverified recollection. Do not use snack quantity as room capacity or use D1 as the current rule. Return a provisional planning answer, source IDs and the question for the room owner.

This is not a general instruction to trust whichever file is named D2. Its meaning depends on the supplied manifest and the reviewed source passages. If those change, update the brief and selection log together.

Draw a traceable context map

Place the question in the center, then add current evidence, superseded evidence, unresolved recollection and irrelevant to this decision around it. Connect the draft answer only to passages that actually support its claims. Connect D3 to a question for the room owner, not to a confirmed capacity node.

Open the AI agent architecture template and adapt the memory and input areas into those evidence groups. Label each source with its ID and status. The point is to make a wrong connection visible before it becomes a confident paragraph.

Which source supports the answer?

Author-created example: inspect the relationships before adapting the template.

The whiteboard is where you inspect and revise the structure. It does not fetch the sources or decide their authority for you. The Claude Skills guide explains how a reusable review procedure can sit beside this task-specific context pack.

Compare two authored draft answers

A weak answer might say, “The room can accommodate the twenty-person workshop because earlier events had twenty people and catering covers thirty.” That sentence mixes an old experience, an unrelated quantity and an unsupported current conclusion. More confident wording would only make the problem harder to spot.

A better authored answer for the fixture is:

The supplied current planning note supports sixteen seated visitors under its stated layout condition, so it does not support planning a twenty-person seated workshop as proposed. D3 describes an unverified recollection and should be checked with the room owner. Confirm whether the event format or approved room plan can change before scheduling.

The correction is structural. It chooses the relevant constraint, preserves its condition and keeps uncertainty separate. It does not claim that an AI system made the correction, nor that sixteen is an actual venue's permitted capacity.

Inspect each number in the answer. A count of snacks, a count of previous attendees and a planning limit answer different questions. Their shared unit of “people” does not make them interchangeable. This is a useful review habit for financial figures, task estimates and survey denominators too.

Handle updates without losing the evidence trail

Suppose a fifth document arrives saying the room plan has changed. Do not simply append it and hope the model prefers it. Check its owner, effective date, approval status and relationship to D2. Then update the selection log, the chosen passages and the draft answer.

Preserve the earlier decision with its evidence version. A reviewer should be able to explain why the answer was reasonable before the update and why it changed afterward. Otherwise, the current answer may look correct while the process that produced it remains impossible to audit.

A small revision record can say: “Version 2 used D2 and preserved the D3 question. Version 3 will be drafted after the room owner confirms whether the new layout replaces D2.” An explicit pending state is preferable to quietly mixing old and new conditions.

If the owner is unknown, identify that as the next task. Do not let a model infer authority from formal formatting, a recent timestamp or a confident tone. Those features may be clues, but they are not equivalent to approval.

Choose a practical retrieval strategy

For a small pack, manual selection may be sufficient. For a larger archive, retrieval can help locate candidate passages, but the review still needs source identity, version and scope. A relevant paragraph from a superseded file can be less useful than a slightly less similar passage from the governing document.

Separate the retrieval question from the answer question. First ask which documents may be relevant and why. Then inspect their status. Only afterward assemble the context used to answer the user. That separation makes it easier to diagnose a failure: was the right document never retrieved, or was it retrieved and then misinterpreted?

Define an acceptable no-answer condition. If two apparently governing documents conflict and nobody can establish which applies, the output should preserve the conflict and request resolution. A ranking algorithm or a longer prompt cannot supply an organizational decision that has never been made.

For a task that needs explicit retries, stop states and human handoff, use the agentic workflow walkthrough. It adds process control around the evidence-selection work described here.

Common context engineering mistakes

Equating more context with more evidence. Repeating D1 several times does not make it current. Duplicate information can amplify a stale claim. Keep one traceable reference and document its status.

Removing conditions during summarization. Dates, denominators and scope often carry the meaning. Compress prose only after deciding which qualifiers must survive.

Writing permanent task facts into a reusable skill. The selection method can be reusable; this room's current capacity belongs in a dated source. See the Cowork report example for a bounded handoff using a source pack.

Claiming efficiency without measuring it. A smaller pack may be easier to review, but this exercise has not measured tokens, latency, cost or answer quality. If you evaluate those later, hold the task and scoring rubric constant and retain the actual runs.

Try the selection log on your own question

Choose one decision, identify its candidate sources and fill the selection log before drafting. Draw only the relationships you can support, preserve the unresolved questions, and save the evidence version with the answer. You will have a context pack another person can inspect instead of a large pile of text whose influence is hard to explain.

Sources and verification

Official references used to verify the facts and comparisons in this article.

Frequently Asked Questions

Is context engineering just a longer prompt?

No. This exercise changes which evidence is supplied, how versions are identified, how uncertainty is represented and how the answer traces back to passages. A clear prompt is one part of that arrangement.

Should old documents always be removed?

No. Preserve them when history matters, but distinguish historical context from current authority. Omission from the immediate answer pack is not the same as deletion from the archive.

What should happen when sources conflict?

Check ownership, effective dates and scope. If the conflict remains unresolved, report it and ask the responsible person to decide. Do not invent a compromise number.

Related Posts