# manikandan-eoxys/agentichrvoicebot architecture

> Architecture diagram of the GitHub repository manikandan-eoxys/agentichrvoicebot, 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/manikandan-eoxys/agentichrvoicebot
- Repository: https://github.com/manikandan-eoxys/agentichrvoicebot

## Overview

HR Voice Agent joins a LiveKit room, processes employee speech through speech recognition and a local LLM, uses HR tools and data services as needed, then returns spoken responses. The repository also includes a browser voice dashboard, call blocking, monitoring, and enterprise-data synchronization. Some domain capabilities are documented or named in the source index but their implementations were not sampled; those branches are shown without speculative internal call chains.

Main entry points: [`agent.py`](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/agent.py) (LiveKit agent), [`controllers/voice_controller.py`](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/controllers/voice_controller.py) (Voice controller), [`hr_tools.py`](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/hr_tools.py) (HR tool layer), [`integrations/sync_scheduler.py`](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/integrations/sync_scheduler.py) (Background sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_voice["Voice runtime"]
  node_agent["LiveKit agent<br/>[agent.py]"]
  node_controller["Voice controller"]
  node_llm["Ollama LLM<br/>[ollama_llm.py]"]
  node_speech["Deepgram STT/TTS<br/>[agent.py]"]
end

subgraph group_hr["HR operations"]
  node_hr_tools["HR tool layer<br/>[hr_tools.py]"]
  node_employee_tools["Employee tools<br/>[employee_tools.py]"]
  node_leave_tools["Leave tools<br/>[leave_tools.py]"]
  node_leave_service["Leave management<br/>[leave_service.py]"]
  node_other_services["HR services"]
end

subgraph group_data["Data and integrations"]
  node_database[("HR database<br/>[db.py]")]
  node_ifs["IFS Cloud client"]
  node_sql["SQL Server client"]
  node_sync["Background sync<br/>[sync_scheduler.py]"]
end

subgraph group_monitor["Monitoring and security"]
  node_global_fsm["Global monitor FSM"]
  node_monitor_handler["Monitoring handler"]
  node_blocklist["Call blocklist<br/>[call_blocklist.py]"]
  node_session_recording["Session recorder"]
end

subgraph group_ui["Browser dashboard"]
  node_browser["Voice dashboard<br/>[VoiceAssistant.jsx]"]
  node_livekit_ui["LiveKit client<br/>[livekitService.js]"]
  node_token["Token service<br/>[tokenService.js]"]
end

node_employee(("Employee"))
node_livekit{{"LiveKit Cloud"}}
node_ollama{{"Ollama service"}}
node_deepgram{{"Deepgram services"}}

node_employee -->|"speaks to"| node_browser
node_browser -->|"connects through"| node_livekit_ui
node_livekit_ui -->|"requests token"| node_token
node_livekit_ui -->|"joins room"| node_livekit
node_livekit -->|"dispatches session"| node_agent
node_agent -->|"uses"| node_controller
node_agent -->|"registers tools"| node_hr_tools
node_agent -->|"starts monitor"| node_global_fsm
node_controller -->|"reports state"| node_global_fsm
node_controller -->|"builds engine"| node_llm
node_controller -->|"starts scheduler"| node_sync
node_agent -->|"configures engines"| node_speech
node_speech -->|"transcribes and speaks"| node_deepgram
node_llm -->|"generates response"| node_ollama
node_hr_tools -.->|"exposes"| node_employee_tools
node_employee_tools -->|"queries"| node_database
node_hr_tools -.->|"exposes"| node_leave_tools
node_leave_tools -->|"calls"| node_leave_service
node_leave_service -->|"reads and writes"| node_database
node_hr_tools -.->|"offers HR capabilities"| node_other_services
node_sync -->|"syncs records"| node_ifs
node_sync -->|"syncs records"| node_sql
node_sync -->|"reads pending data"| node_database
node_agent -->|"uses monitoring"| node_monitor_handler
node_agent -->|"records sessions"| node_session_recording
node_agent -->|"checks callers"| node_blocklist
node_browser -->|"renders room events"| node_livekit_ui
node_global_fsm -.->|"pushes monitoring"| node_monitor_handler

click node_browser "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/frontend/src/components/VoiceAssistant.jsx"
click node_livekit_ui "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/frontend/src/services/livekitService.js"
click node_token "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/frontend/src/services/tokenService.js"
click node_agent "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/agent.py"
click node_controller "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/controllers/voice_controller.py"
click node_llm "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/ollama_llm.py"
click node_speech "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/agent.py"
click node_hr_tools "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/hr_tools.py"
click node_employee_tools "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/tools/employee_tools.py"
click node_leave_tools "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/tools/leave_tools.py"
click node_leave_service "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/services/leave_service.py"
click node_other_services "https://github.com/manikandan-eoxys/agentichrvoicebot/tree/main/services"
click node_database "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/database/db.py"
click node_ifs "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/integrations/ifs_cloud_client.py"
click node_sql "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/integrations/sql_server_client.py"
click node_sync "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/integrations/sync_scheduler.py"
click node_global_fsm "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/controllers/global_monitor_fsm.py"
click node_monitor_handler "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/services/monitoring_handler.py"
click node_blocklist "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/security/call_blocklist.py"
click node_session_recording "https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/services/session_recorder.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_agent,node_controller,node_llm,node_speech toneBlue
class node_hr_tools,node_employee_tools,node_leave_tools,node_leave_service,node_other_services toneAmber
class node_database,node_ifs,node_sql,node_sync toneMint
class node_global_fsm,node_monitor_handler,node_blocklist,node_session_recording toneRose
class node_browser,node_livekit_ui,node_token,node_employee,node_livekit,node_ollama,node_deepgram toneIndigo
```

## Components

### Voice runtime

- [LiveKit agent](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/agent.py): `agent.py`
- [Voice controller](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/controllers/voice_controller.py): `controllers/voice_controller.py`
- [Ollama LLM](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/ollama_llm.py): `ollama_llm.py`
- [Deepgram STT/TTS](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/agent.py): `agent.py`

### HR operations

- [HR tool layer](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/hr_tools.py): `hr_tools.py`
- [Employee tools](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/tools/employee_tools.py): `tools/employee_tools.py`
- [Leave tools](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/tools/leave_tools.py): `tools/leave_tools.py`
- [Leave management](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/services/leave_service.py): `services/leave_service.py`
- [HR services](https://github.com/manikandan-eoxys/agentichrvoicebot/tree/main/services): `services`

### Data and integrations

- [HR database](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/database/db.py): `database/db.py`
- [IFS Cloud client](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/integrations/ifs_cloud_client.py): `integrations/ifs_cloud_client.py`
- [SQL Server client](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/integrations/sql_server_client.py): `integrations/sql_server_client.py`
- [Background sync](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/integrations/sync_scheduler.py): `integrations/sync_scheduler.py`

### Monitoring and security

- [Global monitor FSM](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/controllers/global_monitor_fsm.py): `controllers/global_monitor_fsm.py`
- [Monitoring handler](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/services/monitoring_handler.py): `services/monitoring_handler.py`
- [Call blocklist](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/security/call_blocklist.py): `security/call_blocklist.py`
- [Session recorder](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/services/session_recorder.py): `services/session_recorder.py`

### Browser dashboard

- [Voice dashboard](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/frontend/src/components/VoiceAssistant.jsx): `frontend/src/components/VoiceAssistant.jsx`
- [LiveKit client](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/frontend/src/services/livekitService.js): `frontend/src/services/livekitService.js`
- [Token service](https://github.com/manikandan-eoxys/agentichrvoicebot/blob/main/frontend/src/services/tokenService.js): `frontend/src/services/tokenService.js`

### Other components

- **Employee**
- **LiveKit Cloud**
- **Ollama service**
- **Deepgram services**

## Connections

- Employee → Voice dashboard: speaks to (evidence: `README.md`)
- Voice dashboard → LiveKit client: connects through (evidence: `frontend/src/components/VoiceAssistant.jsx`)
- LiveKit client → Token service: requests token (evidence: `frontend/src/services/livekitService.js`)
- LiveKit client → LiveKit Cloud: joins room (evidence: `frontend/src/services/livekitService.js`)
- LiveKit Cloud → LiveKit agent: dispatches session (evidence: `README.md`)
- LiveKit agent → Voice controller: uses (evidence: `agent.py`)
- LiveKit agent → HR tool layer: registers tools (evidence: `agent.py`)
- LiveKit agent → Global monitor FSM: starts monitor (evidence: `controllers/global_monitor_fsm.py`)
- Voice controller → Global monitor FSM: reports state (evidence: `controllers/voice_controller.py`)
- Voice controller → Ollama LLM: builds engine (evidence: `controllers/voice_controller.py`)
- Voice controller → Background sync: starts scheduler (evidence: `controllers/voice_controller.py`)
- LiveKit agent → Deepgram STT/TTS: configures engines (evidence: `README.md`)
- Deepgram STT/TTS → Deepgram services: transcribes and speaks (evidence: `README.md`)
- Ollama LLM → Ollama service: generates response (evidence: `README.md`)
- HR tool layer → Employee tools: exposes
- Employee tools → HR database: queries (evidence: `tools/employee_tools.py`)
- HR tool layer → Leave tools: exposes
- Leave tools → Leave management: calls (evidence: `tools/leave_tools.py`)
- Leave management → HR database: reads and writes (evidence: `services/leave_service.py`)
- HR tool layer → HR services: offers HR capabilities
- Background sync → IFS Cloud client: syncs records (evidence: `integrations/sync_scheduler.py`)
- Background sync → SQL Server client: syncs records (evidence: `integrations/sync_scheduler.py`)
- Background sync → HR database: reads pending data (evidence: `integrations/sync_scheduler.py`)
- LiveKit agent → Monitoring handler: uses monitoring (evidence: `agent.py`)
- LiveKit agent → Session recorder: records sessions (evidence: `agent.py`)
- LiveKit agent → Call blocklist: checks callers (evidence: `agent.py`)
- Voice dashboard → LiveKit client: renders room events (evidence: `frontend/src/components/VoiceAssistant.jsx`)
- Global monitor FSM → Monitoring handler: pushes monitoring
