Host an AI agent like any other application.
A chat built with the AI SDK deploys with the same command. Answers stream for as long as the model needs, work goes on after the answer, and a dropped connection picks up where it left off.
Agent hosting// app/api/chat/route.ts
const result = streamText({ model, messages, tools });
return createUIMessageStreamResponse({
keepAliveMs: 15_000,
stream: toUIMessageStream({ stream: result.stream }),
});

