# sanketwork300-hash/voice_chat-agent architecture

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

- Interactive diagram: https://gitdiagram.com/sanketwork300-hash/voice_chat-agent
- Repository: https://github.com/sanketwork300-hash/voice_chat-agent

## Overview

Cloud Support Agent serves browser chat and voice for diagnosing AWS account issues, answering documentation questions, and applying customer-confirmed fixes; it can escalate unresolved cases. The graph follows the supported request and agent paths, including cloud operations, knowledge retrieval, and persistence, and preserves evaluation and observability as product capabilities. README documents the simulated AWS backend and evaluation workflow; source excerpts do not expose evaluation runner internals, so those links are documented rather than inferred from implementation.

Main entry points: [`backend/agent/agent.py`](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/agent/agent.py) (Support agent), [`frontend/components/Chat.tsx`](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/frontend/components/Chat.tsx) (Chat and voice UI), [`backend/tools/gateway.py`](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/tools/gateway.py) (Tool gateway), [`backend/voice/pipeline.py`](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/voice/pipeline.py) (Voice pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser experience"]
  node_browser["Chat and voice UI<br/>[Chat.tsx]"]
  node_chat_socket["Chat socket client<br/>[useChatSocket.ts]"]
  node_voice_client["Voice client<br/>[useVoiceClient.ts]"]
end

subgraph group_runtime["Support runtime"]
  node_chat_api["Chat API<br/>[chat.py]"]
  node_voice_api["Voice API<br/>[voice.py]"]
  node_voice_service["Voice service<br/>[service.py]"]
  node_voice_pipeline["Voice pipeline<br/>[pipeline.py]"]
  node_agent["Support agent<br/>[agent.py]"]
  node_taxonomy["Issue taxonomy<br/>[taxonomy.py]"]
  node_prompts["Agent prompts<br/>[prompts.py]"]
  node_redaction["Data redaction<br/>[redaction.py]"]
  node_tool_gateway["Tool gateway<br/>[gateway.py]"]
  node_tool_catalog["Tool catalog<br/>[catalog.py]"]
  node_debug_api["Debug API<br/>[debug.py]"]
end

subgraph group_integrations["Cloud and knowledge"]
  node_llm["LLM provider<br/>[__init__.py]"]
  node_cloud_tools["AWS domain tools"]
  node_cloud_provider["Cloud provider<br/>[base.py]"]
  node_fakecloud["Simulated AWS"]
  node_knowledge["Knowledge search<br/>[knowledge.py]"]
  node_embeddings["Embedding provider<br/>[local.py]"]
end

subgraph group_state["State and telemetry"]
  node_postgres[("Postgres state<br/>[store.py]")]
  node_metrics["Prometheus metrics<br/>[metrics.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_evaluation_api["Evaluation API<br/>[evaluation.py]"]
  node_evaluation_engine["Scenario evaluation"]
end

node_customer(("Customer"))
node_human(("Human support"))

node_customer -->|"uses"| node_browser
node_browser -->|"sends chat"| node_chat_socket
node_chat_socket -->|"WebSocket turns"| node_chat_api
node_chat_api -->|"handles turns"| node_agent
node_browser -->|"starts calls"| node_voice_client
node_voice_client -->|"WebRTC offer"| node_voice_api
node_voice_api -->|"routes calls"| node_voice_service
node_voice_service -->|"builds worker"| node_voice_pipeline
node_voice_pipeline -->|"submits turns"| node_agent
node_agent -->|"classifies and resolves"| node_taxonomy
node_agent -->|"uses prompts"| node_prompts
node_agent -.->|"requests generation"| node_llm
node_agent -->|"dispatches tools"| node_tool_gateway
node_tool_gateway -->|"loads definitions"| node_tool_catalog
node_tool_gateway -->|"executes calls"| node_cloud_tools
node_cloud_tools -->|"calls operations"| node_cloud_provider
node_cloud_provider -->|"AWS API"| node_fakecloud
node_agent -->|"searches docs"| node_knowledge
node_knowledge -->|"embeds queries"| node_embeddings
node_agent -->|"stores conversation"| node_postgres
node_tool_gateway -->|"records audit"| node_postgres
node_agent -->|"redacts data"| node_redaction
node_agent -->|"records usage"| node_metrics
node_voice_pipeline -->|"records latency"| node_metrics
node_browser -.->|"requests diagnostics"| node_debug_api
node_browser -->|"views runs"| node_evaluation_api
node_evaluation_api -.->|"serves evaluations"| node_evaluation_engine
node_evaluation_engine -.->|"stores results"| node_postgres
node_agent -.->|"escalates"| node_human

click node_browser "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/frontend/components/Chat.tsx"
click node_chat_socket "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/frontend/lib/useChatSocket.ts"
click node_voice_client "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/frontend/lib/useVoiceClient.ts"
click node_chat_api "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/api/chat.py"
click node_voice_api "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/api/voice.py"
click node_voice_service "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/voice/service.py"
click node_voice_pipeline "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/voice/pipeline.py"
click node_agent "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/agent/agent.py"
click node_taxonomy "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/agent/taxonomy.py"
click node_prompts "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/agent/prompts.py"
click node_redaction "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/security/redaction.py"
click node_llm "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/providers/llm/__init__.py"
click node_tool_gateway "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/tools/gateway.py"
click node_tool_catalog "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/tools/catalog.py"
click node_cloud_tools "https://github.com/sanketwork300-hash/voice_chat-agent/tree/main/backend/tools"
click node_cloud_provider "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/cloud/base.py"
click node_knowledge "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/rag/knowledge.py"
click node_embeddings "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/providers/embeddings/local.py"
click node_postgres "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/memory/store.py"
click node_metrics "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/metrics.py"
click node_evaluation_api "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/api/evaluation.py"
click node_evaluation_engine "https://github.com/sanketwork300-hash/voice_chat-agent/tree/main/backend/evaluation"
click node_debug_api "https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/api/debug.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_browser,node_chat_socket,node_voice_client toneBlue
class node_chat_api,node_voice_api,node_voice_service,node_voice_pipeline,node_agent,node_taxonomy,node_prompts,node_redaction,node_tool_gateway,node_tool_catalog,node_debug_api toneAmber
class node_llm,node_cloud_tools,node_cloud_provider,node_fakecloud,node_knowledge,node_embeddings toneMint
class node_postgres,node_metrics toneRose
class node_evaluation_api,node_evaluation_engine,node_customer,node_human toneIndigo
```

## Components

### Browser experience

- [Chat and voice UI](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/frontend/components/Chat.tsx): `frontend/components/Chat.tsx`
- [Chat socket client](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/frontend/lib/useChatSocket.ts): `frontend/lib/useChatSocket.ts`
- [Voice client](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/frontend/lib/useVoiceClient.ts): `frontend/lib/useVoiceClient.ts`

### Support runtime

- [Chat API](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/api/chat.py): `backend/api/chat.py`
- [Voice API](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/api/voice.py): `backend/api/voice.py`
- [Voice service](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/voice/service.py): `backend/voice/service.py`
- [Voice pipeline](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/voice/pipeline.py): `backend/voice/pipeline.py`
- [Support agent](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/agent/agent.py): `backend/agent/agent.py`
- [Issue taxonomy](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/agent/taxonomy.py): `backend/agent/taxonomy.py`
- [Agent prompts](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/agent/prompts.py): `backend/agent/prompts.py`
- [Data redaction](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/security/redaction.py): `backend/security/redaction.py`
- [Tool gateway](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/tools/gateway.py): `backend/tools/gateway.py`
- [Tool catalog](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/tools/catalog.py): `backend/tools/catalog.py`
- [Debug API](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/api/debug.py): `backend/api/debug.py`

### Cloud and knowledge

- [LLM provider](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/providers/llm/__init__.py): `backend/providers/llm/__init__.py`
- [AWS domain tools](https://github.com/sanketwork300-hash/voice_chat-agent/tree/main/backend/tools): `backend/tools`
- [Cloud provider](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/cloud/base.py): `backend/cloud/base.py`
- **Simulated AWS**
- [Knowledge search](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/rag/knowledge.py): `backend/rag/knowledge.py`
- [Embedding provider](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/providers/embeddings/local.py): `backend/providers/embeddings/local.py`

### State and telemetry

- [Postgres state](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/memory/store.py): `backend/memory/store.py`
- [Prometheus metrics](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/metrics.py): `backend/metrics.py`

### Evaluation

- [Evaluation API](https://github.com/sanketwork300-hash/voice_chat-agent/blob/main/backend/api/evaluation.py): `backend/api/evaluation.py`
- [Scenario evaluation](https://github.com/sanketwork300-hash/voice_chat-agent/tree/main/backend/evaluation): `backend/evaluation`

### Other components

- **Customer**
- **Human support**

## Connections

- Customer → Chat and voice UI: uses (evidence: `README.md`)
- Chat and voice UI → Chat socket client: sends chat (evidence: `README.md`)
- Chat socket client → Chat API: WebSocket turns (evidence: `README.md`)
- Chat API → Support agent: handles turns (evidence: `backend/api/chat.py`)
- Chat and voice UI → Voice client: starts calls (evidence: `README.md`)
- Voice client → Voice API: WebRTC offer (evidence: `README.md`)
- Voice API → Voice service: routes calls (evidence: `backend/api/voice.py`)
- Voice service → Voice pipeline: builds worker (evidence: `backend/voice/service.py`)
- Voice pipeline → Support agent: submits turns (evidence: `backend/voice/pipeline.py`)
- Support agent → Issue taxonomy: classifies and resolves (evidence: `backend/agent/agent.py`)
- Support agent → Agent prompts: uses prompts (evidence: `backend/agent/agent.py`)
- Support agent → LLM provider: requests generation (evidence: `backend/agent/agent.py`)
- Support agent → Tool gateway: dispatches tools (evidence: `backend/agent/agent.py`)
- Tool gateway → Tool catalog: loads definitions (evidence: `backend/tools/gateway.py`)
- Tool gateway → AWS domain tools: executes calls (evidence: `backend/tools/gateway.py`)
- AWS domain tools → Cloud provider: calls operations (evidence: `backend/tools/catalog.py`)
- Cloud provider → Simulated AWS: AWS API (evidence: `README.md`)
- Support agent → Knowledge search: searches docs (evidence: `backend/agent/agent.py`)
- Knowledge search → Embedding provider: embeds queries (evidence: `backend/rag/knowledge.py`)
- Support agent → Postgres state: stores conversation (evidence: `backend/agent/agent.py`)
- Tool gateway → Postgres state: records audit (evidence: `backend/tools/gateway.py`)
- Support agent → Data redaction: redacts data (evidence: `backend/agent/agent.py`)
- Support agent → Prometheus metrics: records usage (evidence: `backend/agent/agent.py`)
- Voice pipeline → Prometheus metrics: records latency (evidence: `backend/voice/pipeline.py`)
- Chat and voice UI → Debug API: requests diagnostics (evidence: `README.md`)
- Chat and voice UI → Evaluation API: views runs (evidence: `README.md`)
- Evaluation API → Scenario evaluation: serves evaluations (evidence: `README.md`)
- Scenario evaluation → Postgres state: stores results (evidence: `README.md`)
- Support agent → Human support: escalates (evidence: `README.md`)
