{
  "id": 10599479,
  "title": "How I fixed LLM counting hallucinations using Hindsight facts",
  "url": "https://urgent.news/2026/09/29/how-i-fixed-llm-counting-hallucinations-using-hindsight-facts",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-29T03:38:36.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sri_varsha_527/how-i-fixed-llm-counting-hallucinations-using-hindsight-facts-25n1"
  },
  "original_language": "en",
  "account": "A customer support memory agent was developed to streamline customer interactions across chat, email, and phone channels. When a support agent reported discrepancies in the number of customer contacts, it became apparent that a language model was being asked to count interactions, leading to inaccurate results. The issue stemmed from the model's difficulty in determining whether multiple messages referred to the same problem or not. To address this problem, the solution involved storing the interactions as structured facts and performing the counting in Python. This approach eliminated the need for the model to make judgement calls and provided an intermediate value that could be logged, tested, and verified. By retaining the facts in Hindsight, the agent could serve different purposes for the summarise and escalate endpoints, using the same history without the need for separate databases. This change eliminated the hallucinations caused by the model's counting and provided a more reliable method for determining if a customer had contacted the support team multiple times about the same unresolved issue.",
  "summary": "The first time my support agent told me a customer had contacted us \"twice\" when the record showed four separate contacts, I assumed I had a retrieval bug. I didn't. The memory was fine. I had asked a language model to count, and it did what language models do when you ask them to count: it produced a confident, plausible number. This is the story of how I stopped asking the model to count, and…",
  "key_points": [
    "Customer support memory agent developed to streamline interactions",
    "Language model struggled with counting interactions accurately",
    "Structured facts stored in Hindsight eliminated hallucinations"
  ],
  "editors_take": "Storing interactions as structured facts and counting in Python rather than relying on the language model eliminates hallucinations and provides a more reliable method for tracking customer support interactions.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}