live-voice-practice
AGENTS.md3 starsChanged 8 months agoMITView on GitHub
This repository contains a real-time AI-powered voice training platform for call-center and customer-service practice. It combines a React client, a Flask API/WebSocket backend, Azure Voice Live, Azure AI services, and Bicep infrastructure for public or network-isolated Azure deployments.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 261
Use azd provision when infrastructure changes require it.
- Distinctive: line 267
All implementations in this repository should follow clean code best practices.
- Distinctive: line 269
Keep each file focused on a clear responsibility.
- Distinctive: line 271
Prefer small, cohesive functions, React components, hooks, and services.
- Distinctive: line 272
Use clear names that explain intent without relying on excessive comments.
- Distinctive: line 274
Avoid duplication and speculative abstractions.
- Very specific: line 275
Keep backend route handlers thin and place domain logic in backend/src/services/.
- Very specific: line 276
Keep frontend screen components focused on composition.
- Distinctive: line 278
Prefer typed and explicit data contracts, especially across backend/frontend API boundaries.
- Distinctive: line 280
Add or update tests when behavior changes or when extracted logic becomes independently testable.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Live Voice Practice Platform
This repository contains a real-time AI-powered voice training platform for call-center and customer-service practice. It combines a React client, a Flask API/WebSocket backend, Azure Voice Live, Azure AI services, and Bicep infrastructure for public or network-isolated Azure deployments.
Key Features Implemented
Real-Time Voice Practice
- Browser-based practice sessions where trainees select a scenario and speak with an AI-powered customer.
- Backend WebSocket proxy at
/ws/voicethat bridges browser events with Azure Voice Live. - Real-time audio playback, transcript capture, and voice/avatar session handling in the frontend.
- WebRTC support for avatar media connection setup and diagnostics.
Scenario-Based Training
- Server-side scenario loading through
GET /api/scenarios. - Scenario definitions seeded from
samples/scenarios/. - Scenario prompts and runtime agent behavior managed in backend services.
- Graph-based scenario generation support using canned sample data in
data/.
Conversation Analysis and Feedback
- Post-session analysis through
POST /api/analyze. - Structured scoring and feedback generated by Azure OpenAI through Azure AI Foundry / Azure AI Services endpoints.
- Pronunciation assessment through Azure Speech.
- Reusable evaluation rubrics under
samples/rubrics/. - Sample transcripts and audio examples under
samples/transcripts/.
Conversation History and Trainer Views
- Optional Microsoft Entra ID sign-in.
- User-aware practice history through conversation APIs.
- Trainer-oriented "All Practices" views when authenticated user roles allow it.
Support Materials Search
- Optional Azure AI Search integration for support/training materials.
- Sample support documents under
samples/materials/. - Backend search service can enrich analysis with indexed supporting materials when configured.
Azure Deployment and Operations
- Azure Developer CLI (
azd) workflow wired through rootazure.yaml. - Bicep infrastructure under
infra/. - Basic public deployment mode for development and demos.
- Network-isolated deployment mode with private endpoints, private DNS, jumpbox/Bastion workflow, Azure Firewall, and optional Application Gateway WAF v2 public ingress.
- Post-provision and post-deploy scripts for data seeding, configuration, and smoke validation.
Technology Stack
Backend
- Python: Backend application language.
- Flask 3.1.3: HTTP API and static frontend hosting.
- Flask-Sock 0.7.0: WebSocket endpoint support.
- Azure Voice Live SDK (
azure-ai-voicelive): Real-time voice session integration. - Azure AI Projects (
azure-ai-projects): Azure AI Foundry project integration. - OpenAI Python SDK 2.13.0: Azure OpenAI chat completion and embedding workflows.
- Azure Speech SDK (
azure-cognitiveservices-speech): Pronunciation assessment and speech-related capabilities. - Azure Cosmos DB SDK (
azure-cosmos): Scenario and conversation persistence. - Azure AI Search SDK (
azure-search-documents): Support materials retrieval. - Azure App Configuration SDK: Runtime configuration integration.
- Azure Identity: Managed identity and local Azure credential support.
- pytest, flake8, pylint, ruff, black, mypy: Backend testing, linting, formatting, and type-checking tools.
Frontend
- React 19: UI framework.
- TypeScript 5.9: Type-safe frontend development.
- Vite 7: Frontend build and development server.
- Fluent UI React v8 and v9: UI components and design tokens.
- ESLint 9 and Prettier 3: Frontend linting and formatting.
- Custom React hooks: Audio recording/playback, real-time WebSocket handling, WebRTC setup, scenarios, authentication, and conversation history.
Azure Services and Infrastructure
- Azure Container Apps: Hosts the combined app container.
- Azure Container Registry: Container image storage and, in isolated mode, VNet-integrated ACR Tasks builds.
- Azure AI Foundry / Azure AI Services: Model and project backing services for analysis and AI workflows.
- Azure Voice Live: Real-time AI voice conversation capability.
- Azure Speech: Speech and pronunciation assessment.
- Azure Cosmos DB: Scenario and conversation data store.
- Azure AI Search: Support materials indexing and retrieval.
- Azure Key Vault: Secret and certificate storage.
- Azure App Configuration: Runtime configuration publishing.
- Azure Storage: App and data storage needs.
- Log Analytics and Application Insights: Observability.
- Virtual Network, private endpoints, private DNS, Azure Firewall, Bastion, and optional Application Gateway WAF v2: Network-isolated deployment topology.
- Bicep: Infrastructure as Code.
- Azure Developer CLI (
azd): Provisioning and deployment orchestration. - Docker: Application containerization.
Project Structure
Root
.
|-- azure.yaml # Root azd project definition and deployment hooks
|-- main.parameters.json # Consumer overlay parameters copied into infra during preprovision
|-- manifest.json # Release/component metadata used by isolated jumpbox bootstrap
|-- Dockerfile # Application container build
|-- README.md # Project overview, architecture, deployment, and local dev guide
|-- CHANGELOG.md # Version history
|-- CONTRIBUTING.md # Contribution guidance
|-- LICENSE.md # MIT license
|-- SECURITY.md # Security policy
|-- SUPPORT.md # Support policy
|-- backend/ # Flask API, WebSocket proxy, and backend services
|-- frontend/ # React + TypeScript client
|-- infra/ # Azure Bicep landing zone submodule/infra core
|-- scripts/ # Build, deploy, provision, seed, and validation scripts
|-- samples/ # Scenarios, rubrics, transcripts, audio, and training materials
|-- data/ # Canned graph-style sample data
|-- docs/ # Architecture, deployment, runbooks, ADRs, and troubleshooting
|-- static/ # Built frontend assets served by FlaskBackend (backend/)
backend/
|-- requirements.txt # Runtime Python dependencies
|-- requirements-test.txt # Test/lint dependencies
|-- pyproject.toml # Formatting and lint configuration
|-- tests/ # Backend tests
|-- src/
|-- app.py # Flask app, API routes, static hosting, WebSocket registration
|-- config.py # Environment and runtime configuration
|-- services/
|-- analyzers.py # Conversation analysis and pronunciation assessment
|-- auth.py # User identity and auth helpers
|-- audio_store.py # Session audio storage helpers
|-- conversation_manager.py # Conversation lifecycle handling
|-- database.py # Cosmos-backed persistence
|-- graph_scenario_generator.py
|-- managers.py # ScenarioManager and AgentManager
|-- role_store.py # Trainer/admin role handling
|-- search_service.py # Azure AI Search support materials integration
|-- websocket_handler.py # Browser <-> Azure Voice Live proxyImportant backend endpoints include:
GET /api/configGET /api/healthGET /api/scenariosGET /api/scenarios/<scenario_id>POST /api/agents/createPOST /api/analyzeGET /api/conversationsPOST /api/scenarios/graphPOST /api/client-logWS /ws/voice
Frontend (frontend/)
frontend/
|-- package.json # npm scripts and frontend dependencies
|-- vite.config.ts # Vite configuration
|-- tsconfig.json # TypeScript configuration
|-- eslint.config.js # ESLint configuration
|-- src/
|-- main.tsx # React entrypoint
|-- app/App.tsx # Main application flow and view state
|-- components/ # UI panels and controls
|-- hooks/ # Audio, auth, scenarios, realtime, WebRTC, and history hooks
|-- services/ # Backend API clients
|-- styles/ # Global styling
|-- types/ # Shared TypeScript typesPrimary frontend responsibilities:
- Scenario selection and session setup.
- Real-time WebSocket connection management.
- Audio capture and playback.
- Avatar/WebRTC connection lifecycle.
- Transcript display and post-session analysis flow.
- Conversation history and trainer views.
Infrastructure (infra/)
infra/ contains the Azure AI Landing Zone Bicep implementation used by this app. It is designed as a reusable infra core with feature flags, strong parameterization, and support for both basic and network-isolated deployments.
Key areas:
infra/
|-- main.bicep # Main deployment orchestrator
|-- main.parameters.json # Infra parameter defaults after overlay copy
|-- azure.yaml # Infra-local azd definition
|-- manifest.json # Landing zone release/component metadata
|-- install.ps1 # Jumpbox bootstrap script for isolated deployments
|-- constants/ # Role IDs and naming abbreviations
|-- modules/
|-- ai-foundry/ # AI Foundry, storage, and service connections
|-- app-configuration/ # App Configuration population
|-- bing-search/ # Optional Bing Search resources
|-- container-apps/ # Container app list/config shaping
|-- networking/ # VNets, subnets, private endpoints, DNS, WAF ingress
|-- security/ # RBAC and Cosmos data-plane role assignmentsSamples and Data
samples/
|-- scenarios/ # Scenario JSON samples
|-- rubrics/ # Evaluation rubric JSON files
|-- transcripts/ # Example transcript text and audio
|-- materials/ # Support/training PDFs for search and grounding
data/
|-- graph-api-canned.json # Sample graph-style data for scenario generationDocumentation
docs/
|-- how-it-works.md # Developer-oriented runtime flow
|-- deployment.md # Full deployment guide
|-- authentication.md # Microsoft Entra ID auth setup
|-- network-isolation-jumpbox-runbook.md # Isolated deployment workflow
|-- manual-testing/ # Manual validation runbooks
|-- troubleshooting-*.md # Operational troubleshooting guides
|-- adr/ # Architecture decision recordsCommon Development Commands
Backend
cd backend
python src/app.py
pytest
black . --config pyproject.toml
flake8 . --config=.flake8Frontend
cd frontend
npm run dev
npm run format
npm run lint
npm run buildAzure
azd env select live-voice
azd deployUse azd provision when infrastructure changes require it. Use azd up for the full provision-and-deploy flow.
Engineering Standards
Clean Code and Modularity
All implementations in this repository should follow clean code best practices. The codebase should stay modular and easy to evolve; avoid letting files become large collections of unrelated behavior.
- Keep each file focused on a clear responsibility.
- Extract non-trivial logic into the right layer instead of adding more complexity to entrypoints or screens.
- Prefer small, cohesive functions, React components, hooks, and services.
- Use clear names that explain intent without relying on excessive comments.
- Reuse existing modules, helpers, hooks, services, constants, and types before adding new ones.
- Avoid duplication and speculative abstractions; extract when code is repeated or when a file is mixing concerns.
- Keep backend route handlers thin and place domain logic in
backend/src/services/. - Keep frontend screen components focused on composition; place reusable UI in
frontend/src/components/, shared behavior infrontend/src/hooks/, and API calls infrontend/src/services/. - Preserve infrastructure modularity under
infra/by extending parameters and modules instead of hardcoding workload-specific logic. - Prefer typed and explicit data contracts, especially across backend/frontend API boundaries.
- Surface errors clearly and consistently; do not add silent fallbacks that hide broken states.
- Add or update tests when behavior changes or when extracted logic becomes independently testable.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

