learning-it by example

Back to the video

Where Should AI Agent State and Memory Live? A Crash Test

I killed my agent in the middle of a write, then reloaded its memory. Three kinds of memory behaved in three different ways.

Video #237 ยท Enterprise architecture and AI agents

Steps in the video

  1. 0:00 My agent crashed, and one kind of memory could not even be read
  2. 0:31 The idea
  3. 1:10 Setup
  4. 1:40 Three stores
  5. 2:11 Crash in step six
  6. 2:38 Two agents, one store
  7. 3:41 What this does not show
  8. 4:14 Mistakes to avoid
  9. 4:41 My take and next steps
  10. 5:13 Recap

Files

  • compare.py (38 lines)
  • stores.py (56 lines)
  • worker.py (9 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

A staged crash and an arranged collision on one laptop; the half-written JSON file is written that way on purpose; an atomic rename was not tested; Redis and server databases were not tested; the stores hold plain text only.

Sources

Learning IT by Example.