Where/how do you persist your agent's state while it waits on a human?
retained text
I've been building agents for a couple years, and I always hit this architectural decision: where do I run the compute for the agent loop, and what happens to that compute (and its state) when the agent needs to go idle, such as when waiting on a tool approval? What I've tried: 1. Keep the agent's compute running, just blocked on the decision. Super easy, but you pay for idle compute, and a deploy/crash/fault in that window loses the turn. 2. Save the framework's own snapshot (e.g. a LangGraph checkpoint, an OpenAI Agents RunState) and restore it later. Works, but it's a second copy of the conversation. Things get weird when implementing clients fetching conversation history - should they fetch old messages from that snapshot or from e.g. Postgres? 3. Persist only the transcript (messages, tool calls, results), stop the agent completely, and rebuild its state from the transcript when needed. One source of truth can provide frontends with conversation history, durability for your agents, and scaling to zero when idle. 3 is what I kept coming back to, but rebuilding it for every project and agent framework got old, so I built it at the platform level: Sectr hosts the agent, persists all agent transcript events, and handles the pause and resume for any framework. Link in the comments. It was definitely interesting to build. Main challenge is that the rebuilt request has to match the original exactly. Example bug: we once replayed text plus a tool call as two separate messages: the agent still worked, but it broke prompt caching. How long do your approvals actually sit, and how do you handle this design challenge?
document fetched 2026-10-28 00:19 · canonical https://reddit.com/r/AI_Agents/comments/1xgsysd/wherehow_do_you_persist_your_agents_state_while