Separate retrieval facts from calculated numbers
In this article (6 sections)
A retrieved document can establish how a business metric is defined. A calculation establishes its value for a particular dataset and period. An analytical assistant needs both forms of evidence, and it should not use a definition citation as proof of a number that the document never contained.
This distinction is central to reliable retrieval-assisted reporting. Finding the right paragraph does not mean the assistant has counted the right rows.
Follow two evidence paths
The original analyst AI lab contains a small versioned glossary and a deterministic source-row calculator. The glossary defines completed-order amount: sum the supplied amount once per eligible completed order, include unmatched customer records and keep amounts in paise.
The calculator applies that rule to January's synthetic orders and obtains 104,000 paise across eight orders. The glossary does not contain that total. It can support the definition, while the source rows and computation support the value.
Store a definition document ID and hash separately from source and calculation evidence. A report should be able to answer both “Which rule did you use?” and “Which records produced this number?”
Join definitions and calculations explicitly
from glossary import retrieve
from calculator import calculate
retrieved = retrieve('order amount',as_of='2026-01-31')
assert retrieved['status']=='found'
definition = retrieved['documents'][0]
assert definition['document_id']=='completed-orders-v1'
assert retrieved['calculated_value'] is None
evidence = calculate()
assert definition['metric_id']==evidence['metric_id']
assert evidence['value']==104000 and evidence['eligible_order_count']==8
answer_record = {
'definition_id':definition['document_id'],
'definition_sha256':retrieved['document_sha256'],
'source_sha256':evidence['source_sha256'],
'contract_sha256':evidence['contract_sha256'],
'value_paise':evidence['value'],
'order_ids':evidence['evidence_order_ids'],
}
assert len(answer_record['order_ids'])==8
print(answer_record)The hashes help identify exact versions. They do not establish that a definition was approved by a real organization or that an upstream extract is complete. Those require separate controls and evidence.
Avoid stale-definition arithmetic
The glossary deliberately includes an older policy that excluded orders lacking a matched customer. That historical rule differs from the current teaching contract. Applying it to the January fixture would lose O1009 and its 9,000 paise.
Both versions can look relevant in a search result. Effective dates and a clear metric identifier prevent the assistant from combining an old rule with a current label. When a request spans a policy change, decide whether to restate history under one rule or report the break explicitly; do not silently blend definitions.
This example uses exact-term retrieval over four local records. It is not a vector-search benchmark or a claim that all retrieval problems can be solved with a dictionary. Its purpose is to make the evidence boundary inspectable before adding more complex retrieval.
Treat prose and numeric provenance differently
A sentence such as “Unmatched customer orders are included” is supported by the current glossary definition. “The eligible amount is 104,000 paise” needs the calculation evidence. “The campaign increased the amount” needs evidence of a comparison and a causal design that this lab does not provide.
Splitting those claims prevents a valid citation from lending credibility to adjacent unsupported statements. Put citations or evidence references beside the specific claim they support.
If the calculator fails or the requested period is absent, the assistant can still explain the definition. It should say that the value is unavailable rather than copy a number from a previous answer or an unrelated document.
Review the complete chain
Check the selected definition, its effective period, the calculation contract, eligible row IDs and the resulting unit. Then review the narrative for conclusions that exceed those facts. Each link answers a different question; no single citation substitutes for the whole chain.
Exercise: retrieve the historical definition for December 2025. Explain why it must not automatically control a January 2026 report, even when its title matches the question exactly. Then remove the calculation result and write an appropriate partial answer that supplies the definition without inventing a total.
NeuraPath's Data Analytics with Generative AI course connects business definitions, source calculations and AI-assisted explanation. Keeping those responsibilities visible makes an analytical answer easier to audit and maintain.
Continue learning
This article is part of the Generative AI for verified analyst work sequence. Use the neighbouring tasks when you need the prerequisite or the next application.
- Review the prerequisite or neighbouring task in Catch denominator errors in AI-written business summaries.
- Continue with Design a read-only SQL tool for an analyst assistant.
Pankit Kumar has 10 years in Data Science & AI, building and shipping production systems in regulated pharma and clinical environments. He is a freelance trainer at Boston Institute of Analytics, AnalytixLabs and Scaler, and has taught this material to thousands of working professionals.
This article is part of our Data Analytics with Generative AI programme — 3–4 months. The full analyst stack — Excel, SQL, Power BI and Python pipelines — then a generative-AI layer you can prove is right.
Explore Data Analytics with Generative AI