# tonya0719/questbond architecture

> Architecture diagram of the GitHub repository tonya0719/questbond, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tonya0719/questbond
- Repository: https://github.com/tonya0719/questbond

## Overview

Mendigo is a field-service request and technician-scheduling application. Its main workflow captures a customer request, triages and structures it, hands it to scheduling for a deterministic recommendation, and lets a coordinator confirm a work order; staff can then view technician schedules and prepare customer email drafts. The repository also implements photo-assisted triage and disruption-recovery proposals. Edges reflect the README, shown calls, and SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`src/ui/coordinator_view.py`](https://github.com/tonya0719/questbond/blob/main/src/ui/coordinator_view.py) (Coordinator workspace), [`src/orchestration/orchestrator.py`](https://github.com/tonya0719/questbond/blob/main/src/orchestration/orchestrator.py) (Workflow orchestrator), [`src/ui/customer_view.py`](https://github.com/tonya0719/questbond/blob/main/src/ui/customer_view.py) (Customer form), [`src/database.py`](https://github.com/tonya0719/questbond/blob/main/src/database.py) (SQLite state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_app["App entry<br/>[app.py]"]
  node_customer_ui["Customer form<br/>[customer_view.py]"]
  node_coordinator_ui["Coordinator workspace"]
  node_technician_ui["Technician schedule<br/>[technician_view.py]"]
end

subgraph group_workflow["Agent workflow"]
  node_intake["Request intake<br/>[intake_agent.py]"]
  node_triage["Request triage<br/>[triage_service.py]"]
  node_photo["Photo assessment<br/>[photo_service.py]"]
  node_orchestrator["Workflow orchestrator<br/>[orchestrator.py]"]
  node_state["Workflow states<br/>[state_machine.py]"]
  node_scheduling_agent["Scheduling agent"]
  node_tools["Allowed tools<br/>[executor.py]"]
end

subgraph group_planning["Scheduling and recovery"]
  node_assignment["Assignment engine"]
  node_constraints["Scheduling constraints<br/>[eligibility.py]"]
  node_disruption["Disruption recovery"]
end

subgraph group_operations["Booking operations"]
  node_booking["Booking confirmation<br/>[booking_service.py]"]
  node_customer_response["Email draft"]
end

subgraph group_foundation["Runtime foundation"]
  node_database[("SQLite state<br/>[database.py]")]
  node_llm["Model clients<br/>[local_client.py]"]
end

node_customer(("Customer"))
node_coordinator(("Coordinator"))
node_technician(("Technician"))

node_customer -->|"submits request"| node_customer_ui
node_app -->|"routes view"| node_customer_ui
node_app -->|"routes view"| node_coordinator_ui
node_app -->|"routes view"| node_technician_ui
node_customer_ui -->|"starts intake"| node_intake
node_customer_ui -.->|"uploads photo"| node_photo
node_intake -.->|"checks request"| node_triage
node_intake -->|"provides request"| node_orchestrator
node_orchestrator -->|"transitions workflow"| node_state
node_orchestrator -->|"runs scheduling"| node_scheduling_agent
node_scheduling_agent -.->|"calls allowed tools"| node_tools
node_tools -->|"requests assignment"| node_assignment
node_assignment -->|"checks eligibility"| node_constraints
node_orchestrator -->|"requests inference"| node_llm
node_coordinator -->|"reviews recommendation"| node_coordinator_ui
node_coordinator_ui -->|"confirms recommendation"| node_booking
node_booking -->|"records work order"| node_database
node_coordinator_ui -->|"prepares draft"| node_customer_response
node_coordinator_ui -->|"reviews recovery"| node_disruption
node_technician -->|"views schedule"| node_technician_ui
node_technician_ui -.->|"reads schedule"| node_database
node_assignment -->|"reads and writes"| node_database
node_disruption -->|"reads and updates"| node_database

click node_app "https://github.com/tonya0719/questbond/blob/main/app.py"
click node_customer_ui "https://github.com/tonya0719/questbond/blob/main/src/ui/customer_view.py"
click node_coordinator_ui "https://github.com/tonya0719/questbond/blob/main/src/ui/coordinator_view.py"
click node_technician_ui "https://github.com/tonya0719/questbond/blob/main/src/ui/technician_view.py"
click node_intake "https://github.com/tonya0719/questbond/blob/main/src/agents/intake_agent.py"
click node_triage "https://github.com/tonya0719/questbond/blob/main/src/services/triage_service.py"
click node_photo "https://github.com/tonya0719/questbond/blob/main/src/services/photo_service.py"
click node_orchestrator "https://github.com/tonya0719/questbond/blob/main/src/orchestration/orchestrator.py"
click node_state "https://github.com/tonya0719/questbond/blob/main/src/orchestration/state_machine.py"
click node_scheduling_agent "https://github.com/tonya0719/questbond/blob/main/src/agents/scheduling_operations_agent.py"
click node_tools "https://github.com/tonya0719/questbond/blob/main/src/tools/executor.py"
click node_assignment "https://github.com/tonya0719/questbond/blob/main/src/scheduling/assignment_engine.py"
click node_constraints "https://github.com/tonya0719/questbond/blob/main/src/scheduling/eligibility.py"
click node_disruption "https://github.com/tonya0719/questbond/blob/main/src/services/disruption_service.py"
click node_booking "https://github.com/tonya0719/questbond/blob/main/src/services/booking_service.py"
click node_customer_response "https://github.com/tonya0719/questbond/blob/main/src/services/customer_response.py"
click node_database "https://github.com/tonya0719/questbond/blob/main/src/database.py"
click node_llm "https://github.com/tonya0719/questbond/blob/main/src/llm/local_client.py"

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_app,node_customer_ui,node_coordinator_ui,node_technician_ui toneBlue
class node_intake,node_triage,node_photo,node_orchestrator,node_state,node_scheduling_agent,node_tools toneAmber
class node_assignment,node_constraints,node_disruption toneMint
class node_booking,node_customer_response toneRose
class node_database,node_llm,node_customer,node_coordinator,node_technician toneIndigo
```

## Components

### User experience

- [App entry](https://github.com/tonya0719/questbond/blob/main/app.py): `app.py`
- [Customer form](https://github.com/tonya0719/questbond/blob/main/src/ui/customer_view.py): `src/ui/customer_view.py`
- [Coordinator workspace](https://github.com/tonya0719/questbond/blob/main/src/ui/coordinator_view.py): `src/ui/coordinator_view.py`
- [Technician schedule](https://github.com/tonya0719/questbond/blob/main/src/ui/technician_view.py): `src/ui/technician_view.py`

### Agent workflow

- [Request intake](https://github.com/tonya0719/questbond/blob/main/src/agents/intake_agent.py): `src/agents/intake_agent.py`
- [Request triage](https://github.com/tonya0719/questbond/blob/main/src/services/triage_service.py): `src/services/triage_service.py`
- [Photo assessment](https://github.com/tonya0719/questbond/blob/main/src/services/photo_service.py): `src/services/photo_service.py`
- [Workflow orchestrator](https://github.com/tonya0719/questbond/blob/main/src/orchestration/orchestrator.py): `src/orchestration/orchestrator.py`
- [Workflow states](https://github.com/tonya0719/questbond/blob/main/src/orchestration/state_machine.py): `src/orchestration/state_machine.py`
- [Scheduling agent](https://github.com/tonya0719/questbond/blob/main/src/agents/scheduling_operations_agent.py): `src/agents/scheduling_operations_agent.py`
- [Allowed tools](https://github.com/tonya0719/questbond/blob/main/src/tools/executor.py): `src/tools/executor.py`

### Scheduling and recovery

- [Assignment engine](https://github.com/tonya0719/questbond/blob/main/src/scheduling/assignment_engine.py): `src/scheduling/assignment_engine.py`
- [Scheduling constraints](https://github.com/tonya0719/questbond/blob/main/src/scheduling/eligibility.py): `src/scheduling/eligibility.py`
- [Disruption recovery](https://github.com/tonya0719/questbond/blob/main/src/services/disruption_service.py): `src/services/disruption_service.py`

### Booking operations

- [Booking confirmation](https://github.com/tonya0719/questbond/blob/main/src/services/booking_service.py): `src/services/booking_service.py`
- [Email draft](https://github.com/tonya0719/questbond/blob/main/src/services/customer_response.py): `src/services/customer_response.py`

### Runtime foundation

- [SQLite state](https://github.com/tonya0719/questbond/blob/main/src/database.py): `src/database.py`
- [Model clients](https://github.com/tonya0719/questbond/blob/main/src/llm/local_client.py): `src/llm/local_client.py`

### Other components

- **Customer**
- **Coordinator**
- **Technician**

## Connections

- Customer → Customer form: submits request
- App entry → Customer form: routes view (evidence: `app.py`)
- App entry → Coordinator workspace: routes view (evidence: `app.py`)
- App entry → Technician schedule: routes view (evidence: `app.py`)
- Customer form → Request intake: starts intake
- Customer form → Photo assessment: uploads photo
- Request intake → Request triage: checks request
- Request intake → Workflow orchestrator: provides request
- Workflow orchestrator → Workflow states: transitions workflow (evidence: `src/orchestration/orchestrator.py`)
- Workflow orchestrator → Scheduling agent: runs scheduling (evidence: `src/orchestration/orchestrator.py`)
- Scheduling agent → Allowed tools: calls allowed tools
- Allowed tools → Assignment engine: requests assignment
- Assignment engine → Scheduling constraints: checks eligibility (evidence: `src/scheduling/assignment_engine.py`)
- Workflow orchestrator → Model clients: requests inference (evidence: `src/orchestration/orchestrator.py`)
- Coordinator → Coordinator workspace: reviews recommendation
- Coordinator workspace → Booking confirmation: confirms recommendation (evidence: `src/ui/coordinator_view.py`)
- Booking confirmation → SQLite state: records work order
- Coordinator workspace → Email draft: prepares draft (evidence: `src/ui/coordinator_view.py`)
- Coordinator workspace → Disruption recovery: reviews recovery (evidence: `src/ui/coordinator_view.py`)
- Technician → Technician schedule: views schedule
- Technician schedule → SQLite state: reads schedule
- Assignment engine → SQLite state: reads and writes (evidence: `src/scheduling/assignment_engine.py`)
- Disruption recovery → SQLite state: reads and updates (evidence: `src/services/disruption_service.py`)
