learning-it by example

Back to the video

Event-Driven AI Agents: Queues, Crashes and Duplicates

After a crash, my toy agent wrote two replies to the same ticket. The agent was fine.

Video #238 ยท Enterprise architecture and AI agents

Steps in the video

  1. 0:00 My toy agent replied twice to the same ticket, after a crash
  2. 0:29 The idea
  3. 1:06 Setup
  4. 1:32 A log with positions
  5. 1:59 The agent
  6. 2:34 Crash and restart
  7. 3:36 What this does not show
  8. 4:12 Mistakes to avoid
  9. 4:41 My take and next steps
  10. 5:08 Recap

Files

  • compare.py (23 lines)
  • consumer.py (31 lines)
  • log.py (28 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

One consumer and one faked crash in one process; Redis was not run and consumer groups were not built; the duplicate check works only because the reply is stored next to the log; SQLite is for one machine.

Sources

Learning IT by Example.