The skill that separates senior AI engineers from prompt hobbyists.
Dr. Aki Wijesundara
The AI Internship
Today's Session
Part 1
Part 1 · AI Engineering
AI engineering is the practice of building production systems on top of foundation models.
Part 1 · AI Engineering
Write the right prompt.
A discrete task. Optimise one string.
Design the right context.
A system. Curate what the model sees on every call.
Part 2
Part 2 · Context Engineering
Context is the set of tokens included when you sample from the model. Everything in the window: system prompt, tools, retrieved docs, message history, tool results, memory, MCP outputs.
Context engineering is the strategies for curating and maintaining the optimal set of those tokens during inference.
Source: Anthropic, "Effective context engineering for AI agents", Sep 2025
Part 2 · Context Engineering
Source: Anthropic, "Effective context engineering for AI agents"
Part 2 · Why it matters
Two ideas to internalise before anything else.
As tokens in the window grow, the model's ability to recall information from it degrades. Every model. Some gracefully, but the curve is universal.
Transformers create n² pairwise relationships. More tokens, thinner attention. Models were trained mostly on shorter sequences, so long-range reasoning is genuinely harder.
The Guiding Principle
Everything else in this session is a tactic in service of this principle.
Part 2.1
Anatomy · System Prompts
Source: Anthropic, "Effective context engineering for AI agents"
Anatomy · Tools
Tools are the contract between the agent and the world. Bad tools poison context.
Anatomy · Examples
Few-shot prompting still works. But don't dump every edge case into the prompt.
Stuff a laundry list of every possible rule and edge case into the prompt.
Pick a small set of diverse, canonical examples that show the shape of the desired behaviour.
Part 2.2
Retrieval · Two paradigms
Embed everything ahead of time, retrieve top-K at query time, stuff into context.
Trade-off: fast, but you're guessing what's relevant before the agent has started thinking.
Agent holds lightweight references (file paths, queries, IDs). Pulls data into context dynamically as it needs it.
Trade-off: slower, but mirrors how humans work. Used by Claude Code.
Part 2.3
Long-Horizon · Overview
Codebase migrations, deep research, multi-hour agents. Three techniques to know.
| Technique | What it does | Best for |
|---|---|---|
| Compaction | Summarise the conversation, restart with the summary. | Extensive back-and-forth. |
| Structured notes | Agent writes notes outside the window, reads them back later. | Iterative work with milestones. |
| Sub-agents | Spawn focused sub-agents with clean contexts, return distilled summaries. | Complex research, parallel exploration. |
Long-Horizon · Technique 1
When the conversation approaches the window limit, summarise it and start fresh with the summary.
Claude Code does this. It preserves architectural decisions, unresolved bugs, and key implementation details while dropping redundant tool outputs.
Long-Horizon · Technique 2
The agent writes notes to a persistent store outside the context window and reads them back later. Simple patterns work: a TODO list, a NOTES.md file, a memory tool.
Long-Horizon · Technique 3
Instead of one agent holding all state, spawn focused sub-agents with clean context windows.
Each sub-agent can burn this much exploring deep inside its own focused task.
What it returns to the lead agent: a condensed, distilled summary.
The One Thing to Remember
RAG, agents, memory, MCP, compaction, sub-agents. Every one of them is a tactic in service of this principle.
Context as a finite, precious resource is not going away.
Two programmes — pick the one that fits where you are.
For engineers & builders
4 weeks. Build RAG pipelines, LangChain apps, AI agents, and deploy production-ready systems from scratch. Capstone project + certificate.
For PMs & founders
4 weeks. Ship a full-stack AI app, run AI evals like a senior PM, and deploy a live autonomous agent. No coding background required.
Taking both? Get both for $800 — email us at admin@snapdrum.com
Alumni from
Google · Meta · Apple · OpenAI · Amazon · NVIDIA · McKinsey · BCG
Questions? tailabs.ai