Skip to content

Update module 4 demo 4#40

Draft
hansmbakker wants to merge 1 commit into
mainfrom
feature/hb/module-04-demo-04
Draft

Update module 4 demo 4#40
hansmbakker wants to merge 1 commit into
mainfrom
feature/hb/module-04-demo-04

Conversation

@hansmbakker

@hansmbakker hansmbakker commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator

Fixes #33

⚠️ Warning the old approach of having a shared ChatHistory object does not exist in Agent Framework
AgentSession is agent-specific and cannot be shared cross-agents.

Options are to

@roycornelissen this needs some discussion

@hansmbakker hansmbakker linked an issue Feb 25, 2026 that may be closed by this pull request
@hansmbakker

Copy link
Copy Markdown
Collaborator Author

Note: in Agent Framework, the workflow functionality is meant to deal with multiple agents working together:

When to use agents vs workflows

@hansmbakker

hansmbakker commented Feb 27, 2026

Copy link
Copy Markdown
Collaborator Author

I created an issue at microsoft/agent-framework#4341 to ask for documentation on Human-in-the-Loop, RequestInfoEvent / RequestPort and their compatibility with AgentWorkflowBuilder orchestrations

@roycornelissen

Copy link
Copy Markdown
Member

@hansmbakker should we keep this one open until you get the requested documentation?

@hansmbakker

Copy link
Copy Markdown
Collaborator Author

@hansmbakker should we keep this one open until you get the requested documentation?

Yes, let's do that. However if we decide we need to use workflows, then it would make sense to create a separate module out of lab 4 and lab 5 that is dedicated to workflows.

Optionally, we could keep the simplified version I created in db6dc75 but that is really a workaround. I think that's not the way how it should be done in Agent Framework.

Console.WriteLine("******** Create the hotel agent ***********");
var hotelAgent = HotelBookingAgent.CreateChatCompletionAgent(chatClient);
Console.WriteLine("******** Create the ride agent ***********");
var rideAgent = CreateTransportationAgent();
var hotelSession = await hotelAgent.CreateSessionAsync();
await RunUntilGoalReached(hotelAgent, [userMessage], hotelSession);
var provider = hotelAgent.GetService<InMemoryChatHistoryProvider>();
List<ChatMessage>? messages = provider?.GetMessages(hotelSession);
Console.WriteLine("******** hotel agent done ***********");
var rideSession = await rideAgent.CreateSessionAsync();
await RunUntilGoalReached(rideAgent, messages, rideSession);

@hansmbakker

Copy link
Copy Markdown
Collaborator Author

https://devblogs.microsoft.com/agent-framework/a-tour-of-handoff-orchestration-pattern/ is a nice article that goes into this. It explains that the Sequential Workflow is not a great option because it has no way to ask for clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate demo 4 for module 4

2 participants