tfpdev
04 / 09Part 1 · Citations

Cite or Decline

The AI says which file each fact came from. The page checks every number against that file, live. And when the files don't say, the right answer is “I don't know”.

01Step 1

Try it

Ask a question. The AI says which file each fact came from. Then the page checks every number against that file. Click a sentence to see where it came from.

 
The answer, checked

Ask a question. Every number in the answer gets checked against the file it points to.

The five files it read 

    It can only check numbers, dates and codes. A sentence without one isn't checked. A number that's in no file isn't always made up: sometimes the AI did the maths.

    02Step 2

    I checked all of them

    The same check, run over every saved test answer from two versions of the bot.

     Numbers checkedCheck outWrong fileNot in the filesNo source given
    Quick version65 answers7674 (97%)023
    Careful version59 answers, 6 left out107105 (98%)201
    Wrong fileCareful version
    How fast do you reply on the Studio plan?
    “On the Studio plan, Northwind gives a first reply the same working day, and this has applied since 1 January 2026.” [1][2]

    1 January 2026 is really in [3][4]

    Wrong fileCareful version
    Was the Studio plan going to cost €6,200 in 2026?
    “The October 2025 draft proposed €6,200 a month for Studio, but that draft was rejected on 4 November 2025.” [2][3]

    4 November 2025 is really in [1]

    Not in the filesQuick version
    What's the discount if we pay the retainer for a year up front?
    “The 15% figure from the 2024 archived pricing list is no longer applicable.” [4]

    2024 is in no source

    Not in the filesQuick version
    How much would the Partner plan cost per year if paid in advance?
    “The Partner plan is €11,200 per month in the current reference matrix, which would be €134,400 per year before any prepayment discount.” [5]

    €134,400 is in no source

    No source givenQuick version
    How long do you hang on to our files once we stop working together?
    “Clause 14 governs how long files are kept, but the sources provided do not state the retention period itself.”

    14 is in [3]

    No source givenQuick version
    How long do you hang on to our files once we stop working together?
    “Source 3 says Figma access is removed 30 days after the engagement ends and that removal is not deletion of files.”

    30 is in [3]

    No source givenQuick version
    Wie viel kostet der Studio-Plan pro Monat?
    “Der Studio-Plan kostet laut dem aktuellen Preisblatt für 2026 einen bestimmten Betrag pro Monat, der in den Quellen jedoch nicht vollständig angegeben ist.”

    2026 is in [4]

    No source givenCareful version
    A rush was confirmed in writing on 25 February 2026 and delivered in March. Which rush fee applies?
    “The 25% rush fee applies.”

    25% is in [1][2][3][4][5]

    03Step 3

    When the answer isn't there

    Six questions the files don't answer. The right reply is “I don't know”. 4 of the 6 versions got all six.

    Question16/626/636/646/655/665/6
    Not in the filesu4

    Can we pay by credit card?

    The files don't say. The right answer is “I don't know”.

    Sections · both · second look · skip old
    The sources don't say whether Northwind accepts credit card payments, so I don't know based on the Northwind documents.
    Wrong by the rules: it did say it doesn't know, but not in the exact words the test checks for.
    1. 1Equal pieces · words
    2. 2Equal pieces · meaning
    3. 3Sections · meaning
    4. 4Sections · both
    5. 5Sections · both · second look
    6. 6Sections · both · second look · skip old
    04Step 4

    What actually mattered

    A source is something you can check

    105 of 107 numbers were really in the file the AI pointed to. The check is a few lines of code and costs nothing.

    The mistakes are small, and you can see them

    The right fact pointing at the wrong file, a number the AI calculated itself, a sentence with no source. Nothing invented, and all of it catchable.

    One fixed way to say “I don't know”

    A fixed sentence is easy to spot, so the app can replace it with “here's who to ask”. A vague “probably…” is where AI starts making things up.

    05Step 5

    The code

    What the two approaches do, in one sentence. The code is one click away.

    Most chat apps turn the AI's source numbers into links and stop there. This one checks every number against the file it points to before you see it.

    Show the code anyway
    BreaksBreaks
    Links that nobody checks.
    Answer.tsx · trust the bracketstsx
    {citeParts(answer).map((p, i) =>  "n" in p    ? <a key={i} href={`#source-${p.n}`}>[{p.n}]</a>    : <span key={i}>{p.text}</span>)}
    Turning [2] into a link looks like accountability. Nobody checks that source 2 says what the sentence says.
    HoldsHolds
    Every number matched against its source.
    lib/rag/cite.tsts
    export function checkCitations(answer: string, sources: CheckSource[]): Claim[] {  if (DECLINE.test(answer.trim())) return [];  return sentences(answer).map((sentence) => {    const cites = [...sentence.matchAll(/\[(\d+)\]/g)].map((m) => Number(m[1]));    const facts = [...strip(sentence).matchAll(FACT)].map(([value]) => ({      value,                                   // "€11,200", "40%", "NW-RET-L", "1 March 2026"      inCited: sources.filter((s) => cites.includes(s.n) && contains(s, value)).map((s) => s.n),      inOther: sources.filter((s) => !cites.includes(s.n) && contains(s, value)).map((s) => s.n),    }));    return { sentence, cites, facts, status: verdict(cites, facts) };  });}
    Split the answer into sentences, pull out everything that can be matched exactly, and look for it in the sources the sentence cites, then in the others. Free, instant, and it runs on every answer.
    06Step 6

    Still curious?

    A few more questions people ask. Open what you need.

    Why not have another AI check it?

    For numbers, a simple text match is free and can't be fooled. Another AI costs money on every answer and can be wrong too. It's worth it for claims without numbers, later.

    What do you do when a check fails?

    Never ignore it. Mark the sentence, remove it, or ask again. For prices, show the original text from the file instead.

    Why did the careful version get one wrong?

    It did say the files don't cover it, but not in the exact words the test checks for, and the rule is strict. The full answer is in the grid above.

    Why were some answers skipped?

    To check fairly, the search has to find the same files as when the answer was written. For a few questions it didn't, so they're left out.