# synthesia-ai/interactive-avatar-quickstarts architecture

> Architecture diagram of the GitHub repository synthesia-ai/interactive-avatar-quickstarts, 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/synthesia-ai/interactive-avatar-quickstarts
- Repository: https://github.com/synthesia-ai/interactive-avatar-quickstarts

## Overview

This repository is a set of three runnable browser-based quickstarts for Synthesia Interactive Avatars: a minimal spoken assistant, a knowledge-grounded assistant, and a booking-form assistant. In each recipe, a local host serves the page and issues a LiveKit room token that dispatches its voice agent; the agent connects speech/model services and a Synthesia avatar. The RAG recipe retrieves source passages before answering, while the tools recipe synchronizes form edits in both directions. Connections for unsampled browser pages and some provider wiring are limited to the README or explicit agent comments.

Main entry points: [`rag/agent.py`](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py) (Grounded voice agent), [`minimal/agent.py`](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/minimal/agent.py) (Voice agent), [`tools/agent.py`](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/agent.py) (Form voice agent), [`tools/index.html`](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/index.html) (Booking form page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_minimal["Minimal voice demo"]
  node_minimal_host["Room token host<br/>[server.py]"]
  node_minimal_page["Avatar page<br/>[index.html]"]
  node_minimal_agent["Voice agent<br/>[agent.py]"]
  node_preflight["Realtime preflight"]
end

subgraph group_rag["Grounded answers"]
  node_rag_host["Room token host<br/>[server.py]"]
  node_rag_page["Avatar page<br/>[index.html]"]
  node_rag_agent["Grounded voice agent<br/>[agent.py]"]
  node_query_rewrite["Query rewriting<br/>[agent.py]"]
  node_wiki_retrieval["Wikipedia retrieval<br/>[agent.py]"]
  node_bedrock_retrieval["Bedrock retrieval<br/>[agent.py]"]
  node_passage_context["Passage-grounded context<br/>[agent.py]"]
  node_rag_status["Pipeline status<br/>[agent.py]"]
end

subgraph group_tools["Booking assistant"]
  node_tools_host["Room token host<br/>[server.py]"]
  node_tools_page["Booking form page<br/>[index.html]"]
  node_form_agent["Form voice agent<br/>[agent.py]"]
  node_form_tools["Form operations<br/>[agent.py]"]
  node_form_sync["Form data sync<br/>[agent.py]"]
end

subgraph group_platform["Realtime platform"]
  node_livekit["LiveKit rooms"]
  node_voice_services["Speech and LLM services"]
  node_synthesia["Synthesia avatar"]
  node_wikipedia["Wikipedia API"]
  node_aws_bedrock[("AWS Bedrock KB")]
end

node_visitor(("Browser visitor"))

node_visitor -.->|"uses"| node_minimal_page
node_minimal_host -->|"serves"| node_minimal_page
node_minimal_host -->|"mints room token"| node_livekit
node_minimal_host -->|"dispatches worker"| node_minimal_agent
node_minimal_agent -->|"installs support"| node_preflight
node_minimal_agent -->|"starts voice session"| node_livekit
node_minimal_agent -->|"uses speech and model"| node_voice_services
node_minimal_agent -->|"starts avatar session"| node_synthesia
node_visitor -.->|"asks questions"| node_rag_page
node_rag_host -->|"serves"| node_rag_page
node_rag_host -->|"mints room token"| node_livekit
node_rag_host -->|"dispatches worker"| node_rag_agent
node_rag_agent -->|"starts voice session"| node_livekit
node_rag_agent -->|"uses speech and model"| node_voice_services
node_rag_agent -->|"starts avatar session"| node_synthesia
node_rag_agent -->|"rewrites query"| node_query_rewrite
node_query_rewrite -->|"requests rewrite"| node_voice_services
node_rag_agent -->|"retrieves passages"| node_wiki_retrieval
node_wiki_retrieval -->|"searches and extracts"| node_wikipedia
node_rag_agent -.->|"retrieves passages"| node_bedrock_retrieval
node_bedrock_retrieval -.->|"queries knowledge base"| node_aws_bedrock
node_rag_agent -->|"injects retrieved text"| node_passage_context
node_rag_agent -->|"publishes stage"| node_rag_status
node_rag_status -.->|"updates status display"| node_rag_page
node_visitor -.->|"edits booking form"| node_tools_page
node_tools_host -->|"serves"| node_tools_page
node_tools_host -->|"mints room token"| node_livekit
node_tools_host -->|"dispatches worker"| node_form_agent
node_form_agent -->|"starts voice session"| node_livekit
node_form_agent -->|"uses speech and LLM"| node_voice_services
node_form_agent -->|"starts avatar session"| node_synthesia
node_form_agent -->|"registers form tools"| node_form_tools
node_form_tools -->|"publishes field changes"| node_form_sync
node_form_sync -.->|"syncs form state"| node_tools_page
node_tools_page -->|"sends edits"| node_form_sync

click node_minimal_host "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/minimal/server.py"
click node_minimal_page "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/minimal/index.html"
click node_minimal_agent "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/minimal/agent.py"
click node_preflight "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/minimal/realtime_preflight.py"
click node_rag_host "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/server.py"
click node_rag_page "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/index.html"
click node_rag_agent "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py"
click node_query_rewrite "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py"
click node_wiki_retrieval "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py"
click node_bedrock_retrieval "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py"
click node_passage_context "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py"
click node_rag_status "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py"
click node_tools_host "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/server.py"
click node_tools_page "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/index.html"
click node_form_agent "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/agent.py"
click node_form_tools "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/agent.py"
click node_form_sync "https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/agent.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_minimal_host,node_minimal_page,node_minimal_agent,node_preflight,node_visitor toneBlue
class node_rag_host,node_rag_page,node_rag_agent,node_query_rewrite,node_wiki_retrieval,node_bedrock_retrieval,node_passage_context,node_rag_status toneAmber
class node_tools_host,node_tools_page,node_form_agent,node_form_tools,node_form_sync toneMint
class node_livekit,node_voice_services,node_synthesia,node_wikipedia,node_aws_bedrock toneRose
```

## Components

### Minimal voice demo

- [Room token host](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/minimal/server.py): `minimal/server.py`
- [Avatar page](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/minimal/index.html): `minimal/index.html`
- [Voice agent](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/minimal/agent.py): `minimal/agent.py`
- [Realtime preflight](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/minimal/realtime_preflight.py): `minimal/realtime_preflight.py`

### Grounded answers

- [Room token host](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/server.py): `rag/server.py`
- [Avatar page](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/index.html): `rag/index.html`
- [Grounded voice agent](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py): `rag/agent.py`
- [Query rewriting](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py): `rag/agent.py`
- [Wikipedia retrieval](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py): `rag/agent.py`
- [Bedrock retrieval](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py): `rag/agent.py`
- [Passage-grounded context](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py): `rag/agent.py`
- [Pipeline status](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/rag/agent.py): `rag/agent.py`

### Booking assistant

- [Room token host](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/server.py): `tools/server.py`
- [Booking form page](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/index.html): `tools/index.html`
- [Form voice agent](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/agent.py): `tools/agent.py`
- [Form operations](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/agent.py): `tools/agent.py`
- [Form data sync](https://github.com/synthesia-ai/interactive-avatar-quickstarts/blob/main/tools/agent.py): `tools/agent.py`

### Realtime platform

- **LiveKit rooms**
- **Speech and LLM services**
- **Synthesia avatar**
- **Wikipedia API**
- **AWS Bedrock KB**

### Other components

- **Browser visitor**

## Connections

- Browser visitor → Avatar page: uses (evidence: `README.md`)
- Room token host → Avatar page: serves (evidence: `minimal/server.py`)
- Room token host → LiveKit rooms: mints room token (evidence: `minimal/server.py`)
- Room token host → Voice agent: dispatches worker (evidence: `minimal/server.py`)
- Voice agent → Realtime preflight: installs support (evidence: `minimal/agent.py`)
- Voice agent → LiveKit rooms: starts voice session (evidence: `minimal/agent.py`)
- Voice agent → Speech and LLM services: uses speech and model (evidence: `minimal/agent.py`)
- Voice agent → Synthesia avatar: starts avatar session (evidence: `minimal/agent.py`)
- Browser visitor → Avatar page: asks questions (evidence: `README.md`)
- Room token host → Avatar page: serves (evidence: `rag/server.py`)
- Room token host → LiveKit rooms: mints room token (evidence: `rag/server.py`)
- Room token host → Grounded voice agent: dispatches worker (evidence: `rag/server.py`)
- Grounded voice agent → LiveKit rooms: starts voice session (evidence: `rag/agent.py`)
- Grounded voice agent → Speech and LLM services: uses speech and model (evidence: `rag/agent.py`)
- Grounded voice agent → Synthesia avatar: starts avatar session (evidence: `rag/agent.py`)
- Grounded voice agent → Query rewriting: rewrites query (evidence: `rag/agent.py`)
- Query rewriting → Speech and LLM services: requests rewrite (evidence: `rag/agent.py`)
- Grounded voice agent → Wikipedia retrieval: retrieves passages (evidence: `rag/agent.py`)
- Wikipedia retrieval → Wikipedia API: searches and extracts (evidence: `rag/agent.py`)
- Grounded voice agent → Bedrock retrieval: retrieves passages (evidence: `rag/agent.py`)
- Bedrock retrieval → AWS Bedrock KB: queries knowledge base (evidence: `rag/agent.py`)
- Grounded voice agent → Passage-grounded context: injects retrieved text (evidence: `rag/agent.py`)
- Grounded voice agent → Pipeline status: publishes stage (evidence: `rag/agent.py`)
- Pipeline status → Avatar page: updates status display (evidence: `README.md`)
- Browser visitor → Booking form page: edits booking form (evidence: `README.md`)
- Room token host → Booking form page: serves (evidence: `tools/server.py`)
- Room token host → LiveKit rooms: mints room token (evidence: `tools/server.py`)
- Room token host → Form voice agent: dispatches worker (evidence: `tools/server.py`)
- Form voice agent → LiveKit rooms: starts voice session (evidence: `tools/agent.py`)
- Form voice agent → Speech and LLM services: uses speech and LLM (evidence: `tools/agent.py`)
- Form voice agent → Synthesia avatar: starts avatar session (evidence: `tools/agent.py`)
- Form voice agent → Form operations: registers form tools (evidence: `tools/agent.py`)
- Form operations → Form data sync: publishes field changes (evidence: `tools/agent.py`)
- Form data sync → Booking form page: syncs form state (evidence: `tools/agent.py`)
- Booking form page → Form data sync: sends edits (evidence: `tools/agent.py`)
