autogen icon indicating copy to clipboard operation
autogen copied to clipboard

Reentrant human input

Open tkellogg opened this issue 2 years ago • 5 comments

Hi,

I'm looking at the code for the first time, and I'm trying to understand how to involve a human. Looking at the conversable_agent, here's the default implementation:

def get_human_input(self, prompt: str) -> str:
        reply = input(prompt)
        return reply

What if the human is an HTTP response away? What if they're an SMTP relay away? Slack message?

Whenever the human is somewhere else on the network, it seems like I need to keep the autogen process alive. If they take 1 day to respond, that's not ideal, that's a long time to keep an idle process running. How are you planning on dealing with such a scenario?

tkellogg avatar Oct 06 '23 01:10 tkellogg

Yep, I had the same observation. For real-world usage, e.g., in a business applications scenario, we need some kind of a workflow engine in addition to the agent system.

ChristianWeyer avatar Oct 06 '23 06:10 ChristianWeyer

If the architecture here doesn't support something like this, one way I would (will probably) approach it is to run autogen in some sort of lightweight VM, like firecracker, and when autogen signals that it's idle, pause the whole VM and save it for later reentrance.

tkellogg avatar Oct 06 '23 10:10 tkellogg

I agree with the need to support reentrance or similar. In the two-agent scenario, we've worked around it in stateless environments (e.g., a http), by repopulating the histories, running without human intervention, and controlling the number of steps taken for each request.

afourney avatar Oct 06 '23 17:10 afourney

@victordibia @gagb for awareness I've seen many similar questions, and some doc or FAQ will be helpful.

sonichi avatar Oct 22 '23 16:10 sonichi

Is there a plan for this feature in the current roadmap @sonichi ?

ChristianWeyer avatar May 30 '24 10:05 ChristianWeyer

There are patterns for this in the cookbook. 0.4 has a different model and enables this easily. closing. please reopen with a specific proposal if desired.

rysweet avatar Oct 12 '24 02:10 rysweet

There are patterns for this in the cookbook.

Unfortunately couldn't find any: https://microsoft.github.io/autogen/dev//user-guide/core-user-guide/cookbook/index.html Am I looking in the right place?

attilavetesi-epam avatar Nov 18 '24 17:11 attilavetesi-epam

@attilavetesi-epam

What you are looking for is slow human input.

Core Sample: python/packages/autogen-core/samples/slow_human_in_loop.py AgentChat also supports human/application input in the outer loop: https://microsoft.github.io/autogen/dev/user-guide/agentchat-user-guide/tutorial/teams.html#running-team

ekzhu avatar Nov 19 '24 05:11 ekzhu