Skip to content
Sophie Yin
← All work

event-driven agent backbone

2026 · Shipped · Built at Alt · AWS SQS, Lambda, Terraform

case study

Problem

Agent workflows need to react to business events the moment they happen. Cron schedules and manual scripts can't do that — they poll, they miss, and when they fail mid-run there's no retry story, just a rerun and hope.

What it does

A shared event backbone: domain events (a quote created, an incident opened) are published to SQS, Lambda consumers fan out to the right agent workflow, and failures land in dead-letter queues with alerting instead of vanishing. The agentic selling product and the pricing triage system both run on it.

System

How an item gets priced — and what runs underneath. Click Triage to look inside.

LLM step

What runs it · dashed = failure → DLQ + alert

Triage infrastructureAn ML priced event lands on the triage SQS queue. A triage Lambda decides the route and enqueues it for execution workers, which apply the price, send it to the expert queue, or enqueue agent pricing on Airflow, which re-enqueues the result to triage. Each queue has a dead-letter queue, and each quote's triage run is traced in Langfuse.ACCEPTHUMANAGENTRE-ENQUEUED TO TRIAGE · PASS 2ML priced eventTRIGGERTriage queueSQSTriage LambdaDECIDES ROUTEExecution queueSQSExecution workersAPPLY DECISIONApply priceVALUATION WRITTENExpert queueMANUAL REVISIONAgent queueSQSAgent AirflowAGENT PRICING DAGDLQDLQDLQLANGFUSETriage infrastructureAn ML priced event lands on the triage SQS queue. A triage Lambda decides the route and enqueues it for execution workers, which apply the price, send it to the expert queue, or enqueue agent pricing on Airflow, which re-enqueues the result to triage. Each queue has a dead-letter queue, and each quote's triage run is traced in Langfuse.ACCEPTHUMANAGENTRE-ENQUEUED · PASS 2ML priced eventTRIGGERTriage queueSQSTriage LambdaDECIDES ROUTEExecution queueSQSExecution workersAPPLY DECISIONApply priceVALUATION WRITTENExpert queueMANUAL REVISIONAgent queueSQSAgent AirflowAGENT PRICING DAGDLQDLQDLQLANGFUSE
Accept · 01/05

The ML priced event is published to the triage SQS queue.

Architecture

  1. 01Domain event published
  2. 02SQS queue (per consumer)
  3. 03Lambda consumer invokes agent workflow
  4. 04Result events emitted downstream
  5. 05Failures → DLQ + alert

Stack

  • MessagingAWS SQS with dead-letter queues
  • ComputeLambda consumers
  • Infra as codeTerraform
  • ObservabilityDatadog monitoring + alerting, Langfuse LLM traces

Outcomes

  • One backbone powers multiple agentic products (selling, triage)
  • Per-event retries and DLQs replaced the crash-and-rerun cycle
  • Currently hardening: monitoring, alerting, and error-handling depth

Code is private — happy to walk through it.