# chodavon/ai-agent-for-receptionist architecture

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

- Interactive diagram: https://gitdiagram.com/chodavon/ai-agent-for-receptionist
- Repository: https://github.com/chodavon/ai-agent-for-receptionist

## Overview

This is a bilingual AI receptionist for school questions, accepting text and voice and returning streamed or complete answers. The main path is caller input through validation and optional transcription, skill and approved-answer routing, then a Gemini agent whose response streams to the browser; browser speech is sentence-based. Staff administer a separate approval loop for unanswered questions and negative feedback, producing versioned knowledge and routing examples. The README documents capabilities not fully visible in the excerpts; links based on it are cited there, and unsampled implementation details are not inferred.

Main entry points: [`src/receptionist/chat/router.py`](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/chat/router.py) (Chat endpoints), [`src/receptionist/agent/client.py`](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/agent/client.py) (Gemini agent), [`src/receptionist/admin/router.py`](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/admin/router.py) (Admin endpoints), [`src/receptionist/learning/service.py`](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/learning/service.py) (Feedback and review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public conversation"]
  node_chat_ui["Chat browser<br/>[app.js]"]
  node_chat_api["Chat endpoints<br/>[router.py]"]
  node_voice_validation["Audio validation<br/>[validators.py]"]
  node_speech_to_text["Speech to text<br/>[stt.py]"]
  node_speech_output["Speech output<br/>[tts.py]"]
end

subgraph group_answering["Answering and content"]
  node_agent["Gemini agent<br/>[client.py]"]
  node_skill_router["Skill router<br/>[service.py]"]
  node_router_matchers["Routing matchers<br/>[embeddings.py]"]
  node_skills["Skill registry<br/>[loader.py]"]
  node_knowledge_search["Approved answer search<br/>[knowledge.py]"]
  node_knowledge["Approved Q&amp;A<br/>[service.py]"]
  node_tools["Agent tools<br/>[tools.py]"]
end

subgraph group_staff["Staff learning loop"]
  node_admin_ui["Staff browser<br/>[admin.js]"]
  node_admin_api["Admin endpoints<br/>[router.py]"]
  node_learning["Feedback and review<br/>[service.py]"]
  node_message_service["Staff messages<br/>[service.py]"]
  node_faq_export["FAQ export<br/>[export.py]"]
end

subgraph group_platform["Platform services"]
  node_database[("Application database<br/>[database.py]")]
  node_metrics["Turn metrics<br/>[service.py]"]
  node_security["Security controls<br/>[auth.py]"]
end

node_caller(("Caller"))
node_gemini(("Gemini service"))

node_caller -->|"asks question"| node_chat_ui
node_chat_ui -->|"sends chat"| node_chat_api
node_chat_api -->|"validates audio"| node_voice_validation
node_chat_api -->|"transcribes audio"| node_speech_to_text
node_chat_api -->|"requests answer"| node_agent
node_agent -->|"routes question"| node_skill_router
node_skill_router -->|"scores skills"| node_router_matchers
node_skill_router -->|"loads skill index"| node_skills
node_agent -->|"reads skill content"| node_skills
node_agent -->|"checks approved answers"| node_knowledge_search
node_knowledge_search -->|"searches entries"| node_knowledge
node_agent -->|"dispatches tools"| node_tools
node_agent -->|"generates reply"| node_gemini
node_agent -->|"streams reply"| node_chat_api
node_chat_api -->|"synthesizes voice"| node_speech_output
node_chat_api -->|"records turn"| node_metrics
node_chat_api -->|"records feedback"| node_learning
node_caller -.->|"staff review"| node_admin_ui
node_admin_ui -->|"manages questions"| node_admin_api
node_admin_api -->|"approves drafts"| node_learning
node_admin_api -->|"manages entries"| node_knowledge
node_admin_api -->|"exports approved FAQ"| node_faq_export
node_admin_api -->|"manages messages"| node_message_service
node_learning -->|"creates approved entry"| node_knowledge
node_learning -->|"persists review data"| node_database
node_knowledge -->|"persists entries"| node_database
node_metrics -->|"stores measurements"| node_database
node_admin_api -->|"checks admin access"| node_security

click node_chat_ui "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/web/js/app.js"
click node_chat_api "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/chat/router.py"
click node_voice_validation "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/voice/validators.py"
click node_speech_to_text "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/voice/stt.py"
click node_speech_output "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/voice/tts.py"
click node_agent "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/agent/client.py"
click node_skill_router "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/router/service.py"
click node_router_matchers "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/router/embeddings.py"
click node_skills "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/skills/loader.py"
click node_knowledge_search "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/router/knowledge.py"
click node_knowledge "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/knowledge/service.py"
click node_tools "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/agent/tools.py"
click node_admin_ui "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/web/js/admin.js"
click node_admin_api "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/admin/router.py"
click node_learning "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/learning/service.py"
click node_message_service "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/messages/service.py"
click node_faq_export "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/admin/export.py"
click node_database "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/database.py"
click node_metrics "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/metrics/service.py"
click node_security "https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/security/auth.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_chat_ui,node_chat_api,node_voice_validation,node_speech_to_text,node_speech_output toneBlue
class node_agent,node_skill_router,node_router_matchers,node_skills,node_knowledge_search,node_knowledge,node_tools toneAmber
class node_admin_ui,node_admin_api,node_learning,node_message_service,node_faq_export toneMint
class node_database,node_metrics,node_security toneRose
class node_caller,node_gemini toneIndigo
```

## Components

### Public conversation

- [Chat browser](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/web/js/app.js): `web/js/app.js`
- [Chat endpoints](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/chat/router.py): `src/receptionist/chat/router.py`
- [Audio validation](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/voice/validators.py): `src/receptionist/voice/validators.py`
- [Speech to text](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/voice/stt.py): `src/receptionist/voice/stt.py`
- [Speech output](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/voice/tts.py): `src/receptionist/voice/tts.py`

### Answering and content

- [Gemini agent](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/agent/client.py): `src/receptionist/agent/client.py`
- [Skill router](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/router/service.py): `src/receptionist/router/service.py`
- [Routing matchers](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/router/embeddings.py): `src/receptionist/router/embeddings.py`
- [Skill registry](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/skills/loader.py): `src/receptionist/skills/loader.py`
- [Approved answer search](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/router/knowledge.py): `src/receptionist/router/knowledge.py`
- [Approved Q&A](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/knowledge/service.py): `src/receptionist/knowledge/service.py`
- [Agent tools](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/agent/tools.py): `src/receptionist/agent/tools.py`

### Staff learning loop

- [Staff browser](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/web/js/admin.js): `web/js/admin.js`
- [Admin endpoints](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/admin/router.py): `src/receptionist/admin/router.py`
- [Feedback and review](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/learning/service.py): `src/receptionist/learning/service.py`
- [Staff messages](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/messages/service.py): `src/receptionist/messages/service.py`
- [FAQ export](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/admin/export.py): `src/receptionist/admin/export.py`

### Platform services

- [Application database](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/database.py): `src/receptionist/database.py`
- [Turn metrics](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/metrics/service.py): `src/receptionist/metrics/service.py`
- [Security controls](https://github.com/chodavon/ai-agent-for-receptionist/blob/main/src/receptionist/security/auth.py): `src/receptionist/security/auth.py`

### Other components

- **Caller**
- **Gemini service**

## Connections

- Caller → Chat browser: asks question
- Chat browser → Chat endpoints: sends chat
- Chat endpoints → Audio validation: validates audio (evidence: `src/receptionist/chat/router.py`)
- Chat endpoints → Speech to text: transcribes audio (evidence: `src/receptionist/chat/router.py`)
- Chat endpoints → Gemini agent: requests answer (evidence: `src/receptionist/chat/router.py`)
- Gemini agent → Skill router: routes question (evidence: `src/receptionist/agent/client.py`)
- Skill router → Routing matchers: scores skills (evidence: `src/receptionist/router/service.py`)
- Skill router → Skill registry: loads skill index (evidence: `src/receptionist/router/service.py`)
- Gemini agent → Skill registry: reads skill content (evidence: `src/receptionist/agent/client.py`)
- Gemini agent → Approved answer search: checks approved answers (evidence: `src/receptionist/agent/client.py`)
- Approved answer search → Approved Q&A: searches entries (evidence: `src/receptionist/router/knowledge.py`)
- Gemini agent → Agent tools: dispatches tools (evidence: `src/receptionist/agent/client.py`)
- Gemini agent → Gemini service: generates reply
- Gemini agent → Chat endpoints: streams reply (evidence: `src/receptionist/chat/router.py`)
- Chat endpoints → Speech output: synthesizes voice (evidence: `src/receptionist/chat/router.py`)
- Chat endpoints → Turn metrics: records turn (evidence: `src/receptionist/chat/router.py`)
- Chat endpoints → Feedback and review: records feedback (evidence: `src/receptionist/chat/router.py`)
- Caller → Staff browser: staff review
- Staff browser → Admin endpoints: manages questions
- Admin endpoints → Feedback and review: approves drafts (evidence: `src/receptionist/admin/router.py`)
- Admin endpoints → Approved Q&A: manages entries (evidence: `src/receptionist/admin/router.py`)
- Admin endpoints → FAQ export: exports approved FAQ (evidence: `src/receptionist/admin/router.py`)
- Admin endpoints → Staff messages: manages messages (evidence: `src/receptionist/admin/router.py`)
- Feedback and review → Approved Q&A: creates approved entry (evidence: `src/receptionist/learning/service.py`)
- Feedback and review → Application database: persists review data (evidence: `src/receptionist/learning/service.py`)
- Approved Q&A → Application database: persists entries (evidence: `src/receptionist/knowledge/service.py`)
- Turn metrics → Application database: stores measurements (evidence: `src/receptionist/metrics/service.py`)
- Admin endpoints → Security controls: checks admin access (evidence: `src/receptionist/admin/router.py`)
