# islammasry/hr-notify-agent architecture

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

- Interactive diagram: https://gitdiagram.com/islammasry/hr-notify-agent
- Repository: https://github.com/islammasry/hr-notify-agent

## Overview

HR Notify Agent is a bilingual HR assistant for turning text or voice instructions into employee campaigns. The main flow is: an HR manager submits a command, the app resolves recipients and proposes a plan, the manager approves it, and the app sends email and/or starts calls. Monitoring tracks campaigns and employee replies, enabling routine answers or escalation to HR. Settings manage the employee directory and policy knowledge base. The graph reflects documented capabilities; some app-to-subsystem connections are supported by the README rather than sampled endpoint code.

Main entry points: [`app.py`](https://github.com/islammasry/hr-notify-agent/blob/main/app.py) (Web app and API), [`claude_client.py`](https://github.com/islammasry/hr-notify-agent/blob/main/claude_client.py) (Claude client), [`tools/employee_store.py`](https://github.com/islammasry/hr-notify-agent/blob/main/tools/employee_store.py) (Employee directory), [`tools/knowledge_base.py`](https://github.com/islammasry/hr-notify-agent/blob/main/tools/knowledge_base.py) (HR knowledge base)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["HR interaction"]
  node_app["Web app and API<br/>[app.py]"]
  node_orchestrator["Command planner<br/>[orchestrator.py]"]
  node_transcription["Audio transcription<br/>[transcribe_tool.py]"]
end

subgraph group_delivery["Campaign delivery"]
  node_claude["Claude client<br/>[claude_client.py]"]
  node_email["Email delivery<br/>[email_sender.py]"]
  node_calls["Voice calls<br/>[call_tool.py]"]
end

subgraph group_followup["Monitoring and follow-up"]
  node_inbox["Inbox checker<br/>[inbox_checker.py]"]
  node_scheduler["Follow-up scheduler<br/>[scheduler.py]"]
  node_audit[("Audit and campaigns<br/>[audit_log.py]")]
end

subgraph group_data["Domain data"]
  node_employee_store["Employee directory<br/>[employee_store.py]"]
  node_task["Default task<br/>[task_definition.py]"]
  node_knowledge["HR knowledge base<br/>[knowledge_base.py]"]
  node_config["Runtime configuration<br/>[config.py]"]
end

node_hr_manager(("HR Manager"))
node_browser(("Web interface"))
node_anthropic{{"Anthropic API"}}
node_mail_services{{"Mail services"}}
node_vapi{{"Vapi service"}}
node_employees(("Employees"))

node_hr_manager -->|"submits commands"| node_browser
node_browser -->|"sends requests"| node_app
node_app -->|"transcribes audio"| node_transcription
node_app -->|"requests a plan"| node_orchestrator
node_app -->|"loads directory"| node_employee_store
node_orchestrator -->|"requests tool plan"| node_anthropic
node_orchestrator -->|"resolves recipients"| node_employee_store
node_app -->|"uses default task"| node_task
node_app -->|"generates drafts"| node_claude
node_claude -->|"requests completions"| node_anthropic
node_hr_manager -->|"approves plan"| node_app
node_app -->|"sends campaign"| node_email
node_app -->|"starts calls"| node_calls
node_email -->|"sends mail"| node_mail_services
node_calls -->|"places calls"| node_vapi
node_employees -.->|"sends replies"| node_mail_services
node_app -->|"checks replies"| node_inbox
node_inbox -->|"reads inbox"| node_mail_services
node_app -->|"polls call results"| node_calls
node_app -->|"classifies replies"| node_claude
node_app -->|"loads policies"| node_knowledge
node_claude -->|"uses policy text"| node_knowledge
node_app -->|"sends auto replies"| node_email
node_app -->|"escalates replies"| node_hr_manager
node_hr_manager -->|"submits manager reply"| node_app
node_app -->|"configures checks"| node_scheduler
node_scheduler -.->|"runs follow-up checks"| node_app
node_app -->|"records actions"| node_audit
node_app -->|"reads campaign history"| node_audit
node_app -->|"edits directory"| node_employee_store
node_app -->|"edits policies"| node_knowledge
node_employee_store -->|"gets data path"| node_config
node_knowledge -->|"gets data path"| node_config
node_audit -->|"gets database path"| node_config

click node_app "https://github.com/islammasry/hr-notify-agent/blob/main/app.py"
click node_orchestrator "https://github.com/islammasry/hr-notify-agent/blob/main/orchestrator.py"
click node_transcription "https://github.com/islammasry/hr-notify-agent/blob/main/tools/transcribe_tool.py"
click node_employee_store "https://github.com/islammasry/hr-notify-agent/blob/main/tools/employee_store.py"
click node_task "https://github.com/islammasry/hr-notify-agent/blob/main/task_definition.py"
click node_knowledge "https://github.com/islammasry/hr-notify-agent/blob/main/tools/knowledge_base.py"
click node_claude "https://github.com/islammasry/hr-notify-agent/blob/main/claude_client.py"
click node_email "https://github.com/islammasry/hr-notify-agent/blob/main/tools/email_sender.py"
click node_calls "https://github.com/islammasry/hr-notify-agent/blob/main/tools/call_tool.py"
click node_inbox "https://github.com/islammasry/hr-notify-agent/blob/main/tools/inbox_checker.py"
click node_scheduler "https://github.com/islammasry/hr-notify-agent/blob/main/scheduler.py"
click node_audit "https://github.com/islammasry/hr-notify-agent/blob/main/audit_log.py"
click node_config "https://github.com/islammasry/hr-notify-agent/blob/main/config.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_orchestrator,node_transcription toneBlue
class node_claude,node_email,node_calls toneAmber
class node_inbox,node_scheduler,node_audit,node_anthropic,node_vapi toneMint
class node_employee_store,node_task,node_knowledge,node_config toneRose
class node_hr_manager,node_browser,node_mail_services,node_employees toneIndigo
```

## Components

### HR interaction

- [Web app and API](https://github.com/islammasry/hr-notify-agent/blob/main/app.py): `app.py`
- [Command planner](https://github.com/islammasry/hr-notify-agent/blob/main/orchestrator.py): `orchestrator.py`
- [Audio transcription](https://github.com/islammasry/hr-notify-agent/blob/main/tools/transcribe_tool.py): `tools/transcribe_tool.py`

### Campaign delivery

- [Claude client](https://github.com/islammasry/hr-notify-agent/blob/main/claude_client.py): `claude_client.py`
- [Email delivery](https://github.com/islammasry/hr-notify-agent/blob/main/tools/email_sender.py): `tools/email_sender.py`
- [Voice calls](https://github.com/islammasry/hr-notify-agent/blob/main/tools/call_tool.py): `tools/call_tool.py`

### Monitoring and follow-up

- [Inbox checker](https://github.com/islammasry/hr-notify-agent/blob/main/tools/inbox_checker.py): `tools/inbox_checker.py`
- [Follow-up scheduler](https://github.com/islammasry/hr-notify-agent/blob/main/scheduler.py): `scheduler.py`
- [Audit and campaigns](https://github.com/islammasry/hr-notify-agent/blob/main/audit_log.py): `audit_log.py`

### Domain data

- [Employee directory](https://github.com/islammasry/hr-notify-agent/blob/main/tools/employee_store.py): `tools/employee_store.py`
- [Default task](https://github.com/islammasry/hr-notify-agent/blob/main/task_definition.py): `task_definition.py`
- [HR knowledge base](https://github.com/islammasry/hr-notify-agent/blob/main/tools/knowledge_base.py): `tools/knowledge_base.py`
- [Runtime configuration](https://github.com/islammasry/hr-notify-agent/blob/main/config.py): `config.py`

### Other components

- **HR Manager**
- **Web interface**
- **Anthropic API**
- **Mail services**
- **Vapi service**
- **Employees**

## Connections

- HR Manager → Web interface: submits commands (evidence: `README.md`)
- Web interface → Web app and API: sends requests (evidence: `README.md`)
- Web app and API → Audio transcription: transcribes audio (evidence: `README.md`)
- Web app and API → Command planner: requests a plan (evidence: `README.md`)
- Web app and API → Employee directory: loads directory (evidence: `app.py`)
- Command planner → Anthropic API: requests tool plan (evidence: `orchestrator.py`)
- Command planner → Employee directory: resolves recipients (evidence: `README.md`)
- Web app and API → Default task: uses default task (evidence: `app.py`)
- Web app and API → Claude client: generates drafts (evidence: `app.py`)
- Claude client → Anthropic API: requests completions (evidence: `claude_client.py`)
- HR Manager → Web app and API: approves plan (evidence: `README.md`)
- Web app and API → Email delivery: sends campaign (evidence: `README.md`)
- Web app and API → Voice calls: starts calls (evidence: `app.py`)
- Email delivery → Mail services: sends mail (evidence: `tools/email_sender.py`)
- Voice calls → Vapi service: places calls (evidence: `tools/call_tool.py`)
- Employees → Mail services: sends replies
- Web app and API → Inbox checker: checks replies (evidence: `README.md`)
- Inbox checker → Mail services: reads inbox (evidence: `tools/inbox_checker.py`)
- Web app and API → Voice calls: polls call results (evidence: `app.py`)
- Web app and API → Claude client: classifies replies (evidence: `app.py`)
- Web app and API → HR knowledge base: loads policies (evidence: `app.py`)
- Claude client → HR knowledge base: uses policy text (evidence: `README.md`)
- Web app and API → Email delivery: sends auto replies (evidence: `README.md`)
- Web app and API → HR Manager: escalates replies (evidence: `README.md`)
- HR Manager → Web app and API: submits manager reply (evidence: `README.md`)
- Web app and API → Follow-up scheduler: configures checks (evidence: `README.md`)
- Follow-up scheduler → Web app and API: runs follow-up checks (evidence: `app.py`)
- Web app and API → Audit and campaigns: records actions (evidence: `app.py`)
- Web app and API → Audit and campaigns: reads campaign history (evidence: `app.py`)
- Web app and API → Employee directory: edits directory (evidence: `README.md`)
- Web app and API → HR knowledge base: edits policies (evidence: `README.md`)
- Employee directory → Runtime configuration: gets data path (evidence: `tools/employee_store.py`)
- HR knowledge base → Runtime configuration: gets data path (evidence: `tools/knowledge_base.py`)
- Audit and campaigns → Runtime configuration: gets database path (evidence: `audit_log.py`)
