SShortSingh.
Back to feed

How One Developer Built an LLM Support Agent That Fails Safely Every Time

0
·1 views

A developer documenting an experiment in building an LLM-powered customer support agent has outlined four key failure modes and the code designed to handle each one. The system uses database-level scoped lookups to neutralise hallucinated order IDs the same way it blocks unauthorised access, treating both as equally invalid. A confidence threshold on search results ensures the agent declines to answer rather than returning a misleading but technically retrieved response. A circuit breaker pattern handles third-party carrier API outages by delivering a specific fallback message, deliberately kept distinct from access-denial messages to avoid confusing customers. When the primary AI classifier fails, a deterministic keyword fallback takes over, refusing anything it cannot confidently interpret rather than guessing.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Why Distributed Systems Are Hard: Space, Time, and Consensus Explained

Distributed systems arise when multiple machines must cooperate to complete a single task, and that requirement strips away the shared memory, unified clock, and single lock that a solo machine provides for free. The core difficulties trace back to three root problems: space, meaning no single node holds the complete picture; time, meaning there is no global clock and networks reorder messages unpredictably; and consensus, which emerges when the first two problems collide. Replication strategies such as single-leader, multi-leader, and leaderless designs each resolve the write-conflict problem differently but introduce their own failure modes, while partitioning by key range or hash creates further trade-offs between write balance and query efficiency. Because there is no reliable wall clock across machines, engineers use logical and vector clocks to track causality rather than absolute time, though vector clocks grow costly at scale. These compounding challenges explain why distributed systems offer a spectrum of consistency models — from strict linearizability to eventual consistency — each trading correctness guarantees for performance or availability.

0
ProgrammingDEV Community ·

How a 4TB-to-500GB table join triggered a $4,000/hour cloud bill and outage

A data engineering team incurred roughly $4,000 in a single hour after a production join between a 4TB events table and a 500GB user_metadata table caused out-of-memory failures on both BigQuery and Databricks. The query had completed in 42 seconds on a 10% staging sample but hung for 45 minutes in production, spiking BigQuery slot usage above 10,000 and crashing a Databricks SQL Warehouse with a Java heap error. The root cause was each engine attempting a broadcast join on a table far too large to fit in a single worker's memory, compounded by a Databricks configuration that had raised the auto-broadcast threshold to 1GB from its 10MB default. The team resolved the BigQuery issue by rewriting the query to select specific columns and pre-filter join keys, cutting shuffle volume from 12TB to 800GB. On Databricks, they overrode the optimizer with a MERGE hint to force a Shuffle Sort-Merge Join, which spilled to disk rather than crashing, completing the query in 12 minutes.

0
ProgrammingDEV Community ·

Hyperiux Vault CLI Lets Developers Add Cursor Effects to Next.js Projects

Hyperiux Vault is a source-first tool that installs creative UI effects, such as cursor interactions, scroll animations, and page transitions, directly into React and Next.js projects via a CLI. Rather than importing from a runtime package, the CLI copies effect source files into the developer's own codebase, giving full control over customization and implementation. The tool supports Next.js 14 and 15, React 18+, Tailwind CSS v3 and v4, and works with both App Router and Pages Router setups. A tutorial walkthrough demonstrates installing the GSAP-powered Phantom Image Trail cursor effect, covering initialization, file inspection, rendering, and accessibility adjustments. Because the source lives in the project repository, developers take on responsibility for ongoing maintenance, upgrades, and performance of the installed effects.

0
ProgrammingHacker News ·

Houthis Seize Strategic Island Along Major Global Shipping Lane

Yemen's Houthi forces have reportedly taken control of a key island situated along a critical global shipping route. The seizure raises concerns about potential disruptions to international maritime trade passing through the area. The Houthis, an Iran-aligned armed group based in Yemen, have previously targeted commercial vessels in nearby waters. Control of such a strategically located island could give the group greater leverage over shipping movements in the region.