Sub topic 6
Recording answers and test conditions
This chapter covers how to record each test run so you can score it later, compare it with other runs, and repeat it months from now. It assumes you have a prompt set (see the prompt design chapter) and a documented protocol with repeated runs (see the protocol and variability chapters). You should be comfortable with spreadsheets, CSV, and JSON files.
Why recording is its own step
An AI assistant's answer is not stored anywhere you can look it up again. If you read an answer, note "we were mentioned" and close the tab, you cannot later check that judgment, re-score it with a better rule, or find out why results changed. Three problems follow from skipping the record:
- No audit trail. You cannot show a colleague why a prompt scored zero.
- No re-scoring. If you change how you count mentions, you must re-run everything instead of re-reading what you saved.
- No comparison across time. Without the conditions, you cannot tell a real change in visibility from a change in settings.
The rule for this chapter is: save the raw answer exactly as returned, and save the conditions under which you got it. Scores are derived from these records. They never replace them.
What to record for every run
Each run is one prompt sent once to one assistant under one set of conditions. Record two groups of fields: the conditions and the content.
Test conditions
| Field | Why it matters | Example |
|---|---|---|
| run_id | Unique key for the row | 2026-11-29-chatgpt-disc-01-r2 |
| date and time (with timezone) | Models, indexes, and search results change over time | 2026-11-29T10:16:00Z |
| assistant | Different products give different answers | ChatGPT, Gemini, Perplexity, Copilot, Claude |
| model or version label | Shown in the interface; may change without notice | the label shown in the model picker |
| mode | Web search on or off, deep research, voice, and so on | web search on |
| account state | Signed in, signed out, memory or personalization on or off | signed out, memory off |
| location and language | Results can differ by region | UK, English |
| prompt_id and prompt text | Links the run to the prompt set | disc-01 |
| run number | Identifies the repeat within a batch | 2 of 5 |
| conversation state | A new chat and a continued chat give different answers | new chat |
| tester | Helps trace manual differences | initials |
Record what you can see. If an interface does not show the model version, write "not shown" instead of guessing. A guess in the log looks like a fact later.
Content
- The full answer text, copied as returned, including lists and any links.
- Cited sources, if the assistant shows them: the URL and, where visible, the page title and the order in which sources appear.
- Extracted values, kept in separate columns from the raw text: brands mentioned, the position of each, and any notes on accuracy.
- Notes, for anything odd: an error message, a refusal, a truncated answer, a request for clarification.
A screenshot is a useful backup for manual runs, particularly for citation panels that are hard to copy. It is not a substitute for the text, because you cannot search or re-score an image.
Raw data versus scored data
Keep two layers and do not mix them.
- Raw layer. One row per run: conditions, prompt, full answer, sources. You write it once and do not edit it afterwards, except to fix a clear typo in a condition field.
- Scored layer. Values derived from the raw layer: mentions, position, accuracy label, sentiment label. You can regenerate this layer at any time.
This separation matters when your scoring rules change. Suppose you decide that "Acme" alone counts as a mention of Acme Analytics. If you stored only scores, the earlier runs are now inconsistent. If you stored raw text, you re-run the scoring on the text.
Choosing a file format
For a manual process, a spreadsheet is enough. For anything you plan to script, use a format that handles long text and nested values.
| Format | Strength | Weakness |
|---|---|---|
| Spreadsheet (one row per run) | Easy to filter, no setup | Long answers are awkward; cell text limits; easy to edit by accident |
| CSV | Opens anywhere, simple to load in Python | Multi-line answers need correct quoting; no nested lists |
| JSON Lines (one JSON object per line) | Handles long text, lists of sources, and nested fields; easy to append | Less friendly for non-technical colleagues |
A practical pattern is to store raw records as JSON Lines and export a flat CSV for reading and charting. Whatever you choose, use one row (or one object) per run, never one row per prompt, so repeated runs stay separate.
A record schema
Here is a raw record as one JSON object. The structure is the same whether you fill it by hand or by script.
{
"run_id": "2026-11-29-assistantA-disc-01-r2",
"timestamp": "2026-11-29T10:16:00Z",
"assistant": "AssistantA",
"model_label": "not shown",
"mode": "web_search_on",
"account_state": "signed_out_memory_off",
"location": "UK",
"language": "en",
"conversation": "new_chat",
"prompt_id": "disc-01",
"prompt_text": "What are the best web analytics tools for a small online shop?",
"run_number": 2,
"answer_text": "For a small shop, consider Example BI or Acme Analytics...",
"sources": [
{"rank": 1, "url": "https://example.com/best-analytics-tools", "title": "Best analytics tools"}
],
"notes": ""
}Use consistent values for categorical fields. If one row says "web search on" and another says "search enabled", filters will split them into two groups. Pick a short fixed vocabulary, such as web_search_on, web_search_off, and write it down in your protocol document.
Appending records with a script
Even if you collect answers by hand, you can paste them into a small script that validates the fields and appends one line per run. This catches missing conditions at the moment you record them, when you still remember the answer.
import json
from datetime import datetime, timezone
REQUIRED = [
"assistant", "model_label", "mode", "account_state",
"location", "language", "conversation",
"prompt_id", "prompt_text", "run_number", "answer_text",
]
def make_record(**fields) -> dict:
"""Build a raw record, rejecting runs with missing or empty condition fields."""
missing = [k for k in REQUIRED if fields.get(k) in (None, "")]
if missing:
raise ValueError(f"Missing fields: {', '.join(missing)}")
now = datetime.now(timezone.utc).replace(microsecond=0)
fields.setdefault("sources", [])
fields.setdefault("notes", "")
fields["timestamp"] = now.isoformat().replace("+00:00", "Z")
fields["run_id"] = (
f"{now:%Y-%m-%d}-{fields['assistant']}-{fields['prompt_id']}-r{fields['run_number']}"
)
return fields
def append_record(path: str, record: dict) -> None:
"""Append one record as a single JSON line."""
with open(path, "a", encoding="utf-8") as f:
f.write(json.dumps(record, ensure_ascii=False) + "\n")
record = make_record(
assistant="AssistantA",
model_label="not shown",
mode="web_search_on",
account_state="signed_out_memory_off",
location="UK",
language="en",
conversation="new_chat",
prompt_id="disc-01",
prompt_text="What are the best web analytics tools for a small online shop?",
run_number=2,
answer_text="For a small shop, consider Example BI or Acme Analytics.",
sources=[{"rank": 1, "url": "https://example.com/best-analytics-tools", "title": "Best analytics tools"}],
)
append_record("raw_runs.jsonl", record)
print(record["run_id"])The script uses "not shown" as a legitimate value for model_label, so it forces you to make an explicit choice instead of leaving the field blank.
Recording sources
Citations are the most fragile part of a record. Link lists change order, links may be redirects, and some assistants show sources only after you click a panel. Follow these habits:
- Copy the URL exactly as shown. Do not shorten it or remove tracking parameters in the raw layer. Normalize URLs later in the scored layer, for example by stripping parameters and the leading
www.. - Record the order. The first source listed is often treated differently from the fifth, and the order may matter in later analysis.
- Record when there are no sources. An empty list means "the assistant showed none", which is different from "I forgot to look". Add a note such as "no citations shown" for the second case to be distinguishable.
- Distinguish a source listed in the panel from a link written inside the answer text. Add a field such as
source_kindif you need to.
Handling unusual outcomes
Some runs do not produce a normal answer. Record them as runs anyway, with a status field, so the denominator in your rates stays honest.
- Refusal or safety message. Save the text. Mark
status: "refused". - Error or timeout. Mark
status: "error"and retry under the same conditions. Keep both records, linked by the samerun_numberand a note. - Clarifying question instead of an answer. Save it and mark
status: "clarification". Decide in your protocol whether to reply once with a fixed response or to count it as a non-answer. - Truncated answer. Mark
status: "truncated". - Different language or region result. Keep it, and record the actual language if it differs from the one you intended.
If you silently drop failed runs, your mention rate looks better or worse than it is, depending on which runs fail. Decide the treatment in advance and apply it every time.
Storage, privacy, and naming
- File naming. Use one file per test batch with the date and assistant in the name, for example
2026-11-29_assistantA_batch.jsonl, or one growing file with abatch_idfield. Either works if you stay consistent. - Versioning. Keep the prompt set file under version control or with a version number, and store its version in each record. A changed prompt text with the same
prompt_idwill otherwise corrupt comparisons. - Personal data. Do not test with prompts that contain customer details, and do not save account names or private conversation history in the log. A "signed out" session avoids most of this.
- Terms of service. Check each assistant's terms before scripting access or storing outputs at scale. Manual testing and approved programmatic interfaces are different cases.
A recording checklist
- Open a fresh session in the planned mode and account state.
- Confirm and write down the conditions before pasting the prompt.
- Paste the prompt exactly as it appears in the prompt set.
- Copy the full answer and the sources, in order.
- Note the status and anything unusual.
- Save the record before starting the next run.
- Do the repeats as separate new chats, not as follow-ups in the same chat.
Common errors
- Recording only a score and not the text.
- Storing one row per prompt and overwriting earlier runs with later ones.
- Leaving the timezone out of the timestamp.
- Mixing runs with web search on and off in one comparison without a mode column.
- Reusing a
prompt_idafter rewording the prompt. - Counting failed or refused runs as zero mentions without marking them.
- Continuing in the same chat for repeats, so earlier answers influence later ones.
Exercise
A colleague's spreadsheet has one row per prompt with columns "prompt", "mentioned? (yes/no)", and "date". She ran each prompt five times and entered "yes" if the brand appeared in any run. List three problems with this record and say what you would change.
Show answer
(1) Information is lost: "any run" turns five outcomes into one yes, so you cannot compute a mention rate, which is the figure the variability chapter says to report. Store one row per run and compute the rate from them. (2) The answer text and sources are not saved, so the yes cannot be checked or re-scored. Add the full answer text and ordered sources as raw fields. (3) Test conditions are missing: assistant, mode, account state, location, model label, and conversation state, so a later change cannot be traced to a change in settings or in visibility. Add those columns, use a fixed vocabulary for them, and include a timezone in the timestamp. A good answer may also add a status column for refused or failed runs and a prompt-set version field.
Exercise
You re-run a prompt and the assistant replies with "Could you tell me more about your shop?" instead of answering. What do you record, and why not just skip the run?
Show answer
Record it as a run with the full text saved and status "clarification" (or whatever status your protocol defines), and apply the protocol's rule for it, such as sending one fixed reply or counting it as a non-answer. Skipping it removes a run from the denominator, which can inflate or deflate the mention rate depending on which runs fail. The saved record also shows that this prompt tends to trigger questions, which may mean the prompt needs rewording in a new prompt-set version.