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.
Related terms
Context
Context is all the text a model can see for a single request: the system prompt, your message, the conversation so far, and any files or tool output the agent has pulled in. It is the only thing the model knows about your specific situation.
Read definition →Parametric knowledge
Parametric knowledge is what a model knows from training, stored in its parameters. It is broad and instantly available but frozen, unsourced, and not always reliable.
Read definition →Hallucination
A hallucination is a confident, plausible-sounding output that is simply wrong: an invented API, a fabricated file path, a made-up citation. It is not the model lying. It is the model doing exactly what it always does, predicting plausible text, with no built-in sense of truth.
Read definition →