What AI is actually doing when it answers you
No magic, no mysticism. A plain walkthrough of tokens, context and why the same question can get two different answers.
It is predicting, not looking things up
A language model generates text by predicting tokens from the context available to it. The application around it may also retrieve documents, search or call tools. A generated answer and a verified tool result are different things: check which one supports the claim.
That single fact explains most of what confuses people. It explains why the model sounds confident when it is wrong, why it can invent a function that does not exist, and why it can be brilliant on one attempt and mediocre on the next.
Context is the whole job
A model brings learned patterns, but it does not automatically know your current app's schema, configuration or failure. Your instructions, attached files, available conversation history and retrieved tool results provide task-specific context. Some earlier material may no longer fit in the active context window.
When an answer is vague, check whether the relevant evidence was available. Share a redacted error, the expected behavior and the affected code. Missing context is one possible cause of a wrong answer, not a guarantee that a longer prompt will fix it.
Why two runs disagree
Sampling is deliberately a little random, so identical prompts drift. That is a feature when you want ideas and a problem when you want a fixed shape of answer.
The fix is structure. Ask for a list with a set number of items, name the fields you want back, give an example of a good answer. Constraints cut the space the model can wander into.
Try it rather than read about it
Start with a free exercise and compare your initial answer with the feedback. The goal is not a clever phrase that works once; it is noticing which evidence changes the result and checking whether the answer meets your requirements.
A worked example: an empty record list
This is an illustrative debugging exercise, not a customer incident. You ask, 'Fix my database; it shows nothing.' The assistant has no response status, query or account context. It might propose a connection change, a filter change or a permission change. Those are different hypotheses, and making all three changes at once hides the cause.
A more useful request is: 'The list is empty after sign-in. The request succeeds with an empty array and no error. This test account owns a draft record, but the query requests only published records. Explain the filter before suggesting any access-policy change.' Now the assistant can compare the expected record with the actual selection. An empty result is consistent with that filter; disabling security is not a justified fix.
Verify the explanation independently: in an isolated environment, change the test query to include drafts while preserving ownership. Read the result again after refresh. Then use a different account to confirm that the first account's record remains private. If those outcomes do not match, the explanation was incomplete even if it sounded convincing.
How to check an answer that sounds certain
Separate the answer into observed facts, hypotheses and proposed actions. 'The request returned 401' is an observation only if you have the response. 'The session expired' is a hypothesis until the credential or server result supports it. 'Remove the access check' is an action that needs a safety review, not a natural consequence of either statement.
For a suggested library function, check the installed package version and its official documentation. For a claim that a file was changed or a payment completed, check the actual tool result and read the resulting state back. A model-generated success sentence does not establish that the external action happened.
Requesting JSON or a fixed list can make output easier to inspect, but it does not make the contents true. Validate required fields and meaningful values before using generated output to trigger an action. Never include working secrets, session tokens or private user records just to make the prompt more specific.
Rather do it than read it?
The Prompt Room is free and takes about a minute.