Skip to content

Conversation

@lordlinus
Copy link

Real-Time Streaming Agents with Azure SignalR

Why is this change required?

Traditional agent implementations either:

  • Return entire responses at once (poor UX for long-running operations)
  • Require polling by clients to check for updates (inefficient and wasteful)
  • Broadcast to all users (no privacy/isolation)
  • Real-world agentic applications need live streaming updates and user isolation for a quality user experience. This sample demonstrates how to implement both using Azure SignalR Service with the Agent Framework's callback protocol.

What problem does it solve?

Streaming Response Problem: Users see responses appear in real-time as the agent generates them, instead of waiting for the entire response to complete.

User Isolation Problem: Multiple concurrent users can chat without seeing each other's conversations. Messages are delivered only to the specific conversation group, not broadcast to all connected clients.

Architecture Problem: Shows how to integrate Azure SignalR Service REST API with the Agent Framework's AgentResponseCallbackProtocol for production-grade real-time communication.

What scenario does it contribute to?

This sample enables several real-world use cases:

  • Multi-user Chat Applications: Multiple users can interact with agents simultaneously without interference
  • Live AI Dashboards: Real-time updates from long-running analysis agents (research, data processing, etc.)
  • Customer Service Bots: Live streaming responses give customers immediate feedback while agent thinks…al-time streaming of agent responses using Azure SignalR Service. Include a sample frontend as well

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • [] All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

…l-time streaming of agent responses using Azure SignalR Service. Include a sample frontend as well
Copilot AI review requested due to automatic review settings January 12, 2026 12:22
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Jan 12, 2026
@github-actions github-actions bot changed the title Add an azure function streaming example Python: Add an azure function streaming example Jan 12, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a comprehensive sample demonstrating real-time streaming of agent responses using Azure SignalR Service with the Agent Framework. The sample shows how to implement user isolation through SignalR groups, enabling multiple concurrent users to chat with agents without interference.

Changes:

  • Added a new Azure Functions sample (09_agent_streaming_signalr) implementing SignalR-based streaming
  • Created a custom SignalRServiceClient for REST API communication with Azure SignalR Service
  • Implemented SignalRCallback using AgentResponseCallbackProtocol for streaming updates
  • Included a web-based frontend with HTML/CSS/JavaScript for real-time chat interface
  • Added comprehensive documentation explaining the architecture and user isolation patterns

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
function_app.py Main Azure Functions application with SignalR client, callback implementation, and HTTP endpoints for negotiation, group management, and thread creation
tools.py Mock travel planning tools (weather forecast and local events) for agent demonstrations
requirements.txt Python dependencies including azure-functions, agent-framework-azurefunctions, azure-identity, and aiohttp
host.json Azure Functions host configuration with Durable Task settings
local.settings.json.template Configuration template for local development with Azure OpenAI and SignalR connection strings
content/index.html Complete web interface with SignalR JavaScript client, real-time message streaming, and conversation management
README.md Comprehensive documentation covering architecture, API endpoints, user isolation patterns, and setup instructions

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

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants