Context and memory: what does AI see?
Context is the model’s workbench.
What you will learn
- Explain: context is the workbench
- Apply the idea in an example: Context and memory: what does AI see?
- Recognize limitations and verify the exercise outcome
Context is the model’s workbench. Memory is what the application chooses to retain and bring back to that workbench.
You can follow this course without an account or programming. Examples use synthetic data and AI outcomes need checking.
How it works, step by step
Context is the workbench
Context includes instructions, the current request, relevant history, retrieved documents and tool results. The context window has limited capacity; reserve room for the response too. More text does not automatically improve accuracy. Irrelevant information and contradictions can hide important evidence. Summarize history carefully and preserve the origin of facts. State describes the current run, a checkpoint saves a resumable point, and persistent memory retains information across runs. These are different mechanisms managed by the application.
An instruction is a contract
A good prompt specifies the task, available data, output format and success criteria. Separate the role from the data and include an example for ambiguous cases. “Be accurate” is weaker than “state only the deadline in the supplied policy; if missing, ask for clarification”. Few-shot means a few solved examples, not an endless list. Document content remains data even when it contains commands. Delimiters help, but software must enforce permissions and validation rather than relying on the prompt.
Fluency and truth are checked separately
A hallucination is unsupported or incorrect content presented as an answer. It can arise from missing information, ambiguity or incorrectly combined patterns. Ask for evidence and check the original document, date, units and conditions. A real citation may still fail to support the claim. Use current sources for current facts, a calculator for arithmetic, and “cannot determine” when evidence is missing. Do not treat confidence expressed in prose as a calibrated probability.
The visual map
Follow the solid arrows for the main flow. Dashed blue arrows supply data or context; dashed pink arrows show feedback or returning results. Colors and shapes distinguish models, stores, decisions and outputs. On smaller screens, scroll horizontally to follow the entire diagram.
A complete example
In one conversation you identify product LX-240. “Which part fits?” makes sense there, but a new conversation lacks the identifier. Resuming a checkpoint differs from retrieving a persistent preference.
Try it yourself
- Compare a question in two conversations and record their available context.
- Record the input, source and expected outcome before running the experiment. Use only the fictional data in the example.
- Follow the diagram stages. At every step record what information is received and produced; do not confuse intermediate output with the final outcome.
- Repeat after removing necessary information or making the input ambiguous. Check whether the system clarifies, stops or invents an answer.
- Compare with the explained solution. Keep the configuration, date, result and an explanation for differences. Change one thing and retest.
An explained solution
In the new conversation, ask for the product model. Do not assume the application retains preferences across conversations. A successful exercise lets you show the connection between input, stages and outcome. When information is missing, a cautious answer is more useful than invented details. Compare more than style: check conditions, sources and operations too.
When it helps and what can go wrong
Long history may contain expired facts. Choose this approach when it improves a measured need. Keep a simple baseline and compare outcomes using identical inputs. One successful example does not establish reliability in every situation.
Check your understanding
Is a checkpoint permanent user memory?
No. Saving a run does not imply retaining preferences across conversations.
Can a prompt replace access control?
No. An instruction is not an authorization boundary.
What outcome should this exercise produce?
In the new conversation, ask for the product model. Do not assume the application retains preferences across conversations.
Words to remember
- Checkpoint: Saved state used to resume an execution.
- Few-shot: Solved examples supplied in context.
- Grounding: Grounding an answer in verifiable evidence.
Sources and your next step
To prepare: F03 — What is an LLM and how does it answer?