# yar-malik/saudi-home-services-voice-agent architecture

> Architecture diagram of the GitHub repository yar-malik/saudi-home-services-voice-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yar-malik/saudi-home-services-voice-agent
- Repository: https://github.com/yar-malik/saudi-home-services-voice-agent

## Overview

This repository is a Saudi home-services voice-agent example: callers move through scripted scenarios, scenario tools produce business actions or replay recorded outcomes, and Voho supplies speech. The README documents booking, slot filling, technician routing, and two reference scenarios. The phone server and core Python modules were sampled; scenario data and example clients are represented from README claims, not inspected source. The documented container and tool-stub server are described as separately published, so they are not treated as implemented here.

Main entry points: [`agent.py`](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/agent.py) (Scenario engine), [`flows.json`](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json) (Scenario definitions), [`server.py`](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/server.py) (Phone webhook), [`tools.py`](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/tools.py) (Tool registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Conversation runtime"]
  node_agent["Scenario engine<br/>[agent.py]"]
end

subgraph group_scenarios["Service scenarios"]
  node_flow_data["Scenario definitions<br/>[flows.json]"]
  node_booking["Job booking<br/>[flows.json]"]
  node_slot_filling["Slot filling<br/>[flows.json]"]
  node_tech_routing["Technician routing<br/>[flows.json]"]
  node_job_report["Technician report<br/>[flows.json]"]
  node_warranty["Warranty capture<br/>[flows.json]"]
end

subgraph group_integrations["Tools and integrations"]
  node_tool_registry["Tool registry<br/>[tools.py]"]
end

subgraph group_voice["Voice interfaces"]
  node_phone_server["Phone webhook<br/>[server.py]"]
  node_speech_client["Voho speech client<br/>[voho.py]"]
  node_stt["Speech recognition options<br/>[stt.py]"]
  node_python_example["Python quick start<br/>[main.py]"]
  node_node_example["Node quick start<br/>[index.mjs]"]
end

node_caller(("Caller"))
node_phone_provider["Twilio phone"]
node_business_systems["Business systems"]
node_voho_service["Voho Speech API"]

node_caller -->|"calls"| node_phone_provider
node_phone_provider -->|"posts speech turns"| node_phone_server
node_phone_server -->|"starts and replies"| node_agent
node_agent -->|"loads scenarios"| node_flow_data
node_agent -->|"calls tools"| node_tool_registry
node_agent -->|"runs scenario"| node_booking
node_agent -->|"runs scenario"| node_slot_filling
node_agent -->|"runs scenario"| node_tech_routing
node_flow_data -->|"documents scenario"| node_job_report
node_flow_data -->|"documents scenario"| node_warranty
node_tool_registry -.->|"can invoke"| node_business_systems
node_phone_server -->|"synthesizes replies"| node_speech_client
node_speech_client -->|"requests speech"| node_voho_service
node_phone_provider -.->|"alternative recognition"| node_stt
node_python_example -->|"requests speech"| node_voho_service
node_node_example -->|"requests speech"| node_voho_service

click node_flow_data "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json"
click node_booking "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json"
click node_slot_filling "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json"
click node_tech_routing "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json"
click node_job_report "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json"
click node_warranty "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json"
click node_agent "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/agent.py"
click node_tool_registry "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/tools.py"
click node_phone_server "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/server.py"
click node_speech_client "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/voho.py"
click node_stt "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/stt.py"
click node_python_example "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/examples/python/main.py"
click node_node_example "https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/examples/node/index.mjs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agent toneBlue
class node_flow_data,node_booking,node_slot_filling,node_tech_routing,node_job_report,node_warranty toneAmber
class node_tool_registry,node_voho_service toneMint
class node_phone_server,node_speech_client,node_stt,node_python_example,node_node_example toneRose
class node_caller,node_phone_provider,node_business_systems toneIndigo
```

## Components

### Conversation runtime

- [Scenario engine](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/agent.py): `agent.py`

### Service scenarios

- [Scenario definitions](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json): `flows.json`
- [Job booking](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json): `flows.json`
- [Slot filling](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json): `flows.json`
- [Technician routing](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json): `flows.json`
- [Technician report](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json): `flows.json`
- [Warranty capture](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/flows.json): `flows.json`

### Tools and integrations

- [Tool registry](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/tools.py): `tools.py`

### Voice interfaces

- [Phone webhook](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/server.py): `server.py`
- [Voho speech client](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/voho.py): `voho.py`
- [Speech recognition options](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/stt.py): `stt.py`
- [Python quick start](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/examples/python/main.py): `examples/python/main.py`
- [Node quick start](https://github.com/yar-malik/saudi-home-services-voice-agent/blob/main/examples/node/index.mjs): `examples/node/index.mjs`

### Other components

- **Caller**
- **Twilio phone**
- **Business systems**
- **Voho Speech API**

## Connections

- Caller → Twilio phone: calls (evidence: `README.md`)
- Twilio phone → Phone webhook: posts speech turns (evidence: `README.md`)
- Phone webhook → Scenario engine: starts and replies (evidence: `server.py`)
- Scenario engine → Scenario definitions: loads scenarios (evidence: `agent.py`)
- Scenario engine → Tool registry: calls tools (evidence: `agent.py`)
- Scenario engine → Job booking: runs scenario (evidence: `README.md`)
- Scenario engine → Slot filling: runs scenario (evidence: `README.md`)
- Scenario engine → Technician routing: runs scenario (evidence: `README.md`)
- Scenario definitions → Technician report: documents scenario (evidence: `README.md`)
- Scenario definitions → Warranty capture: documents scenario (evidence: `README.md`)
- Tool registry → Business systems: can invoke (evidence: `README.md`)
- Phone webhook → Voho speech client: synthesizes replies (evidence: `server.py`)
- Voho speech client → Voho Speech API: requests speech (evidence: `voho.py`)
- Twilio phone → Speech recognition options: alternative recognition (evidence: `README.md`)
- Python quick start → Voho Speech API: requests speech (evidence: `README.md`)
- Node quick start → Voho Speech API: requests speech (evidence: `README.md`)
