# nitinsnk/ai-sales-voice-agent architecture

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

- Interactive diagram: https://gitdiagram.com/nitinsnk/ai-sales-voice-agent
- Repository: https://github.com/nitinsnk/ai-sales-voice-agent

## Overview

NexaCloud AI is a Python sales voice-agent MVP with a browser-based Voice Studio, CRM and Insights Dashboard, Knowledge Manager, and Architecture Viewer. The main workflow is browser interaction through the HTTP/SSE server into call orchestration: language handling, RAG and prospect analysis, session updates, optional booking, and post-call summaries. SQLite backs CRM records and appointments; the JSON knowledge base feeds retrieval. The README documents browser voice and dashboard capabilities, but sampled excerpts do not show their detailed implementation or the full turn-processing internals.

Main entry points: [`sales_agent/agent/sales_agent.py`](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/agent/sales_agent.py) (Call Orchestrator), [`sales_agent/server.py`](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/server.py) (HTTP and SSE), [`public/app.js`](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/public/app.js) (Sales Workbench), [`sales_agent/memory/session_store.py`](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/memory/session_store.py) (Call Sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Browser Experience"]
  node_browser_ui["Sales Workbench<br/>[app.js]"]
  node_browser_voice["Voice I/O<br/>[app.js]"]
end

subgraph group_runtime["Call Runtime"]
  node_http_server["HTTP and SSE<br/>[server.py]"]
  node_app_entry["App Entrypoint<br/>[app.py]"]
  node_agent["Call Orchestrator<br/>[sales_agent.py]"]
  node_language["Language Detection<br/>[language.py]"]
  node_analyzer["BANT and Sentiment<br/>[analyzer.py]"]
  node_sessions["Call Sessions<br/>[session_store.py]"]
  node_pii["PII Redaction<br/>[pii.py]"]
  node_retriever["Hybrid RAG<br/>[retriever.py]"]
end

subgraph group_business["Sales Data"]
  node_knowledge_base["Knowledge Base"]
  node_crm[("CRM and Booking<br/>[crm_store.py]")]
  node_summary["Call Insights<br/>[sales_agent.py]"]
end

node_prospect(("Prospect"))
node_llm{{"Gemini or OpenAI"}}

node_prospect -->|"interacts"| node_browser_ui
node_browser_ui -->|"calls API"| node_http_server
node_http_server -->|"serves UI and SSE"| node_browser_ui
node_app_entry -->|"runs server"| node_http_server
node_http_server -->|"dispatches calls"| node_agent
node_http_server -->|"manages knowledge"| node_retriever
node_http_server -->|"serves CRM data"| node_crm
node_agent -->|"detects language"| node_language
node_agent -->|"analyzes turns"| node_analyzer
node_agent -->|"updates sessions"| node_sessions
node_agent -->|"retrieves context"| node_retriever
node_agent -->|"books and saves"| node_crm
node_sessions -->|"scores BANT"| node_analyzer
node_sessions -->|"redacts logs"| node_pii
node_retriever -->|"loads and persists"| node_knowledge_base
node_browser_ui -->|"offers voice I/O"| node_browser_voice
node_agent -->|"creates summary"| node_summary
node_agent -.->|"may use provider"| node_llm

click node_browser_ui "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/public/app.js"
click node_http_server "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/server.py"
click node_app_entry "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/app.py"
click node_agent "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/agent/sales_agent.py"
click node_language "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/utils/language.py"
click node_analyzer "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/intelligence/analyzer.py"
click node_sessions "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/memory/session_store.py"
click node_pii "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/utils/pii.py"
click node_retriever "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/rag/retriever.py"
click node_knowledge_base "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/data/knowledge_base.json"
click node_crm "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/crm/crm_store.py"
click node_summary "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/agent/sales_agent.py"
click node_browser_voice "https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/public/app.js"

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_browser_ui,node_browser_voice toneBlue
class node_http_server,node_app_entry,node_agent,node_language,node_analyzer,node_sessions,node_pii,node_retriever toneAmber
class node_knowledge_base,node_crm,node_summary toneMint
class node_prospect,node_llm toneIndigo
```

## Components

### Browser Experience

- [Sales Workbench](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/public/app.js): `public/app.js`
- [Voice I/O](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/public/app.js): `public/app.js`

### Call Runtime

- [HTTP and SSE](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/server.py): `sales_agent/server.py`
- [App Entrypoint](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/app.py): `app.py`
- [Call Orchestrator](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/agent/sales_agent.py): `sales_agent/agent/sales_agent.py`
- [Language Detection](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/utils/language.py): `sales_agent/utils/language.py`
- [BANT and Sentiment](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/intelligence/analyzer.py): `sales_agent/intelligence/analyzer.py`
- [Call Sessions](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/memory/session_store.py): `sales_agent/memory/session_store.py`
- [PII Redaction](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/utils/pii.py): `sales_agent/utils/pii.py`
- [Hybrid RAG](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/rag/retriever.py): `sales_agent/rag/retriever.py`

### Sales Data

- [Knowledge Base](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/data/knowledge_base.json): `data/knowledge_base.json`
- [CRM and Booking](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/crm/crm_store.py): `sales_agent/crm/crm_store.py`
- [Call Insights](https://github.com/nitinsnk/ai-sales-voice-agent/blob/main/sales_agent/agent/sales_agent.py): `sales_agent/agent/sales_agent.py`

### Other components

- **Prospect**
- **Gemini or OpenAI**

## Connections

- Prospect → Sales Workbench: interacts (evidence: `README.md`)
- Sales Workbench → HTTP and SSE: calls API (evidence: `sales_agent/server.py`)
- HTTP and SSE → Sales Workbench: serves UI and SSE (evidence: `sales_agent/server.py`)
- App Entrypoint → HTTP and SSE: runs server (evidence: `app.py`)
- HTTP and SSE → Call Orchestrator: dispatches calls (evidence: `sales_agent/server.py`)
- HTTP and SSE → Hybrid RAG: manages knowledge (evidence: `sales_agent/server.py`)
- HTTP and SSE → CRM and Booking: serves CRM data (evidence: `sales_agent/server.py`)
- Call Orchestrator → Language Detection: detects language (evidence: `sales_agent/agent/sales_agent.py`)
- Call Orchestrator → BANT and Sentiment: analyzes turns (evidence: `sales_agent/agent/sales_agent.py`)
- Call Orchestrator → Call Sessions: updates sessions (evidence: `sales_agent/agent/sales_agent.py`)
- Call Orchestrator → Hybrid RAG: retrieves context (evidence: `sales_agent/agent/sales_agent.py`)
- Call Orchestrator → CRM and Booking: books and saves (evidence: `sales_agent/agent/sales_agent.py`)
- Call Sessions → BANT and Sentiment: scores BANT (evidence: `sales_agent/memory/session_store.py`)
- Call Sessions → PII Redaction: redacts logs (evidence: `sales_agent/memory/session_store.py`)
- Hybrid RAG → Knowledge Base: loads and persists (evidence: `sales_agent/rag/retriever.py`)
- Sales Workbench → Voice I/O: offers voice I/O (evidence: `README.md`)
- Call Orchestrator → Call Insights: creates summary (evidence: `README.md`)
- Call Orchestrator → Gemini or OpenAI: may use provider (evidence: `README.md`)
