# yar-malik/voho-university-voice-agent architecture

> Architecture diagram of the GitHub repository yar-malik/voho-university-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/voho-university-voice-agent
- Repository: https://github.com/yar-malik/voho-university-voice-agent

## Overview

This is a browser-based university voice assistant: a student speaks or types, the browser sends audio for transcription or text for a conversational turn, and the server returns an answer and optional speech. The turn adapter asks Voho to interpret the request, dispatches any marker-based tool call to university functions, then synthesizes the final answer. The README also documents admissions knowledge, weighted-score calculation, application lookup, support tickets, department transfer, messaging, and Arabic/English switching. Several tool and Voho details are supported by README or index references rather than sampled implementations.

Main entry points: [`components/VoiceDemo.tsx`](https://github.com/yar-malik/voho-university-voice-agent/blob/main/components/VoiceDemo.tsx) (Voice demo), [`lib/tools/index.ts`](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/index.ts) (Tool registry), [`app/api/voice/turn/route.ts`](https://github.com/yar-malik/voho-university-voice-agent/blob/main/app/api/voice/turn/route.ts) (Turn endpoint), [`lib/voho/tools.ts`](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/tools.ts) (Tool-call adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser demo"]
  node_demo["Voice demo<br/>[VoiceDemo.tsx]"]
  node_recorder["Mic capture<br/>[record.ts]"]
  node_transcript["Transcript view<br/>[Transcript.tsx]"]
  node_tool_log["Tool log<br/>[ToolLog.tsx]"]
end

subgraph group_server["Server workflow"]
  node_turn_api["Turn endpoint<br/>[route.ts]"]
  node_transcribe_api["Transcription endpoint<br/>[route.ts]"]
  node_status_api["Status endpoint<br/>[route.ts]"]
  node_prompt["Agent brief<br/>[agentPrompt.ts]"]
end

subgraph group_knowledge["University knowledge"]
  node_config["University config<br/>[university.ts]"]
  node_knowledge_base["FAQ and knowledge<br/>[index.ts]"]
  node_knowledge_data["FAQ, programs, services"]
end

subgraph group_integrations["Voho integration"]
  node_voho_adapter["Tool-call adapter<br/>[tools.ts]"]
  node_voho_agent["Voho agent API<br/>[agents.ts]"]
  node_voho_speech["Voho speech API<br/>[speech.ts]"]
  node_voho_transcribe["Voho transcription API<br/>[transcribe.ts]"]
  node_voho_client["Voho HTTP client<br/>[client.ts]"]
end

subgraph group_actions["University actions"]
  node_tool_registry["Tool registry<br/>[index.ts]"]
  node_admission_score["Admission score"]
  node_application_status["Application lookup"]
  node_support_ticket["Support ticket"]
  node_department_transfer["Department transfer"]
  node_send_info["Send information<br/>[sendInformation.ts]"]
end

node_student(("Student"))
node_voho_service{{"Voho service"}}

node_student -->|"speaks or types"| node_demo
node_demo -->|"captures audio"| node_recorder
node_demo -->|"posts audio"| node_transcribe_api
node_transcribe_api -->|"requests transcription"| node_voho_transcribe
node_voho_transcribe -->|"uploads audio"| node_voho_client
node_voho_client -->|"sends authenticated requests"| node_voho_service
node_demo -->|"posts utterance"| node_turn_api
node_turn_api -->|"loads brief"| node_prompt
node_turn_api -->|"uses greeting and identity"| node_config
node_turn_api -->|"starts conversation"| node_voho_adapter
node_voho_adapter -->|"requests agent reply"| node_voho_agent
node_voho_agent -->|"calls API client"| node_voho_client
node_voho_adapter -->|"runs requested tools"| node_tool_registry
node_tool_registry -->|"registers"| node_admission_score
node_tool_registry -->|"registers"| node_application_status
node_tool_registry -->|"registers"| node_support_ticket
node_tool_registry -->|"registers"| node_department_transfer
node_tool_registry -->|"registers"| node_send_info
node_voho_adapter -->|"synthesizes final answer"| node_voho_speech
node_voho_speech -->|"calls API client"| node_voho_client
node_voho_adapter -->|"exchanges turns and speech"| node_voho_service
node_demo -->|"renders turns"| node_transcript
node_demo -->|"renders tool results"| node_tool_log
node_turn_api -->|"returns reply and tool log"| node_demo
node_status_api -->|"reports institution"| node_config
node_status_api -->|"checks demo data"| node_knowledge_base
node_status_api -->|"reports tool catalogue"| node_tool_registry
node_knowledge_base -->|"loads content"| node_knowledge_data
node_knowledge_base -->|"assembles institution facts"| node_config
node_prompt -->|"includes knowledge"| node_knowledge_base
node_admission_score -->|"uses score weights"| node_config
node_application_status -.->|"reads demo applications"| node_knowledge_data
node_support_ticket -.->|"external ticket system"| node_voho_service
node_department_transfer -.->|"telephony routing"| node_voho_service
node_send_info -.->|"messaging provider"| node_voho_service

click node_demo "https://github.com/yar-malik/voho-university-voice-agent/blob/main/components/VoiceDemo.tsx"
click node_recorder "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/audio/record.ts"
click node_transcript "https://github.com/yar-malik/voho-university-voice-agent/blob/main/components/Transcript.tsx"
click node_tool_log "https://github.com/yar-malik/voho-university-voice-agent/blob/main/components/ToolLog.tsx"
click node_turn_api "https://github.com/yar-malik/voho-university-voice-agent/blob/main/app/api/voice/turn/route.ts"
click node_transcribe_api "https://github.com/yar-malik/voho-university-voice-agent/blob/main/app/api/voice/transcribe/route.ts"
click node_status_api "https://github.com/yar-malik/voho-university-voice-agent/blob/main/app/api/status/route.ts"
click node_prompt "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/agentPrompt.ts"
click node_config "https://github.com/yar-malik/voho-university-voice-agent/blob/main/config/university.ts"
click node_knowledge_base "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/knowledge/index.ts"
click node_knowledge_data "https://github.com/yar-malik/voho-university-voice-agent/tree/main/data"
click node_tool_registry "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/index.ts"
click node_admission_score "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/calculateAdmissionScore.ts"
click node_application_status "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/getApplicationStatus.ts"
click node_support_ticket "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/createSupportTicket.ts"
click node_department_transfer "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/transferToDepartment.ts"
click node_send_info "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/sendInformation.ts"
click node_voho_adapter "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/tools.ts"
click node_voho_agent "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/agents.ts"
click node_voho_speech "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/speech.ts"
click node_voho_transcribe "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/transcribe.ts"
click node_voho_client "https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/client.ts"

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_demo,node_recorder,node_transcript,node_tool_log toneBlue
class node_turn_api,node_transcribe_api,node_status_api,node_prompt toneAmber
class node_config,node_knowledge_base,node_knowledge_data toneMint
class node_voho_adapter,node_voho_agent,node_voho_speech,node_voho_transcribe,node_voho_client toneRose
class node_tool_registry,node_admission_score,node_application_status,node_support_ticket,node_department_transfer,node_send_info,node_student,node_voho_service toneIndigo
```

## Components

### Browser demo

- [Voice demo](https://github.com/yar-malik/voho-university-voice-agent/blob/main/components/VoiceDemo.tsx): `components/VoiceDemo.tsx`
- [Mic capture](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/audio/record.ts): `lib/audio/record.ts`
- [Transcript view](https://github.com/yar-malik/voho-university-voice-agent/blob/main/components/Transcript.tsx): `components/Transcript.tsx`
- [Tool log](https://github.com/yar-malik/voho-university-voice-agent/blob/main/components/ToolLog.tsx): `components/ToolLog.tsx`

### Server workflow

- [Turn endpoint](https://github.com/yar-malik/voho-university-voice-agent/blob/main/app/api/voice/turn/route.ts): `app/api/voice/turn/route.ts`
- [Transcription endpoint](https://github.com/yar-malik/voho-university-voice-agent/blob/main/app/api/voice/transcribe/route.ts): `app/api/voice/transcribe/route.ts`
- [Status endpoint](https://github.com/yar-malik/voho-university-voice-agent/blob/main/app/api/status/route.ts): `app/api/status/route.ts`
- [Agent brief](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/agentPrompt.ts): `lib/agentPrompt.ts`

### University knowledge

- [University config](https://github.com/yar-malik/voho-university-voice-agent/blob/main/config/university.ts): `config/university.ts`
- [FAQ and knowledge](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/knowledge/index.ts): `lib/knowledge/index.ts`
- [FAQ, programs, services](https://github.com/yar-malik/voho-university-voice-agent/tree/main/data): `data`

### Voho integration

- [Tool-call adapter](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/tools.ts): `lib/voho/tools.ts`
- [Voho agent API](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/agents.ts): `lib/voho/agents.ts`
- [Voho speech API](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/speech.ts): `lib/voho/speech.ts`
- [Voho transcription API](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/transcribe.ts): `lib/voho/transcribe.ts`
- [Voho HTTP client](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/voho/client.ts): `lib/voho/client.ts`

### University actions

- [Tool registry](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/index.ts): `lib/tools/index.ts`
- [Admission score](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/calculateAdmissionScore.ts): `lib/tools/calculateAdmissionScore.ts`
- [Application lookup](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/getApplicationStatus.ts): `lib/tools/getApplicationStatus.ts`
- [Support ticket](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/createSupportTicket.ts): `lib/tools/createSupportTicket.ts`
- [Department transfer](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/transferToDepartment.ts): `lib/tools/transferToDepartment.ts`
- [Send information](https://github.com/yar-malik/voho-university-voice-agent/blob/main/lib/tools/sendInformation.ts): `lib/tools/sendInformation.ts`

### Other components

- **Student**
- **Voho service**

## Connections

- Student → Voice demo: speaks or types (evidence: `README.md`)
- Voice demo → Mic capture: captures audio (evidence: `components/VoiceDemo.tsx`)
- Voice demo → Transcription endpoint: posts audio (evidence: `components/VoiceDemo.tsx`)
- Transcription endpoint → Voho transcription API: requests transcription (evidence: `app/api/voice/transcribe/route.ts`)
- Voho transcription API → Voho HTTP client: uploads audio (evidence: `lib/voho/transcribe.ts`)
- Voho HTTP client → Voho service: sends authenticated requests (evidence: `README.md`)
- Voice demo → Turn endpoint: posts utterance (evidence: `components/VoiceDemo.tsx`)
- Turn endpoint → Agent brief: loads brief (evidence: `app/api/voice/turn/route.ts`)
- Turn endpoint → University config: uses greeting and identity (evidence: `app/api/voice/turn/route.ts`)
- Turn endpoint → Tool-call adapter: starts conversation (evidence: `app/api/voice/turn/route.ts`)
- Tool-call adapter → Voho agent API: requests agent reply (evidence: `lib/voho/tools.ts`)
- Voho agent API → Voho HTTP client: calls API client (evidence: `lib/voho/agents.ts`)
- Tool-call adapter → Tool registry: runs requested tools (evidence: `lib/voho/tools.ts`)
- Tool registry → Admission score: registers (evidence: `lib/tools/index.ts`)
- Tool registry → Application lookup: registers (evidence: `lib/tools/index.ts`)
- Tool registry → Support ticket: registers (evidence: `lib/tools/index.ts`)
- Tool registry → Department transfer: registers (evidence: `lib/tools/index.ts`)
- Tool registry → Send information: registers (evidence: `lib/tools/index.ts`)
- Tool-call adapter → Voho speech API: synthesizes final answer (evidence: `lib/voho/tools.ts`)
- Voho speech API → Voho HTTP client: calls API client (evidence: `lib/voho/speech.ts`)
- Tool-call adapter → Voho service: exchanges turns and speech (evidence: `README.md`)
- Voice demo → Transcript view: renders turns (evidence: `components/VoiceDemo.tsx`)
- Voice demo → Tool log: renders tool results (evidence: `components/VoiceDemo.tsx`)
- Turn endpoint → Voice demo: returns reply and tool log (evidence: `app/api/voice/turn/route.ts`)
- Status endpoint → University config: reports institution (evidence: `app/api/status/route.ts`)
- Status endpoint → FAQ and knowledge: checks demo data (evidence: `app/api/status/route.ts`)
- Status endpoint → Tool registry: reports tool catalogue (evidence: `app/api/status/route.ts`)
- FAQ and knowledge → FAQ, programs, services: loads content (evidence: `lib/knowledge/index.ts`)
- FAQ and knowledge → University config: assembles institution facts (evidence: `lib/knowledge/index.ts`)
- Agent brief → FAQ and knowledge: includes knowledge (evidence: `lib/agentPrompt.ts`)
- Admission score → University config: uses score weights (evidence: `lib/tools/calculateAdmissionScore.ts`)
- Application lookup → FAQ, programs, services: reads demo applications (evidence: `lib/tools/getApplicationStatus.ts`)
- Support ticket → Voho service: external ticket system
- Department transfer → Voho service: telephony routing
- Send information → Voho service: messaging provider
