Seeing more chatter about building managed Claude agents hosted 24/7 for clients. Ran into a reliability wall early on with this model.
The problem 🚧: If your agent holds its conversational state in-process, any server restart or deployment instantly gives it amnesia. Hosting on simple infrastructure means frequent process cycles. Tying agent memory to the server process lifetime is a fatal flaw for any serious "Agent-as-a-Service" offer.
The fix is a simple orchestration pattern: decouple the agent's brain from its body. We shifted all conversational state management to an external Redis instance. 💾 The agent process itself is now stateless. After each turn, it serializes the conversation state and writes it to the key-value store. When a new request comes in for that session, it re-hydrates its state from Redis before processing the turn.
The result is a far more durable system. We can push code updates, handle crashes, or even scale horizontally without dropping a single client conversation. ✅ It’s the minimum requirement for making these managed agents production-ready.
💡 So here's the debate...
What's your go-to for external agent state management: Redis, Postgres, or something lighter for simple agents?