Knowledge & failure modes

Contextual knowledge

Also called: in-context knowledge

Contextual knowledge is what a model knows because it is in the context right now: the files, docs, and output you gave it. It is current and grounded, and it is the main lever against hallucination.

James Phoenix
Understanding Data Updated July 2, 2026

Contextual knowledge is what a model knows right now because it is sitting in the context: the files you opened, the docs you pasted, the command output the agent just read. Unlike memory, it is specific to this task and this moment.

The grounded half of what a model knows

Every model answer blends two sources. Parametric knowledge is the frozen, general memory from training. Contextual knowledge is the fresh, specific material in front of it. The difference matters:

  • It is current: it reflects the actual state of your code, not a snapshot from training.
  • It is grounded: the model is reading a real source, not recalling a plausible one.
  • It is yours: your naming, your structure, your constraints, none of which live in the weights.

The main lever against hallucination

This is why "let the agent read the file" beats "ask the agent from memory" almost every time. When the answer comes from something concrete in the context, the model has far less room to invent, which directly starves hallucination. Most of good context work is really just getting the right contextual knowledge in front of the model at the right time, and keeping the wrong stuff out.

Tip
When an agent gets a specific fact wrong, the fix is usually not a cleverer prompt but better context. Put the real type, the real error, or the real doc in front of it and let contextual knowledge overrule the guess.

Related terms

Building with AI agents?

This dictionary is part of how I think about agentic engineering. If you want the same thinking applied to your codebase, that is what I do.

See how I can help