# jshreyansh/open-sales-demo-ai-agent architecture

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

- Interactive diagram: https://gitdiagram.com/jshreyansh/open-sales-demo-ai-agent
- Repository: https://github.com/jshreyansh/open-sales-demo-ai-agent

## Overview

SwishX combines a live, voice-led product walkthrough with a product dashboard for content, brand, and approvals, plus visitor gating and administration. The main path is visitor entry → call setup → conversational agent → spoken response and UI navigation, alongside the dashboard’s brand/content workflows. Relationships are limited to excerpted calls and explicit source-index references; unsampled product areas are represented at their exact tree paths without inferred connections.

Main entry points: [`backend/src/server.py`](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/server.py) (HTTP API), [`frontend/src/lib/api.ts`](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/lib/api.ts) (API client), [`backend/src/agent/runtime.py`](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/agent/runtime.py) (Agent runtime), [`backend/src/voice/agent_processor.py`](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/voice/agent_processor.py) (Turn processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Visitor experience"]
  node_app["App routing<br/>[App.tsx]"]
  node_meeting["Meeting shell<br/>[MeetingShell.tsx]"]
  node_voice_session["Voice session<br/>[useVoiceSession.ts]"]
  node_voice_transport["Pipecat transport<br/>[pipecatClient.ts]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_voice["Voice agent"]
  node_runtime["Agent runtime<br/>[runtime.py]"]
  node_agent_registry["Action registry<br/>[registry.py]"]
  node_walkthrough["Walkthrough flow<br/>[walkthrough.py]"]
  node_voice_bot["Voice bot<br/>[bot.py]"]
  node_voice_processor["Turn processor<br/>[agent_processor.py]"]
  node_call_recorder["Call recorder<br/>[call_recorder.py]"]
  node_telemetry["Turn telemetry<br/>[turn_telemetry.py]"]
  node_persona["Agent persona<br/>[persona.py]"]
end

subgraph group_product["Product workspace"]
  node_dashboard["Dashboard pages<br/>[Dashboard.tsx]"]
  node_brand["Brand management<br/>[BrandKit.tsx]"]
  node_approvals["Content approvals<br/>[Approvals.tsx]"]
  node_dossiers["Brand dossiers<br/>[BrandDossiers.tsx]"]
  node_content["Content library<br/>[ContentLibrary.tsx]"]
  node_content_studio["Content studio<br/>[ContentStudio.tsx]"]
  node_reel_studio["MagicReel studio"]
  node_avatar_studio["MagicAvatar studio"]
  node_admin["Admin console<br/>[AdminDashboard.tsx]"]
end

subgraph group_backend["Backend services"]
  node_server["HTTP API<br/>[server.py]"]
end

subgraph group_data["Persistence and integrations"]
  node_session_store[("Live session state<br/>[store.py]")]
  node_gate_log[("Visitor and call log<br/>[gate_log.py]")]
  node_email["Transactional email<br/>[email.py]"]
  node_analytics[("Analytics data<br/>[analytics.py]")]
  node_dashboard_data[("Dashboard data<br/>[dashboard.py]")]
  node_brand_data[("Brand kit data<br/>[brand_kit.py]")]
  node_approvals_data[("Approval data<br/>[approvals.py]")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_meeting
node_meeting -->|"uses"| node_voice_session
node_voice_session -->|"claims lock"| node_api_client
node_voice_session -->|"connects"| node_voice_transport
node_voice_session -->|"polls replies"| node_api_client
node_voice_transport -.->|"WebSocket audio"| node_voice_bot
node_api_client -->|"HTTP requests"| node_server
node_server -->|"runs turns"| node_runtime
node_server -->|"gets session"| node_session_store
node_server -->|"logs gate"| node_gate_log
node_server -->|"sends email"| node_email
node_runtime -->|"reads state"| node_session_store
node_runtime -->|"uses actions"| node_agent_registry
node_runtime -->|"uses steps"| node_walkthrough
node_runtime -->|"logs turns"| node_gate_log
node_voice_bot -->|"runs turns"| node_runtime
node_voice_bot -->|"processes audio"| node_voice_processor
node_voice_processor -->|"requests response"| node_runtime
node_voice_processor -->|"uses session"| node_session_store
node_voice_processor -->|"records call"| node_call_recorder
node_voice_processor -->|"reports turns"| node_telemetry
node_session_store -->|"seeds greeting"| node_persona
node_app -->|"routes to"| node_dashboard
node_dashboard -.->|"loads data"| node_api_client
node_brand -.->|"uses API"| node_api_client
node_approvals -->|"loads approvals"| node_api_client
node_dossiers -.->|"uses API"| node_api_client
node_content -.->|"uses API"| node_api_client
node_content_studio -.->|"uses API"| node_api_client
node_reel_studio -.->|"agent actions"| node_agent_registry
node_avatar_studio -.->|"agent actions"| node_agent_registry
node_admin -->|"loads metrics"| node_api_client
node_server -.->|"serves analytics"| node_analytics
node_server -.->|"serves dashboard"| node_dashboard_data
node_server -.->|"serves brand data"| node_brand_data
node_server -.->|"serves approvals"| node_approvals_data

click node_app "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/App.tsx"
click node_meeting "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/components/MeetingShell.tsx"
click node_voice_session "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/lib/useVoiceSession.ts"
click node_voice_transport "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/lib/pipecatClient.ts"
click node_api_client "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/lib/api.ts"
click node_server "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/server.py"
click node_runtime "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/agent/runtime.py"
click node_agent_registry "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/agent/registry.py"
click node_walkthrough "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/agent/walkthrough.py"
click node_voice_bot "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/voice/bot.py"
click node_voice_processor "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/voice/agent_processor.py"
click node_call_recorder "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/voice/call_recorder.py"
click node_telemetry "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/voice/turn_telemetry.py"
click node_session_store "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/context/store.py"
click node_gate_log "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/gate_log.py"
click node_email "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/email.py"
click node_dashboard "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/Dashboard.tsx"
click node_brand "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/BrandKit.tsx"
click node_approvals "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/Approvals.tsx"
click node_dossiers "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/BrandDossiers.tsx"
click node_content "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/ContentLibrary.tsx"
click node_content_studio "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/ContentStudio.tsx"
click node_reel_studio "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/studio/MagicReelStudio.tsx"
click node_avatar_studio "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/studio/MagicAvatarStudio.tsx"
click node_admin "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/admin/AdminDashboard.tsx"
click node_analytics "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/analytics.py"
click node_dashboard_data "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/dashboard.py"
click node_brand_data "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/brand_kit.py"
click node_approvals_data "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/approvals.py"
click node_persona "https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/persona.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_meeting,node_voice_session,node_voice_transport,node_api_client toneBlue
class node_runtime,node_agent_registry,node_walkthrough,node_voice_bot,node_voice_processor,node_call_recorder,node_telemetry,node_persona toneAmber
class node_dashboard,node_brand,node_approvals,node_dossiers,node_content,node_content_studio,node_reel_studio,node_avatar_studio,node_admin toneMint
class node_server toneRose
class node_session_store,node_gate_log,node_email,node_analytics,node_dashboard_data,node_brand_data,node_approvals_data,node_visitor toneIndigo
```

## Components

### Visitor experience

- [App routing](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Meeting shell](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/components/MeetingShell.tsx): `frontend/src/components/MeetingShell.tsx`
- [Voice session](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/lib/useVoiceSession.ts): `frontend/src/lib/useVoiceSession.ts`
- [Pipecat transport](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/lib/pipecatClient.ts): `frontend/src/lib/pipecatClient.ts`
- [API client](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### Voice agent

- [Agent runtime](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/agent/runtime.py): `backend/src/agent/runtime.py`
- [Action registry](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/agent/registry.py): `backend/src/agent/registry.py`
- [Walkthrough flow](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/agent/walkthrough.py): `backend/src/agent/walkthrough.py`
- [Voice bot](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/voice/bot.py): `backend/src/voice/bot.py`
- [Turn processor](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/voice/agent_processor.py): `backend/src/voice/agent_processor.py`
- [Call recorder](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/voice/call_recorder.py): `backend/src/voice/call_recorder.py`
- [Turn telemetry](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/voice/turn_telemetry.py): `backend/src/voice/turn_telemetry.py`
- [Agent persona](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/persona.py): `backend/src/persona.py`

### Product workspace

- [Dashboard pages](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Brand management](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/BrandKit.tsx): `frontend/src/pages/BrandKit.tsx`
- [Content approvals](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/Approvals.tsx): `frontend/src/pages/Approvals.tsx`
- [Brand dossiers](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/BrandDossiers.tsx): `frontend/src/pages/BrandDossiers.tsx`
- [Content library](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/ContentLibrary.tsx): `frontend/src/pages/ContentLibrary.tsx`
- [Content studio](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/ContentStudio.tsx): `frontend/src/pages/ContentStudio.tsx`
- [MagicReel studio](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/studio/MagicReelStudio.tsx): `frontend/src/pages/studio/MagicReelStudio.tsx`
- [MagicAvatar studio](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/studio/MagicAvatarStudio.tsx): `frontend/src/pages/studio/MagicAvatarStudio.tsx`
- [Admin console](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/frontend/src/pages/admin/AdminDashboard.tsx): `frontend/src/pages/admin/AdminDashboard.tsx`

### Backend services

- [HTTP API](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/server.py): `backend/src/server.py`

### Persistence and integrations

- [Live session state](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/context/store.py): `backend/src/context/store.py`
- [Visitor and call log](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/gate_log.py): `backend/src/data/gate_log.py`
- [Transactional email](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/email.py): `backend/src/data/email.py`
- [Analytics data](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/analytics.py): `backend/src/data/analytics.py`
- [Dashboard data](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/dashboard.py): `backend/src/data/dashboard.py`
- [Brand kit data](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/brand_kit.py): `backend/src/data/brand_kit.py`
- [Approval data](https://github.com/jshreyansh/open-sales-demo-ai-agent/blob/main/backend/src/data/approvals.py): `backend/src/data/approvals.py`

### Other components

- **Visitor**

## Connections

- Visitor → App routing: opens (evidence: `frontend/src/App.tsx`)
- App routing → Meeting shell: routes to (evidence: `frontend/src/App.tsx`)
- Meeting shell → Voice session: uses (evidence: `frontend/src/components/MeetingShell.tsx`)
- Voice session → API client: claims lock (evidence: `frontend/src/lib/useVoiceSession.ts`)
- Voice session → Pipecat transport: connects (evidence: `frontend/src/lib/useVoiceSession.ts`)
- Voice session → API client: polls replies (evidence: `frontend/src/lib/useVoiceSession.ts`)
- Pipecat transport → Voice bot: WebSocket audio
- API client → HTTP API: HTTP requests (evidence: `frontend/src/lib/api.ts`)
- HTTP API → Agent runtime: runs turns (evidence: `backend/src/server.py`)
- HTTP API → Live session state: gets session (evidence: `backend/src/server.py`)
- HTTP API → Visitor and call log: logs gate (evidence: `backend/src/server.py`)
- HTTP API → Transactional email: sends email (evidence: `backend/src/data/email.py`)
- Agent runtime → Live session state: reads state (evidence: `backend/src/agent/runtime.py`)
- Agent runtime → Action registry: uses actions (evidence: `backend/src/agent/runtime.py`)
- Agent runtime → Walkthrough flow: uses steps (evidence: `backend/src/agent/runtime.py`)
- Agent runtime → Visitor and call log: logs turns (evidence: `backend/src/agent/runtime.py`)
- Voice bot → Agent runtime: runs turns (evidence: `backend/src/voice/bot.py`)
- Voice bot → Turn processor: processes audio (evidence: `backend/src/voice/bot.py`)
- Turn processor → Agent runtime: requests response (evidence: `backend/src/voice/agent_processor.py`)
- Turn processor → Live session state: uses session (evidence: `backend/src/voice/agent_processor.py`)
- Turn processor → Call recorder: records call (evidence: `backend/src/voice/agent_processor.py`)
- Turn processor → Turn telemetry: reports turns (evidence: `backend/src/voice/agent_processor.py`)
- Live session state → Agent persona: seeds greeting (evidence: `backend/src/context/store.py`)
- App routing → Dashboard pages: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard pages → API client: loads data
- Brand management → API client: uses API
- Content approvals → API client: loads approvals (evidence: `frontend/src/pages/Approvals.tsx`)
- Brand dossiers → API client: uses API
- Content library → API client: uses API
- Content studio → API client: uses API
- MagicReel studio → Action registry: agent actions
- MagicAvatar studio → Action registry: agent actions
- Admin console → API client: loads metrics (evidence: `frontend/src/pages/admin/AdminDashboard.tsx`)
- HTTP API → Analytics data: serves analytics (evidence: `backend/src/server.py`)
- HTTP API → Dashboard data: serves dashboard (evidence: `backend/src/server.py`)
- HTTP API → Brand kit data: serves brand data (evidence: `backend/src/server.py`)
- HTTP API → Approval data: serves approvals (evidence: `backend/src/server.py`)
