Skip to content
Back to projects
DraftWiseAug 2025

Reliability for Production AI Agents

Cut critical AI agent errors by 90% and kept the product running through an LLM provider outage with error monitoring, smart retries, multi-vendor fallback, and alerting.

90% fewer critical agent errors, with failover from provider A to provider B

Context: DraftWise (Legal Tech, YC S20)

Problem

The AI agents had no resilience built in: no retries, no connection reuse, and no fallback. Every request depended on a single LLM vendor, so any provider hiccup reached users directly as a failure. Errors weren't categorized either, so the team couldn't tell which failures mattered most.

Approach

  • Measure first. I set up full error monitoring in LangSmith, grouped failures by error type, and ranked them by severity and product impact. That ranking decided what to fix first.
  • Shorter feedback loop. Errors and bugs now surface with enough context that issues move from customer report to product and engineering much faster.
  • Retries with jitter, on retryable errors only. Rate limits and transient failures are retried with backoff and jitter. Non-retryable errors fail fast instead of wasting tokens and latency.
  • Connection reuse across requests instead of a new connection per call.
  • Multi-vendor fallback through LiteLLM, which removed the single point of failure on one LLM provider.
  • Slack alerting so the team hears about error spikes before customers do.
LLM providers AI agent LLM request LiteLLM router Retry with jitter (retryable only) Fail fast on non-retryable Reuse connections Primary provider default route Fallback provider different vendor LangSmith errors traced, typed, ranked Slack alerts on error-rate spikes on outage traces + errors
Request path: retries and failover in the LiteLLM router, with errors traced in LangSmith and alerted in Slack

Impact

  • 90% reduction in the critical error rate.
  • During a major outage at one LLM provider, traffic failed over automatically with no noticeable impact on users, so the outage never became ours.
  • Error spikes now reach the team in Slack before customers report them.

Stack

LangSmith · LiteLLM · OpenTelemetry · Python · Slack