Service recommendation for running/hosting agent loop

Posted by Unlikely_Secret_5018@reddit | ExperiencedDevs | View on Reddit | 4 comments

I have a Flask web app for small business owners to automate certain processes. I've integrated an LLM chat via calls to OpenAI using their agents SDK. The agent loop just runs in my web app currently, doing web search, reading context from the customer's uploaded data, and mainly just streams text back.

I'd like to add the ability for the agent to generate multi-page invoices and other documents for my users to give to their clients, which tend to take many minutes.

It seems like I'd need to move the agent loop out of my web app into a more robust worker service. But which one should I choose? It needs to:

  1. Support several agent loop instances generating documents for many users
  2. Be able to stream the initial response back to my Flask app (eg. "Ok, I'll generate that for you now...")

Advice appreciated, thanks.