# mekalakarthik05/voiceflow-ai architecture

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

- Interactive diagram: https://gitdiagram.com/mekalakarthik05/voiceflow-ai
- Repository: https://github.com/mekalakarthik05/voiceflow-ai

## Overview

VoiceFlow AI is a Streamlit voice assistant: a user records speech, the app transcribes it, uses the transcript and session conversation history to generate a response, then synthesizes and plays audio. The app also exposes model, personality, language and voice settings, conversation exports, health indicators and session analytics. The sampled source confirms service calls and fallback behavior; additional README capabilities are included only where the app excerpt supports them. No persistent database is shown: conversation memory and statistics are session state.

Main entry points: [`app.py`](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/app.py) (Streamlit App), [`services/deepgram_service.py`](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/services/deepgram_service.py) (Speech Recognition), [`services/tts_service.py`](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/services/tts_service.py) (Speech Synthesis), [`services/llm_service.py`](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/services/llm_service.py) (Response Generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User Experience"]
  node_app["Streamlit App<br/>[app.py]"]
  node_exports["Conversation Export<br/>[utils.py]"]
  node_dashboard["Health and Analytics<br/>[app.py]"]
  node_styling["Interface Styling<br/>[utils.py]"]
end

subgraph group_conversation["Conversation Flow"]
  node_session["Session Memory<br/>[app.py]"]
end

subgraph group_speech["Speech Services"]
  node_stt["Speech Recognition"]
  node_deepgram["Deepgram STT"]
  node_whisper["Whisper Fallback"]
  node_tts["Speech Synthesis<br/>[tts_service.py]"]
  node_piper["Piper TTS"]
  node_pyttsx3["TTS Fallback"]
end

subgraph group_reasoning["Reasoning and Export"]
  node_llm["Response Generation<br/>[llm_service.py]"]
  node_ollama["Ollama Runtime"]
end

node_user(("Voice User"))

node_user -->|"records speech"| node_app
node_app -->|"transcribes audio"| node_stt
node_stt -->|"tries transcription"| node_deepgram
node_stt -->|"falls back"| node_whisper
node_app -->|"updates history"| node_session
node_app -->|"requests response"| node_llm
node_llm -->|"calls chat"| node_ollama
node_app -->|"generates audio"| node_tts
node_tts -->|"synthesizes speech"| node_piper
node_tts -->|"falls back"| node_pyttsx3
node_app -->|"exports conversation"| node_exports
node_app -->|"shows metrics"| node_dashboard
node_app -->|"injects styles"| node_styling
node_app -->|"plays response"| node_user

click node_app "https://github.com/mekalakarthik05/voiceflow-ai/blob/main/app.py"
click node_session "https://github.com/mekalakarthik05/voiceflow-ai/blob/main/app.py"
click node_stt "https://github.com/mekalakarthik05/voiceflow-ai/blob/main/services/deepgram_service.py"
click node_llm "https://github.com/mekalakarthik05/voiceflow-ai/blob/main/services/llm_service.py"
click node_tts "https://github.com/mekalakarthik05/voiceflow-ai/blob/main/services/tts_service.py"
click node_exports "https://github.com/mekalakarthik05/voiceflow-ai/blob/main/utils/utils.py"
click node_dashboard "https://github.com/mekalakarthik05/voiceflow-ai/blob/main/app.py"
click node_styling "https://github.com/mekalakarthik05/voiceflow-ai/blob/main/utils/utils.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_exports,node_dashboard,node_styling,node_user toneBlue
class node_session toneAmber
class node_stt,node_deepgram,node_whisper,node_tts,node_piper,node_pyttsx3 toneMint
class node_llm,node_ollama toneRose
```

## Components

### User Experience

- [Streamlit App](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/app.py): `app.py`
- [Conversation Export](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/utils/utils.py): `utils/utils.py`
- [Health and Analytics](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/app.py): `app.py`
- [Interface Styling](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/utils/utils.py): `utils/utils.py`

### Conversation Flow

- [Session Memory](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/app.py): `app.py`

### Speech Services

- [Speech Recognition](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/services/deepgram_service.py): `services/deepgram_service.py`
- **Deepgram STT**
- **Whisper Fallback**
- [Speech Synthesis](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/services/tts_service.py): `services/tts_service.py`
- **Piper TTS**
- **TTS Fallback**

### Reasoning and Export

- [Response Generation](https://github.com/mekalakarthik05/voiceflow-ai/blob/main/services/llm_service.py): `services/llm_service.py`
- **Ollama Runtime**

### Other components

- **Voice User**

## Connections

- Voice User → Streamlit App: records speech (evidence: `README.md`)
- Streamlit App → Speech Recognition: transcribes audio (evidence: `app.py`)
- Speech Recognition → Deepgram STT: tries transcription (evidence: `services/deepgram_service.py`)
- Speech Recognition → Whisper Fallback: falls back (evidence: `services/deepgram_service.py`)
- Streamlit App → Session Memory: updates history (evidence: `app.py`)
- Streamlit App → Response Generation: requests response (evidence: `app.py`)
- Response Generation → Ollama Runtime: calls chat (evidence: `services/llm_service.py`)
- Streamlit App → Speech Synthesis: generates audio (evidence: `app.py`)
- Speech Synthesis → Piper TTS: synthesizes speech (evidence: `services/tts_service.py`)
- Speech Synthesis → TTS Fallback: falls back (evidence: `services/tts_service.py`)
- Streamlit App → Conversation Export: exports conversation (evidence: `app.py`)
- Streamlit App → Health and Analytics: shows metrics (evidence: `app.py`)
- Streamlit App → Interface Styling: injects styles (evidence: `app.py`)
- Streamlit App → Voice User: plays response (evidence: `app.py`)
