Urgent.News

What's breaking now, across thousands of outlets.

AI

Show "can't verify" instead of a wrong number: handling declines in an AI data app

Your AI app answers a question about your data. The answer sounds right, the number looks plausible, and nothing errors. A week later someone in finance notices it was wrong. The fix most teams reach for is a better prompt. The fix that actually protects users is simpler: when the system can't back an answer, it should say so, and your app should show that clearly instead of a number. This post…

When an AI data application attempts to answer a user's query, it provides a response that appears correct and plausible. However, a week later, a finance team member may discover the answer is inaccurate. The recommended solution is not to adjust the prompt but to implement a simpler approach. If the system cannot back up its answer, it should clearly indicate that it cannot verify the information.

This post explains how to implement this solution using Python and Node, utilizing FactQL. FactQL first runs the query before providing an answer. When it successfully returns results, the output includes the query executed, the data rows, and a clear explanation. For instance, when asking about the total revenue by region, the system returns an explanation stating that the North region leads with $43,148, followed by the South region with $41,223.

However, when the system cannot fulfill the query, it declines instead of guessing the answer. This decline status is still an HTTP 200 response, but it includes a decline_reason indicating why the system couldn't provide a safe SQL query. The explanation in this case reads, "I couldn't find data that answers this. Try naming the table or column you mean."

An important aspect is that the error handling code must check the result field before displaying any numbers. If a decline occurs, the explanation should be shown to the user, written in a way that they can understand and act upon. The solution advises against retrying the same question since it will likely receive the same incorrect answer.

Instead, retries should only be made for HTTP 429 (too many requests), 500, and 503 (server errors), after a Retry-After delay.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

Memory Lab: Can an AI Broker Remember What Clients Really Want?

Memory Lab: Can an AI Broker Remember What Clients Really Want? Built for the Hindsight Hackathon, with persistent agent memory.

  • Kumar's Notebook AI prototype logs client reactions to properties.
  • AI narrows property suggestions based on client rejections.
  • System could reduce search time by learning from past interactions.

# Connecting Signal with AI Agents: My Open-Source Contribution to Switch

I have been spending time contributing to Switch, an open-source project that connects AI agents with messaging platforms.

  • Signal support integrated into Switch, enabling AI agents to communicate via Signal.
  • Integration uses JSON-RPC 2.0 flow between Switch and Signal daemon via Server-Sent Events (SSE).

Demystifying Claude Skills: How to Automate Your Workflows in Claude

If you find yourself repeatedly typing similar prompts into Claude—whether you are drafting client proposals, formatting invoices, or summarizing customer inquiries—you are doing far more manual work…

  • Claude Skills automate specific tasks within Claude environment.
  • Enable Code Execution and File Creation in Claude Desktop settings.
  • Custom skills like Daily Briefing can be created using Skill Creator.

More from Saturday 7 November →