How microsoft/voice-agent works
This repository is a community hub whose runnable product code centers on a browser-based Voice Agent studio and local bridge to Azure Foundry; it also contains standalone MCP tool-server samples and a voice-agent cost calculator. The principal workflow is selecting/configuring an agent in the studio, starting a browser voice session through the bridge, and exchanging realtime events with the Foundry voice endpoint. The graph also preserves handoff, session recording, MCP examples, and cost estimation. Relationships are limited to those shown by the excerpts, SOURCE INDEX references, or README; unsampled wiring is omitted.
Main entry points: useVoiceSession.js Voice session hook · App.jsx Studio app · demo_server.py Portal bridge · server.py MCP host
Components 23
Portal studio
- Studio app
portal/web/src/App.jsx - Agent configuration
portal/web/src/components/ConfigControls.jsx - Agent review
portal/web/src/components/ReviewPanel.jsx - Handoff graph
portal/web/src/components/HandoffGraphPanel.jsx
Voice runtime
- Voice session hook
portal/web/src/hooks/useVoiceSession.js - Turn metrics
portal/web/src/lib/turnMetrics.mjs - Client functions
portal/web/src/lib/clientFunctions.mjs - Handoff editor
portal/static/handoff/handoff-core.mjs - Portal bridge
portal/demo_server.py - Voice policy
portal/voice_policy.py - Session recording
portal/session_log.py
MCP samples
- MCP host
shared_mcp/app/shared_mcp/server.py - Conference tools
shared_mcp/app/shared_mcp/conference/service.py - Elevator tools
shared_mcp/app/shared_mcp/elevator_service/service.py - Elevator state
shared_mcp/app/shared_mcp/elevator_service/store.py - Finance handoff
shared_mcp/app/shared_mcp/finance_handoff/service.py - Finance data
shared_mcp/app/shared_mcp/finance_handoff/data.py - OTP officer
shared_mcp/app/shared_mcp/finance_otp_officer/service.py - Mock tool service
shared_mcp/app/shared_mcp/mock_tool_call/service.py
Standalone utility
- Cost calculator UI
tools/cost_calculator/app.mjs - Cost calculation
tools/cost_calculator/calculator.mjs
Other components
- Builder / caller
- Foundry voice service
Connections 21
- Builder / caller → Studio app: configures agent
README.md - Studio app → Agent configuration: renders
portal/web/src/App.jsx - Studio app → Agent review: renders
portal/web/src/components/ReviewPanel.jsx - Studio app → Handoff graph: renders
portal/web/src/App.jsx - Studio app → Voice session hook: starts session
portal/web/src/App.jsx - Voice session hook → Turn metrics: records tool calls
portal/web/src/hooks/useVoiceSession.js - Voice session hook → Client functions: resolves arguments
portal/web/src/hooks/useVoiceSession.js - Handoff graph → Handoff editor: uses editor core
- Voice session hook → Portal bridge: opens voice connection
portal/web/src/hooks/useVoiceSession.js - Portal bridge → Foundry voice service: proxies requests
portal/demo_server.py - Foundry voice service → Voice session hook: streams voice events
portal/web/src/hooks/useVoiceSession.js - Portal bridge → Voice policy: applies policy
portal/demo_server.py - Portal bridge → Session recording: records session events
portal/demo_server.py - Builder / caller → Voice session hook: speaks to agent
README.md - MCP host → Elevator tools: routes tools
shared_mcp/app/shared_mcp/server.py - MCP host → Finance handoff: routes tools
shared_mcp/app/shared_mcp/server.py - MCP host → OTP officer: routes tools
shared_mcp/app/shared_mcp/server.py - Elevator tools → Elevator state: reads and writes
shared_mcp/app/shared_mcp/elevator_service/service.py - Finance handoff → Finance data: uses data
shared_mcp/app/shared_mcp/finance_handoff/service.py - Builder / caller → Cost calculator UI: estimates costs
tools/cost_calculator/app.mjs - Cost calculator UI → Cost calculation: gets rates
tools/cost_calculator/app.mjs