GENAI 102
M03 · L03
Context Is the Job

Giving the Agent Context

An agent is only as good as the context you give it. Most bad output is not a bad model — it is missing context. The model cannot see what you never showed it.

01 / 08
GENAI 102
M03 · L03
What Counts as Context

Four Things to Provide

“Context” here is concrete. When you hand a task to an agent, give it all four:

  • The relevant files — the actual code and data it will touch
  • A clear spec of the task — what done looks like
  • Examples of what good looks like — a sample of the output you want
  • Constraints — what it must not change or break
02 / 08
GENAI 102
M03 · L03
Work From Reality

Ground It in the Repo

Point the agent at the actual code and docs, so it works from your reality rather than its guesses. Without them it fills the gaps with plausible inventions.

The Shift
From “write me a function that probably fits” to “here is the file, match how it already works.”
03 / 08
GENAI 102
M03 · L03
Aim for the Relevant Slice

Too Much vs Too Little

Both extremes hurt. Aim for the relevant slice — enough to ground the work, no more.

  • Too much — irrelevant files waste the window and dilute the signal
  • Too little — the agent has to guess, and guesses drift from your intent
  • Module 5 goes deeper on these context-window tradeoffs
04 / 08
GENAI 102
M03 · L03
Show, Don’t Only Tell

Examples Beat Description

Showing one example of the output you want is often worth a paragraph of instructions. The example pins down format, tone and shape that prose leaves ambiguous.

Rule of Thumb
When you catch yourself describing the output in words, paste a sample of it instead.
05 / 08
GENAI 102
Build It
Put It to Work

Build It

How to implement: before your next agent task, gather the 2–3 files it truly needs and write one example of the output you want — then paste those in.

  • Weekly AI Tasks tracker — give the agent the data model and one sample task record, so new code matches your shapes
  • Personal brand site — give it your real résumé and notes as context, so it writes from facts, not invention
06 / 08
GENAI 102
Knowledge Check

Check what stuck

Three questions from this lesson. Answer to see why — the explanation appears whether you were right or wrong. Nothing is scored or saved.

Question 1 of 0
Score 0/0

07 / 08
GENAI 102
Summary
Recap

What you learned

Context is the relevant files, a clear spec, examples, and constraints. Ground the agent in the real repo, aim for the relevant slice, and remember one example often beats a paragraph.

08 / 08