← All courses ← Course home

Lesson 01 of 05

Why packing context matters

The model can only see a fixed desk. Extra memory, extra search hits, and extra tools crowd out the question.

Agent brief (llms.md)

On-device windows are small. SystemLanguageModel exposes a contextSize you can read. Private Cloud Compute is larger (WWDC26 quotes 32,000 tokens) and still not infinite. Dumping every note, every tool, and the full chat log into that window wastes tokens and pulls the model off the current job.

MemoryAll old notes
SearchEvery hit
ToolsWhole toolbox
ResultTruncation or noise
QuestionThis turn
PackOnly what this turn needs
SessionOne active Profile

What packing is not

Packing is not prompt poetry. It is a ranked fill of a budget. You keep the user question, a short instruction, the few memories that match, the few search hits that match, and the tools this Profile is allowed to call. Everything else waits.

WWDC26 session 242 calls this context engineering: trim or redact the transcript so the model stays inside the window and stays focused. Dynamic Profiles give you a place to declare that pack. Your assembler decides the contents.

EDGE FDE rule. If a slice does not change the answer, it does not earn a seat.

Next, count tokens so the budget is real.

Key concepts

  • On-device windows are small. SystemLanguageModel.contextSize is a hard limit.
  • Private Cloud Compute is larger but still finite.
  • Packing is a ranked fill of a budget, not prompt poetry.
  • If a slice does not change the answer, it does not earn a seat.

Takeaways

  • Extra memory, search hits, and tools crowd out the question.
  • Keep the user question, short instructions, matching memories, matching hits, and allowed tools only.
  • Dynamic Profiles declare the pack. Your assembler picks the contents.