Hacker News new | ask | show | jobs
by anupsingh123 233 days ago
I've been building an AI coding agent platform and kept running into this annoying problem: agents would get halfway through a task, hit an error or get interrupted, and completely lose context. They'd either start over from scratch or create duplicate files because they forgot what they already did.

Tried the usual approaches - longer context windows, better prompts, chat history - but none of it worked reliably. The fundamental issue is that LLM agents are stateless by nature.

So I built a state machine that persists everything to DynamoDB: - Which development phase we're in (requirements → frontend → backend → etc) - Granular todos within each phase - What's been completed vs what's pending - Sandbox state (E2B sandboxes can die/restart) - S3 code sync status

Now when something goes wrong (and it always does), the agent just resumes from the exact todo it was working on. No context loss, no duplicate work.