Driving Stop-and-Go Business Processes to Closure with Foundry Hosted Agents
Summary
Microsoft Foundry Hosted Agents provide a solution for building stateful AI agents capable of managing long-running business processes, such as Statement of Work (SOW) response orchestration, which can span days or weeks. The core challenge of stateless agent loops is overcome by leveraging Foundry's per-project sandbox microVMs to persist agent state. This architecture ensures that the agent reconstructs its complete operational context from disk upon each wake-up, eliminating the need for external databases and keeping the client application thin. Built using the Microsoft Agent Framework (MAF) and integrating OpenAI models on Foundry, these agents connect to Microsoft 365 via WorkIQ MCP endpoints and offer turnkey OpenTelemetry tracing for comprehensive monitoring.
Key takeaway
For AI Architects designing agents for complex, multi-day business workflows, consider Microsoft Foundry Hosted Agents. This approach centralizes agent state within per-project microVMs, eliminating the need for external databases and enhancing data residency compliance. Your teams can achieve robust, scalable, and collaborative agent solutions, especially in regulated environments, by adopting this server-side state management pattern over local client-side alternatives.
Key insights
Foundry microVMs enable stateful AI agents for long-running business processes without external databases.
Principles
- Agent state lives in the sandbox, not the client.
- Reconstruct full agent context on every wake-up.
- Client remains thin, holding only session IDs.
Method
Mint a unique "agent_session_id" for each project, linking it to a dedicated microVM. Embed this ID in all requests to reattach the sandbox, and use "state_patch_json" for atomic state updates.
In practice
- Use "agent_session_id" to persist agent state.
- Implement "state_patch_json" for granular updates.
- Integrate OpenTelemetry for agent loop tracing.
Topics
- Foundry Hosted Agents
- Stateful AI
- MicroVMs
- Microsoft Agent Framework
- SOW Orchestration
- OpenTelemetry
- M365 Integration
Code references
Best for: AI Engineer, MLOps Engineer, AI Architect
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Microsoft Foundry Blog articles.