Part II · Context, Memory, Files, and Composition
Context Engineering as Content Composition
Context compositionOperation-aware contextEvidence budgetContext warrant
1. Context is part of the intelligence
For one model invocation, the supplied context is the world the model can reason within. Choosing that world is therefore not transport plumbing. It is an intelligence act.
AIOS defines a reasoning ground as:
A bounded, purpose-shaped account that makes one judgment possible while preserving the uncertainty, disagreement, authority, and source access needed to keep that judgment honest.
It is the active expression of the semantic situation for one cognitive movement.
Context composition is therefore the attention-formation function of the reasoning turn. It does not merely deliver information to intelligence after the important work has happened. It establishes what is in focus, why it matters, which relationships are visible, what standing they have, what remains intentionally absent, and which consequence the next judgment may responsibly produce.
This function can cross semantic and mechanical layers. Deterministic mechanisms can resolve canonical identities, collect declared regions, check revisions, enforce quantity limits, and record a warrant. People or bounded model judgments may be needed to interpret purpose, relevance, conflict, semantic altitude, or loss. The system provides the structures through which attention is formed; the intelligence moving through those structures is not reducible to the assembly mechanism itself.
That expression may draw from three context horizons at once: the immediate frame, the active semantic situation, and the durable domain ground. Their relationships remain available to the system; only the movement-relevant projection becomes model-visible context.
The relevant optimization is not maximum recall. It is a coherent composition of:
- purpose and present bearing;
- semantic standing;
- exact object and transformation;
- evidence, decisions, constraints, and alternatives;
- artifact or plan state at the right resolution;
- applicable methods and quality conditions;
- authority, expected product, and stop condition;
- source descent, omission, and loss information.
This is the Fractal Seed expressed at the scale of one model call. The context establishes why the movement matters, develops how its ground bears on the question, and names what judgment or artifact should return. The model receives real semantic work, but only within that bounded movement. Any accepted result must then land in local artifacts, records, or relationships so that it changes the ground from which the next context is composed.
2. The authored-argument model
Every included region should have a reason to be present.
It should do at least one of the following:
- establish purpose or scope;
- define the object;
- supply evidence or counterevidence;
- preserve a material alternative or contradiction;
- state an accepted decision, dependency, or constraint;
- show current artifact or plan state;
- configure the judgment through useful guidance;
- define authority, expected product, or stopping condition.
If it does none of these, it is probably noise in the current context.
3. The natural order of reasoning ground
The authored order of reasoning ground
Model-facing context becomes an accountable argument through bearing, current state, commission, focal ground, guidance, authority, and warrant.
Text equivalent
1. Bearing — What this movement serves → 2. Current situation — Accepted · live · contested · changed; 2. Current situation — Accepted · live · contested · changed → 3. Commission — Exact judgment and semantic product; 3. Commission — Exact judgment and semantic product → 4. Focal ground — Evidence · artifact · decisions · alternatives; 4. Focal ground — Evidence · artifact · decisions · alternatives → 5. Guidance — Method · distinctions · quality · failure boundaries; 5. Guidance — Method · distinctions · quality · failure boundaries → 6. Authority and return — What may change · what to return · when to stop; 6. Authority and return — What may change · what to return · when to stop → 7. Context warrant — Why included · what omitted · where to descend.
The order carries meaning: purpose arrives before evidence, and the exact judgment arrives before methods or constraints that could otherwise dominate it. Authority bounds the return, while the final warrant explains why the composition is fit and where omitted ground can re-enter.
This order makes the context legible as an argument:
- why attention is being assembled;
- what the situation presently is;
- what judgment is required;
- what material bears on it;
- how the work may be improved;
- what consequence is allowed;
- why this composition is accountable.
The order can change when the work requires it, but the composer should be able to explain why.
4. Three selection tests and an evidence budget
Necessity
What would the intelligence otherwise need to reconstruct or guess?
Examples: governing purpose, exact definition, current artifact state, a binding decision, an unfamiliar domain distinction.
Distortion
What would become misleading if omitted or compressed further?
Examples: material dissent, uncertainty, counterevidence, a limitation on an accepted claim, the difference between proposal and decision.
Interference
What unrelated frame, obsolete instruction, duplicated explanation, premature solution, or overly broad history would this material import?
These tests produce a better selection criterion than simple semantic similarity.
They operate inside an evidence budget, not merely a token budget. The composer first identifies the operation being performed:
- lookup;
- comparison;
- aggregation;
- contradiction resolution;
- temporal update;
- structural reasoning;
- creation or transformation;
- verification.
The operation determines which kinds of evidence, how many independent sources, what resolution, and what ordering are sufficient. A local wording change may need one exact passage and whole-document bearing. A contested decision may need several sources, dissent, temporal state, and an explicit route back to primary evidence.
The budget accounts for attention, latency, privacy, cost, and consequence as well as context length. Its quality is judged through relevance density, standing, freshness, placement, sufficiency, and exact source descent. Neither the smallest nor the largest possible context is inherently best.
5. Fixed composition, fresh content
The architecture can preserve a stable composition while replacing its content each turn.
=== GUIDANCE ===
[FOCUS] — why this judgment is happening
[ROLE] — the relevant operational standpoint
=== CONTEXT ===
[PURPOSE] — current governing purpose
[SITUATION] — accepted, contested, changed, unknown
[ARTIFACT_MAP] — current structure at the needed resolution
[EXACT_GROUND] — selected source or artifact passages
[PRACTICE] — relevant workflow, method, or quality conditions
=== INPUT ===
[COMMISSION] — exact requested transformation
[MESSAGE_OR_TARGET] — present object
[RETURN] — expected product, authority, and stopping condition
For every block, the composition contract can name:
- source and revision;
- order;
- whether it is required;
- whether truthful emptiness is allowed;
- whether absence means omission;
- exact history or quantity limits;
- refresh conditions;
- stale or malformed behavior;
- consumer and effect on the judgment.
The labels above are illustrative. Model-facing language should use human meaning rather than unnecessary implementation vocabulary.
6. Context is prepared by altitude
Different judgments require different resolutions.
The default is the coarsest sufficient semantic altitude: the highest-level representation capable of supporting the intended judgment and consequence without hiding a material distinction. Context descends when a named need makes that representation inadequate. The need may be an exact quotation, contested compression, unresolved evidence, structural ambiguity, local language repair, or an authorized mutation. The goal is not to remain abstract; it is to prevent detail from entering without a purpose it can serve.
Three dimensions should not be collapsed. A horizon describes temporal and attentional reach: immediate, working, or durable. An altitude describes the semantic scale of the object: passage, document, structure, project, or domain. An operation describes the transformation being attempted: comparison, revision, verification, planning, or another cognitive movement. Context composition selects across all three dimensions. For example, a passage edit operates at low altitude but may still require one durable decision; a strategy review operates at high altitude but may need one exact immediate source.
| Altitude | Typical purpose | Preferred ground | Ground usually withheld |
|---|---|---|---|
| Immediate turn | Develop the live thought | Current file, purpose, recent movement, relevant map, current input | Whole unrelated project corpus |
| Passage edit | Make an exact bounded change | Exact target, neighboring seams, protected meaning, whole-document bearing | Full session history |
| Document | Compose or evaluate coherent artifact | Purpose, structure, selected sources, exact draft, criteria | Unrelated files and archive |
| Structure | Change movements and relations | Document Map, companion metadata, dependencies, pending commissions | Most line-level prose until needed |
| Workflow stage | Perform one expert stage | Stage purpose, role, inputs, prior outputs, quality bar | Full workflow library and other projects |
| Project | Align outcomes, documents, plans, returns | Project purpose, plan, document maps, decisions, relationships | Complete prose of every document |
| Evidence review | Test claims and support | Claims, exact sources, provenance, counterevidence, definitions | Decorative prose and unrelated plans |
| Practice review | Test a recurring method | Occurrences, outcomes, counterexamples, scope, exact evidence descent | Complete transcripts of all episodes |
Metadata-first reading protects width. Exact prose re-enters when wording, evidence, or mutation depends on it.
7. Layered detail and exact descent
Context is compressed by use rather than once for all purposes.
Exact descent and semantic ascent
Context descends from a corpus to exact prose, while corrections found below travel upward to alter movement, document, and project bearing.
Text equivalent
Workspace or corpus synthesis → Project situation and relationships; Project situation and relationships → Document Home and accepted map; Document Home and accepted map → Movement contribution and anchor; Movement contribution and anchor → Exact prose, source, or evidence.
The solid arrows narrow resolution only when exact detail is needed. The dotted arrows carry support or correction upward: descent is not complete until the recovered material is interpreted again at the scale where its consequence belongs.
The system descends to exact source when:
- quotation or technical wording matters;
- a summary is contested;
- support for a claim must be evaluated;
- a revision will mutate exact language;
- a compressed alternative becomes material;
- the source changed after the summary was formed.
No projection outranks the material it describes.
Descent is complete only when the recovered detail is reinterpreted at the receiving altitude. An exact sentence may change a movement map; a corrected movement map may change a document argument; a source contradiction may reopen a project decision. Copying low-level material into the capsule without restoring its higher-level bearing is retrieval, not completed composition.
8. Context standing must be readable
Natural language should make authority explicit:
- “The source states…”
- “The project currently accepts…”
- “The previous review inferred…”
- “This remains contested…”
- “This is a candidate route…”
- “This conclusion was superseded for…”
- “No evidence in the present source set establishes…”
Structural labels can reinforce these differences but should not replace the sentences explaining what they mean in the case.
9. Contradiction belongs in optimized context
An optimizer that selects only support for the leading conclusion is not optimizing for intelligence. It is optimizing for narrative consistency.
Contradictory or minority ground should enter when it could change:
- the object or question;
- confidence;
- a decision criterion;
- the plan;
- artifact honesty;
- the scope in which a method applies;
- the need for person adjudication.
Under context pressure, a minority account can be compressed into:
- its strongest evidence;
- the conditions under which it may be true;
- why it was not selected;
- a path to the full source.
“Other views exist” is not enough.
10. The context warrant
A consequential context composition should be inspectable through a short warrant stating:
- why the selected sources and resolutions fit;
- which material was summarized rather than quoted;
- what was withheld for independence, privacy, or bounded attention;
- which live alternative was preserved;
- what changed since the last comparable judgment;
- where deeper ground can be recovered.
The warrant is not hidden chain of thought. It is an accountable description of the finished selection.
This makes context composition measurable: researchers can compare the warrant, supplied context, omitted ground, and resulting judgment.
11. Reasoning guidance is composed, not merely retrieved
Guidance can come from:
- a temporary scaffold created for the present movement;
- a reviewed single-stage method;
- a dependent sequence;
- a multi-stage workflow;
- role or domain ground;
- an exemplar or template;
- accepted personal or project fitting.
Stable guidance should be used when its occasion, object, boundaries, and result fit. It can be adapted with local evidence and terms. Multiple guidance items should be combined only when one judgment remains primary.
The receiving model should see the coherent guidance, not the catalog, rejected candidates, scoring trace, or assembly machinery.
When guidance decomposes work into stages, every staged judgment must have a named consumer and dependency. A review that no later judgment reads, a summary that no decision uses, or a framing step that does not change the commission is orchestration overhead rather than context intelligence.
12. Dynamic controls shape composition
The established thinking architecture uses compact controls such as:
- Depth: Light, Regular, Deep;
- Aperture: Focused, Continuity, Telescopic;
- Ground: Past, Present, Future;
- Condition: Clear, Uncertain, Tension;
- selected guidance;
- optional suggested actions.
Later ontology work adds multi-valued context signals and an optional navigation focus.
These controls can change:
- how much recent history is included;
- whether exact or mapped artifacts enter;
- how far relationships expand;
- which alternatives or evidence are emphasized;
- whether multiple movements are useful;
- which guidance becomes relevant.
The model selects semantic orientation from supplied options. Deterministic mechanisms resolve identities and compose the resulting natural-language ground.
13. Context-composition pipeline
From intention to a warranted context capsule
Purpose and object become model-visible ground through evidence budgeting, source checks, selection tests, named descent, authority, and a warrant.
Text equivalent
Current intention and object → Determine judgment and coarsest sufficient altitude; Determine judgment and coarsest sufficient altitude → Name operation and evidence budget; Name operation and evidence budget → Resolve canonical sources and standing; Resolve canonical sources and standing → Retrieve candidate ground through fitting access paths; Retrieve candidate ground through fitting access paths → Apply necessity · distortion · interference; Apply necessity · distortion · interference → Named need for deeper ground?; Descend to exact source or artifact → Reinterpret at the receiving altitude; Reinterpret at the receiving altitude → Select or compose guidance; Select or compose guidance → Layer exact and compressed detail; Layer exact and compressed detail → Bind authority, product, stop condition; Bind authority, product, stop condition → Record context warrant; Record context warrant → Assemble model-visible capsule; Assemble model-visible capsule → Bounded judgment.
The central diamond controls depth: exact sources enter only for a named need, and anything recovered must be reinterpreted at the receiving altitude before composition continues. The warrant is recorded before the capsule reaches judgment, making selection and omission inspectable.
Some steps may be combined, performed by deterministic rules, or carried by a semantic seat. The architecture does not require one universal context-selector agent.
14. Context specimen: evidence-sensitive planning
BEARING
The project must decide whether to begin a one-site pilot now or wait for a
second site. The purpose is to learn without making claims the pilot cannot support.
CURRENT SITUATION
The first site is ready. The second agreement is delayed three to five months.
The budget cannot support both an immediate pilot and a later full pilot.
The first site represents a narrower population than the intended deployment.
COMMISSION
Compare: begin now, wait, or redesign the first phase as a narrow operational study.
State criteria, irreversible costs, learning value, and reversal conditions.
FOCAL GROUND
Enrollment capacity can expose operational failure but not modest outcome effects.
The team may dissolve after a nine-month delay. A minority view warns that even
a narrow pilot may create pressure to overinterpret favorable results.
GUIDANCE
Separate learning claims from effectiveness claims. Make reversibility and value
of information explicit. Treat institutional pressure as a governance risk.
AUTHORITY AND RETURN
Recommend and plan; do not authorize spending or public claims. Return comparison,
route, dissent, first checkpoint, budget consequence, claims boundary, and reopen conditions.
CONTEXT WARRANT
Detailed protocol wording is omitted because safety review is already accepted.
The minority governance risk is included because it changes required controls.
This is context as composition: the model is not merely given documents that happen to mention pilots.
15. Anti-patterns
Retrieval dump
Many semantically similar passages are included without an argument about their standing or relevance.
Chronological transcript
Process order substitutes for present semantic state.
One universal system prompt
Generic rules attempt to carry purpose, domain expertise, workflow, style, and current object at once.
Hidden summarizer authority
A compressed account silently becomes the canonical account.
Context by token vacancy
The system includes more material because budget remains rather than because the judgment requires it.
Premature solution injection
Prior answers enter an exploratory context and constrain discovery before the object has been clarified.
Catalog injection
The model receives all workflows, tools, or guidance and must spend attention selecting among irrelevant options.
16. Evaluation program
Context composition can be evaluated at several levels.
Structural
- correct block order;
- exact source and revision;
- omission and emptiness behavior;
- standing labels;
- context size and exact quantities;
- declared operation and evidence budget;
- coarsest sufficient starting altitude and the named reason for any descent;
- reinterpretation of exact findings at the receiving altitude;
- warrant completeness.
Semantic
- relevance to the commission;
- preservation of material contradiction;
- adequacy of purpose and artifact state;
- absence of premature framing;
- appropriateness of guidance;
- sufficient source descent.
Outcome
- response quality and factual fidelity;
- fewer clarification or reconstruction turns;
- better long-horizon consistency;
- better calibrated uncertainty;
- fewer unauthorized effects;
- improved resumption and correction.
Comparative
Compare composed context against:
- full recent transcript;
- generic retrieval top-k;
- rolling summary plus latest prompt;
- human-authored briefing;
- ablations removing purpose, standing, dissent, or warrant.
17. Research connection: available context is not usable context
AIOS arrives at context composition from the product architecture: a bounded cognitive movement needs purpose-shaped ground before model judgment can be useful. Current research sharpens why this matters. NoLiMa finds sharp long-context degradation when relevant facts must be connected without lexical overlap. Context Length Alone Hurts LLM Performance Despite Perfect Retrieval shows that even correctly retrieved evidence can become harder to use as irrelevant material grows. HoloBench further distinguishes raw length from relevant-information volume and the operation being performed.
These studies support operation-aware composition and an explicit evidence budget. They do not establish one universally optimal context size, retrieval method, hierarchy, or AIOS composition. The complete product claim remains a system-level question.
Read deeper in the normalized context-composition brief and full research memo. Chapter 07 explains how this composition remains fresh over long-horizon work.