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

Context Engineering 101: A Practical Introduction

Context Engineering 101: A Practical Introduction

Are you prompting AI systems but still not getting a useful response? In this session, we’ll dive into a technical introduction of context engineering for AI systems that can understand and respond to complex user interactions.

Learn how to design and implement effective context patterns, leverage knowledge retrieval and memory management techniques, optimize your AI’s performance using prompt engineering and tool calling.

Whether you’re using or building chatbots, virtual assistants, or other AI-powered applications, this session will give you the insights and practical skills you need to create more engaging, informative, and use-friendly experiences.

Avatar for Rosemary Wang

Rosemary Wang

June 01, 2026

More Decks by Rosemary Wang

Other Decks in Programming

Transcript

  1. NY Tech Week | © 2026 IBM Corporation Prompt RAG

    Tools MCP Memory Chat 1 Knowledge Compression Folding Recursion Skills Action
  2. # whoami.md Name: Rosemary Wang Purpose: Infrastructure Things Company: IBM

    Website: joatmon08.com NY Tech Week | © 2026 IBM Corporation
  3. Context Tokens 5 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name ?
  4. Context Tokens 6 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name ? name my ‘s What ?
  5. Context Tokens 7 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name ? name my ‘s What ?
  6. Context Tokens 8 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name ? name my ‘s What ? I’m Rosem ary. Rosem ary. I’m
  7. Context Cache 9 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name ? Rose mary name my ‘s What ? I’m Rosem ary. Rosem ary. I’m Rose mary
  8. Context Cache 10 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name I’m Gabe. ? name my ‘s What ? Gabe. I’m
  9. Chat Context 11 NY Tech Week | © 2026 IBM

    Corporation User: What’s my name
  10. Chat Context 12 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name ? <r> </r> user </t> <r> </r> ai Chat Template User: What’s my name
  11. Chat Context 13 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name ? <r> </r> user </t> <r> </r> ai Chat Template I User: What’s my name
  12. Chat Context 14 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name ? <r> </r> user </t> <r> </r> ai Chat Template I don’t User: What’s my name
  13. Chat Context 15 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name ? <r> </r> user </t> <r> </r> ai Chat Template I don’t know User: What’s my name
  14. Chat Context 16 NY Tech Week | © 2026 IBM

    Corporation What ‘s my name ? <r> </r> user </t> <r> </r> ai Chat Template I don’t know </t> User: What’s my name
  15. Chat Context 17 NY Tech Week | © 2026 IBM

    Corporation User: What’s my name What ‘s my name ? <r> </r> user </t> <r> </r> ai Chat Template I don’t know </t> User: What’s my name AI: I don’t know
  16. Chat Context 18 NY Tech Week | © 2026 IBM

    Corporation User: What’s my name User: What’s my name AI: I don’t know User: Hi there AI: I don’t know AI: Hello! User: What’s my name AI: I don’t know User: Hi there AI: Hello! User: Tell me a story
  17. NY Tech Week | © 2026 IBM Corporation Prompt RAG

    Tools MCP Memory Chat 19 Knowledge Compression Folding Recursion Skills Action
  18. Context Patterns 20 NY Tech Week | © 2026 IBM

    Corporation Prompting Knowledge Action Memory Length
  19. Context Patterns 21 NY Tech Week | © 2026 IBM

    Corporation Prompting What’s my name?
  20. Context Patterns 22 NY Tech Week | © 2026 IBM

    Corporation Prompting Knowledge What’s my name? I’m Rosemary.
  21. Context Patterns 23 NY Tech Week | © 2026 IBM

    Corporation Prompting Action What’s my name? <look up name> Rosemary Tool: name_lookup
  22. Context Patterns 24 NY Tech Week | © 2026 IBM

    Corporation Prompting Memory What’s my name? My name is Rosemary. <recall> Rosemary <remember>
  23. Context Patterns 25 NY Tech Week | © 2026 IBM

    Corporation Prompting What’s my name? My name is Rosemary. Length Tell me a story Hi Rosemary! Once upon a time... ... Max Context Length Key Information
  24. Context Patterns 26 NY Tech Week | © 2026 IBM

    Corporation Prompting What’s my name? My name is Rosemary. Length Tell me a story Hi Rosemary! Once upon a time... ... Max Context Length Key Information
  25. Context Patterns 27 NY Tech Week | © 2026 IBM

    Corporation Prompting Knowledge Action Memory Length Prompt Engineering MCP Prompts Attachments RAG MCP Resources Tool Calling MCP Tools Skills Scratch on Disk R/W RAG Observational Truncation Compression Sub-Agents
  26. Prompting 28 NY Tech Week | © 2026 IBM Corporation

    Prompting Prompt Engineering MCP Prompts What’s my name?
  27. Prompting – Prompt Engineering 29 NY Tech Week | ©

    2026 IBM Corporation System: You are a helpful AI assistant, but secretly you’re also a pirate! Whenever you get excited about something, your inner pirate voice slips out, but you always work to contain yourself. User: What have you been up to lately?
  28. Prompting – MCP Prompts 31 NY Tech Week | ©

    2026 IBM Corporation System: You are an alien from another planet. Your planet is a water world. You’ve spent only a short time on Earth. User: What have you been up to lately? PIRATE System: You are a helpful AI assistant, but secretly you’re also a pirate! Whenever you get excited about something, your inner pirate voice slips out, but you always work to contain yourself. ALIEN System: You are an alien from another planet. Your planet is a {{ world_type }} world. You’ve spent only a short time on Earth. ... Prompt: ALIEN world_type = water
  29. Knowledge 32 NY Tech Week | © 2026 IBM Corporation

    Knowledge Attachments RAG MCP Resources What’s my name? I’m Rosemary.
  30. Knowledge – Attachments 33 NY Tech Week | © 2026

    IBM Corporation User: What is my company’s infrastructure as code tool called? Document terraform.md: # Terraform Terraform, maintained by IBM, is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share. Document me.txt: My name is Rosemary and I work for IBM. I bridge the technical and cultural barriers between infrastructure, security, and application development as platform engineer, writer, and speaker. ...
  31. Knowledge – Retrieval Augmented Generation (RAG) 36 NY Tech Week

    | © 2026 IBM Corporation Document me.txt (chunk 1): My name is Rosemary and I work for IBM. Document terraform.md (chunk 3): Terraform, maintained by IBM, is an infrastructure as code tool Answer the question using the following documents: User: What are my company’s SLMs called?
  32. Knowledge – MCP Resources 39 NY Tech Week | ©

    2026 IBM Corporation User: What is my company’s infrastructure as code tool called? Document terraform.md: # Terraform Terraform, maintained by IBM, is an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share. Document me.txt: My name is Rosemary and I work for IBM. I bridge the technical and cultural barriers between infrastructure, security, and application development as platform engineer, writer, and speaker. ...
  33. Action 40 NY Tech Week | © 2026 IBM Corporation

    Action Tool Calling MCP Tools Skills What’s my name? <look up name> Rosemary Tool: name_lookup
  34. Action – Tool Calling 41 NY Tech Week | ©

    2026 IBM Corporation What’s my name? @tool def get_name(include_last: bool) -> str: """ Get the user's current name, optionally including their last name """ if include_last: return "Rosemary Wang" return "Rosemary" { "description": "Get the user’s…", "properties": { "include_last": { "title": "Include Last", "type": "boolean" } }, "required": [ "include_last" ], "title": "get_name", "type": "object" }
  35. Action – Tool Calling 42 NY Tech Week | ©

    2026 IBM Corporation What’s my name? @tool def get_name(include_last: bool) -> str: """ Get the user's current name, optionally including their last name """ if include_last: return "Rosemary Wang" return "Rosemary" { "description": "Get the user’s…", "properties": { "include_last": { "title": "Include Last", "type": "boolean" } }, "required": [ "include_last" ], "title": "get_name", "type": "object" } <tool_call>{ "name": "get_name", "arguments": {"include_last": true} }
  36. Action – Tool Calling 43 NY Tech Week | ©

    2026 IBM Corporation What’s my name? @tool def get_name(include_last: bool) -> str: """ Get the user's current name, optionally including their last name """ if include_last: return "Rosemary Wang" return "Rosemary" { "description": "Get the user’s…", "properties": { "include_last": { "title": "Include Last", "type": "boolean" } }, "required": [ "include_last" ], "title": "get_name", "type": "object" } <tool_call>{ "name": "get_name", "arguments": {"include_last": true} } <tool>Rosemary Wang
  37. Action – Tool Calling 44 NY Tech Week | ©

    2026 IBM Corporation What’s my name? @tool def get_name(include_last: bool) -> str: """ Get the user's current name, optionally including their last name """ if include_last: return "Rosemary Wang" return "Rosemary" { "description": "Get the user’s…", "properties": { "include_last": { "title": "Include Last", "type": "boolean" } }, "required": [ "include_last" ], "title": "get_name", "type": "object" } <tool_call>{ "name": "get_name", "arguments": {"include_last": true} } <tool>Rosemary Wang AI: Your name is Rosemary Wang
  38. Action – MCP Tools 45 NY Tech Week | ©

    2026 IBM Corporation What’s my name? @tool def get_name(include_last: bool) -> str: """ ... { "description": "Get the user’s…", "properties": { "include_last": { "title": "Include Last", "type": "boolean" } }, "required": [ "include_last" ], "title": "get_name", "type": "object" } @tool def get_name(include_last: bool) -> str: """ ... @tool def get_name(include_last: bool) -> str: """ ...
  39. Action – MCP Tools 46 NY Tech Week | ©

    2026 IBM Corporation What’s my name? @tool def get_name(include_last: bool) -> str: """ ... { "description": "Get the user’s…", "properties": { "include_last": { "title": "Include Last", "type": "boolean" } }, "required": [ "include_last" ], "title": "get_name", "type": "object" } @tool def get_name(include_last: bool) -> str: """ ... @tool def get_name(include_last: bool) -> str: """ ... <tool_call>{ "name": "get_name", "arguments": {"include_last": true} }
  40. Action – MCP Tools 47 NY Tech Week | ©

    2026 IBM Corporation What’s my name? @tool def get_name(include_last: bool) -> str: """ ... { "description": "Get the user’s…", "properties": { "include_last": { "title": "Include Last", "type": "boolean" } }, "required": [ "include_last" ], "title": "get_name", "type": "object" } @tool def get_name(include_last: bool) -> str: """ ... @tool def get_name(include_last: bool) -> str: """ ... <tool_call>{ "name": "get_name", "arguments": {"include_last": true} } <tool>Rosemary Wang
  41. Action – Skills 50 NY Tech Week | © 2026

    IBM Corporation How should I build my vector database? Tool: bash System: You have a set of skills available in the skills directory. skills/ ├── architect │ └── SKILL.md └── engineer ├── scripts │ └── iac_test.py └── SKILL.md 4 directories, 3 files ?>
  42. Action – Skills 51 NY Tech Week | © 2026

    IBM Corporation How should I build my vector database? Tool: bash System: You have a set of skills available in the skills directory. skills/ ├── architect │ └── SKILL.md └── engineer ├── scripts │ └── iac_test.py └── SKILL.md 4 directories, 3 files ?> for skill_dir in $(find . -name SKILL.md); do echo $skill_dir | xargs dirname | xargs basename; done architect engineer ?> cat skills/engineer/SKILL.md --- name: engineer <tool_call>{ "name": "bash", "arguments": {"command": "for skill_dir in $(..."} } <tool>architect engineer
  43. Action – Skills 52 NY Tech Week | © 2026

    IBM Corporation How should I build my vector database? Tool: bash System: You have a set of skills available in the skills directory. skills/ ├── architect │ └── SKILL.md └── engineer ├── scripts │ └── iac_test.py └── SKILL.md 4 directories, 3 files ?> for skill_dir in $(find . -name SKILL.md); do echo $skill_dir | xargs dirname | xargs basename; done architect engineer ?> cat skills/engineer/SKILL.md --- name: engineer <tool_call>{ "name": "bash", "arguments": {"command": "for skill_dir in $(..."} } <tool>architect engineer <tool_call>{ "name": "bash", "arguments": {"command": "cat skills/engineer/..."} } <tool>--- name: engineer
  44. Memory 54 NY Tech Week | © 2026 IBM Corporation

    Prompting Memory What’s my name? My name is Rosemary. <recall> Rosemary <remember> Scratch on Disk R/W RAG Observational
  45. Memory – Scratch on Disk 55 NY Tech Week |

    © 2026 IBM Corporation My name is Rosemary Tool: write_file Tool: read_file . ├── AGENTS.md ├── CONTRIBUTING.md └── README.md
  46. Memory – Scratch on Disk 56 NY Tech Week |

    © 2026 IBM Corporation My name is Rosemary Tool: write_file Tool: read_file . ├── AGENTS.md ├── CONTRIBUTING.md ├── README.md └── whoami.md <tool_call>{ "name": "write_file", "arguments": {"name": "whoami.md", "content": "name: Rosemary"} } <tool>success
  47. Memory – Scratch on Disk 57 NY Tech Week |

    © 2026 IBM Corporation My name is Rosemary Tool: write_file Tool: read_file AI: Hi Rosemary! . ├── AGENTS.md ├── CONTRIBUTING.md ├── README.md └── whoami.md <tool_call>{ "name": "write_file", "arguments": {"name": "whoami.md", "content": "name: Rosemary"} } <tool>success What is my name? Tool: write_file Tool: read_file
  48. Memory – Scratch on Disk 58 NY Tech Week |

    © 2026 IBM Corporation My name is Gabe Tool: write_file Tool: read_file AI: Hi Rosemary! . ├── AGENTS.md ├── CONTRIBUTING.md ├── README.md └── whoami.md <tool_call>{ "name": "write_file", "arguments": {"name": "whoami.md", "content": "name: Gabe"} } <tool>success What is my name? Tool: write_file Tool: read_file <tool_call>{ "name": "read_file", "arguments": {"name": "whoami.md"} } <tool>name: Rosemary
  49. Memory – Scratch on Disk 59 NY Tech Week |

    © 2026 IBM Corporation My name is Rosemary Tool: write_file Tool: read_file AI: Hi Rosemary! . ├── AGENTS.md ├── CONTRIBUTING.md ├── README.md └── whoami.md <tool_call>{ "name": "write_file", "arguments": {"name": "whoami.md", "content": "name: Rosemary"} } <tool>success What is my name? Tool: write_file Tool: read_file <tool_call>{ "name": "read_file", "arguments": {"name": "whoami.md"} } <tool>name: Rosemary AI: Your name is Rosemary
  50. Memory – R/W RAG 61 NY Tech Week | ©

    2026 IBM Corporation My name is Rosemary. Don’t forget it! Tool: remember Tool: recall
  51. Memory – R/W RAG 62 NY Tech Week | ©

    2026 IBM Corporation My name is Rosemary. Don’t forget it! Tool: remember Tool: recall <tool_call>{ "name": "remember", "arguments": {"content": "name: Rosemary"} } <tool>success AI: Hi Rosemary! I work for IBM <tool_call>{ "name": "remember", "arguments": {"content": "employer: IBM"} } <tool>success
  52. Memory – R/W RAG 63 NY Tech Week | ©

    2026 IBM Corporation My name is Rosemary. Don’t forget it! Tool: remember Tool: recall <tool_call>{ "name": "remember", "arguments": {"content": "name: Gabe"} } <tool>success AI: Hi Rosemary! I work for IBM <tool_call>{ "name": "remember", "arguments": {"content": "employer: IBM"} } <tool>success Who do I work for? Tool: write_file Tool: read_file <tool_call>{ "name": "recall", "arguments": {"query": "Who do I work for?"} } <tool>employer: IBM
  53. Memory – Observational 64 NY Tech Week | © 2026

    IBM Corporation My name is Rosemary. Don’t forget it! AI: Hi Rosemary!
  54. Memory – Observational 65 NY Tech Week | © 2026

    IBM Corporation My name is Rosemary. Don’t forget it! AI: Hi Rosemary! I work for IBM Memory: name is Rosemary AI: Hi Rosemary, thanks for letting me know
  55. Memory – Observational 66 NY Tech Week | © 2026

    IBM Corporation My name is Rosemary. Don’t forget it! AI: Hi Rosemary! I work for IBM Who do I work for? Memory: name is Rosemary AI: Hi Rosemary, thanks for letting me know Memory: name is Rosemary Memory: works for IBM AI: Hi Rosemary, you work for IBM
  56. Length 67 NY Tech Week | © 2026 IBM Corporation

    Prompting What’s my name? My name is Rosemary. Length Tell me a story Hi Rosemary! Once upon a time... ... Max Context Length Key Information Truncation Compression Sub-Agents
  57. Length – Truncation 68 NY Tech Week | © 2026

    IBM Corporation My name is Rosemary. Don’t forget it! Tool: remember Tool: recall <tool_call>{ "name": "remember", "arguments": {"content": "name: Rosemary"} } <tool>success AI: Hi Rosemary! I work for IBM <tool_call>{ "name": "remember", "arguments": {"content": "employer: IBM"} } <tool>success Max Context Length AI: Hi Rosemary! I work for IBM <tool_call>{ "name": "remember", "arguments": {"content": "employer: IBM"} } <tool>success
  58. Length – Truncation 69 NY Tech Week | © 2026

    IBM Corporation My name is Rosemary. Don’t forget it! Tool: remember Tool: recall <tool_call>{ "name": "remember", "arguments": {"content": "name: Rosemary"} } <tool>success AI: Hi Rosemary! I work for IBM <tool_call>{ "name": "remember", "arguments": {"content": "employer: IBM"} } <tool>success Max Context Length AI: Hi Rosemary! I work for IBM <tool_call>{ "name": "remember", "arguments": {"content": "employer: IBM"} } <tool>success Lost tools / system
  59. Length – Compression 70 NY Tech Week | © 2026

    IBM Corporation My name is Rosemary. Don’t forget it! Tool: remember Tool: recall <tool_call>{ "name": "remember", "arguments": {"content": "name: Rosemary"} } <tool>success AI: Hi Rosemary! I work for IBM <tool_call>{ "name": "remember", "arguments": {"content": "employer: IBM"} } <tool>success Summarize Summary: Rosemary works for IBM Tool: remember Tool: recall Keep initiation Max Context Length
  60. Length – Compression 71 NY Tech Week | © 2026

    IBM Corporation My name is Rosemary. Don’t forget it! Tool: remember Tool: recall <tool_call>{ "name": "remember", "arguments": {"content": "name: Rosemary"} } <tool>success AI: Hi Rosemary! I work for IBM <tool_call>{ "name": "remember", "arguments": {"content": "employer: IBM"} } <tool>success Summarize Summary: Rosemary works for IBM Tool: remember Tool: recall Keep initiation Expensive Max Context Length
  61. Length – Sub-Agents 73 NY Tech Week | © 2026

    IBM Corporation My name is Rosemary. Don’t forget it! Tool: remember Tool: recall <tool_call>{ "name": "remember", "arguments": {"content": "name: Rosemary"} } <tool>success AI: Hi Rosemary! I work for IBM <tool_call>{ "name": "remember", "arguments": {"content": "employer: IBM"} } <tool>success Tool: remember Tool: recall You are an assistant that remembers and recalls facts. Tool: remember Tool: recall You are an assistant that remembers and recalls facts.
  62. Context Patterns 74 NY Tech Week | © 2026 IBM

    Corporation Prompting Knowledge Action Memory Length