When people say "the AI wrote this code" or "let the AI fix it," they are almost never talking about artificial intelligence in the science-fiction sense. They mean a large language model wired into a tool that can read and change files. Getting this distinction right is the difference between using these tools well and being surprised by them constantly.
What it actually is
A language model is trained on an enormous amount of text and code. During training it learns one skill extremely well: given some text, predict what comes next. Everything else you see, answering questions, writing functions, refactoring a module, is that single skill applied over and over. The model reads your prompt plus the code it has been shown and produces the most plausible continuation.
That framing explains most of its behaviour:
- It is fluent because plausible text is what it optimises for.
- It sometimes invents things (hallucination), because a confident-sounding continuation can be wrong.
- It has no memory of you between separate conversations, because each request is scored on the text in front of it, nothing more.
Why the distinction matters for coding
Treating the model as a reasoning colleague sets you up to be let down. Treating it as a fast, well-read pattern completer that needs good inputs sets you up to get value. The practical takeaways:
- Context is everything it knows for this task. It only "understands" your codebase to the extent the relevant parts are in front of it. That is why the context window is the resource you manage most carefully.
- It is a component, not the whole system. On its own a model just emits text. Bolt on tools and a loop and you get an agent that can act.
The rest of the foundations section unpacks the machinery: what a model is made of, how text becomes tokens, and why the same prompt can give you two different answers.
Related terms
Model
A model is the trained artifact at the centre of every AI coding tool: a large file of numbers (parameters) that, given some text, produces the most likely continuation. When people say "which model are you using," this is the thing they mean.
Read definition →Agent
An agent is a language model wrapped in a loop that lets it call tools, read the results, and decide what to do next. The model supplies the judgement; the loop and the tools give it hands.
Read definition →Context window
The context window is the maximum amount of text, measured in tokens, that a model can consider for a single request. It is a hard ceiling, and it is the main resource you manage when working with an agent.
Read definition →