Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Context Engineering - Making Every Token Count

Avatar for Addy Osmani Addy Osmani
September 09, 2025

Context Engineering - Making Every Token Count

Slides from my talk at O'Reilly AI CodeCon

Avatar for Addy Osmani

Addy Osmani

September 09, 2025
Tweet

More Decks by Addy Osmani

Other Decks in Technology

Transcript

  1. CONTEXT WINDOWS ARE LIKE LIMITED RAM Curation of what fi

    ts into RAM is analogous to “context engineering” ANALOGY
  2. PROMPT ENGINEERING Clear instructions for models so they can accomplish

    a task https://www.youtube.com/watch?v=ysPbXH0LpIE PRELUDE
  3. CONTEXT ENGINEERING MEANS PROVIDING AN AI WITH ALL THE INFORMATION

    AND TOOLS IT NEEDS TO SUCCESSFULLY COMPLETE A TASK – NOT JUST A CLEVERLY WORDED PROMPT. DEFINITION
  4. TOO LITTLE CONTEXT: VAGUE OR HALLUCINATED RESPONSES. TOO MUCH CONTEXT:

    DISTRACTED, UNABLE TO FIND RELEVANT INFO, OVER-INDEXING ON PATTERNS. BAD CONTEXT: POISONING, TRUSTING INCORRECT STATEMENTS OVER TRAINING.
  5. TOO LITTLE CONTEXT: VAGUE OR HALLUCINATED RESPONSES. TOO MUCH CONTEXT:

    DISTRACTED, UNABLE TO FIND RELEVANT INFO, OVER-INDEXING ON PATTERNS. BAD CONTEXT: POISONING, TRUSTING INCORRECT STATEMENTS OVER TRAINING.
  6. TOO LITTLE CONTEXT: VAGUE OR HALLUCINATED RESPONSES. TOO MUCH CONTEXT:

    DISTRACTED, UNABLE TO FIND RELEVANT INFO, OVER-INDEXING ON PATTERNS. BAD CONTEXT: POISONING, TRUSTING INCORRECT STATEMENTS OVER TRAINING.
  7. •Be precise: Vague requests lead to vague answers. The more

    specific you are, the better your results will be. •Provide relevant code: Share the specific files, folders, or code snippets that are central to your request. •Include design documents: Paste or attach sections from relevant design docs to give the AI the bigger picture. •Share full error logs: For debugging, always provide the complete error message and any relevant logs or stack traces. •Show database schemas: When working with databases, a screenshot of the schema helps the AI generate accurate code for data interaction. •Use PR feedback: Comments from a pull request make for context-rich prompts. •Give examples: Show an example of what you want the final output to look like. •State your constraints: Clearly list any requirements, such as libraries to use, patterns to follow, or things to avoid. CONTEXT ENGINEERING FOR AI CODERS