Blue-green is a well-understood deploy pattern for stateless services. For an AI app with a vector index, warm embedding caches, and 40-minute-long agent sessions, the textbook version does not work. Here is what we do instead.
The problem
A clean cut-over works if state is shared. Sessions aren't; they live in the process. Indexes can be shared, but the warm caches in front of them are per-instance. Cut the traffic and you get cold caches, long-tail latency, and angry users.
State plane vs. service plane
We split everything into "data plane" (vector index, conversation history, embeddings) and "service plane" (the agent runtime). The data plane stays put across deploys. The service plane swaps. Both versions read from the same data plane.
Session migration
Active sessions stick to the version that started them. New sessions go to the new version. We bleed off the old version as sessions finish naturally; if any are still alive after the migration window, we serialize them and resume them on the new version with a recovery prompt that explains the handoff.
Warming the new version
Cold deploys are the source of most "production is slow" incidents we have seen on these systems. Pre-warming is the fix.
Before any production traffic hits the new version, we replay the last 30 minutes of representative queries against it. This warms the embedding caches and surfaces any regression that only appears under realistic load.
Rolling back
The old version stays running for an hour after cutover, idle. If anything looks wrong, traffic returns to it instantly. After the hour, it gets shut down. The redundant cost for an hour is worth never having to do an emergency rebuild.