Context Engineering

Selecting and Loading Context

  • Everyone wants your context as their moat. Own context in a model-agnostic layer that outlives any agent, model, or vendor.
  • Keep context headless and agent-readable. Expose definitions, owners, filters, code, values, lineage, and canonical sources through files and APIs rather than vendor-specific interfaces.
  • Context is finite and has diminishing returns. You need to model and clean it.
    • Experiment with representations that improve information density and understanding.
    • Core tactics are augmentation, tool loadout, quarantine (subagents), pruning, offloading, and summarization. Prune what’s irrelevant before summarizing.
    • LLMs have bounded cognition too. A context window is a hard limit on how much it can take into account at any one time. Design sessions so the model doesn’t lose the thread.
  • Context is king. Managing the context window effectively is crucial for getting good results.
  • Use Progressive Disclosure to ensure that the agent only sees tasks or project-specific instructions when it needs them.
    • Tool/skills overload confuses models. Just because you can connect every tool doesn’t mean you should. Each tool description consumes context window space and can confuse the model about which tool to use when.
  • Design against three dominant failure modes: concept-to-entity ambiguity, stale knowledge, and retrieval failure. Collapse competing definitions into governed sources, update context with the systems it describes, and route the agent into a small relevant search space.
  • Good context is data plus interpretation, procedure, authority and memory.
    • Separate declarative knowledge from procedural knowledge. Sources of truth define what concepts mean, while thin routing and runbook skills specify what to consult, in what order, how to resolve ambiguity, and how to verify the result.
  • Different source types need different modeling. Slack threads, CRM records, documents, and meetings should not share one generic chunking pipeline.
    • Pre-model recurring meaning from expensive unstructured data with versioned prompts and domain taxonomies. Preserve raw sources and lineage.
  • Context transformations are lossy compression. Preserve canonical sources and lineage.
  • The context window is only the final delivery mechanism (deployment target).
  • There is a big bottleneck on information retrieval. Even if you had a magical oracle with perfect information access, the agent (like humans) needs to know how to write the query and the oracle needs to know how to interpret it to fetch only the relevant information given that query.

History and Memory