# gana37/kapture-collections-voicebot architecture

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

- Interactive diagram: https://gitdiagram.com/gana37/kapture-collections-voicebot
- Repository: https://github.com/gana37/kapture-collections-voicebot

## Overview

Maya is an outbound collections voicebot configured in Vapi, with a mock Express webhook for identity verification and collection outcomes. The documented call flow gates debt disclosure on verification, then handles promises to pay, payment links, dispositions, or human escalation. The graph includes the prompt and tool schemas, the webhook’s implemented operations, and its in-memory disposition log. Vapi setup and tool routing are documented, but the assistant configuration itself is external; no live telephony or payment integration is implemented here.

Main entry points: [`mock-server/server.js`](https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js) (Express webhook), [`vapi/system_prompt.txt`](https://github.com/gana37/kapture-collections-voicebot/blob/main/vapi/system_prompt.txt) (Conversation rules), [`vapi/tool_definitions.json`](https://github.com/gana37/kapture-collections-voicebot/blob/main/vapi/tool_definitions.json) (Tool schemas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Voice interaction"]
  node_vapi["Vapi assistant"]
  node_prompt["Conversation rules<br/>[system_prompt.txt]"]
  node_tools["Tool schemas"]
  node_speech["Deepgram transcription"]
  node_llm["OpenAI model"]
  node_voice["ElevenLabs voice"]
end

subgraph group_webhook["Webhook operations"]
  node_webhook["Express webhook<br/>[server.js]"]
  node_verify["Identity verification<br/>[server.js]"]
end

subgraph group_outcomes["Collection outcomes"]
  node_ptp["Promise logging<br/>[server.js]"]
  node_payment["Payment link response<br/>[server.js]"]
  node_escalate["Agent escalation<br/>[server.js]"]
  node_disposition["Disposition logging<br/>[server.js]"]
  node_calllog[("In-memory call log<br/>[server.js]")]
  node_query["Disposition query<br/>[server.js]"]
end

node_borrower(("Borrower"))

node_borrower -->|"speaks with"| node_vapi
node_prompt -->|"guides responses"| node_vapi
node_tools -->|"registers tools"| node_vapi
node_vapi -.->|"uses transcription"| node_speech
node_vapi -.->|"uses model"| node_llm
node_vapi -.->|"uses voice"| node_voice
node_vapi -->|"posts tool calls"| node_webhook
node_webhook -->|"routes to"| node_verify
node_webhook -->|"routes to"| node_ptp
node_webhook -->|"routes to"| node_payment
node_webhook -->|"routes to"| node_escalate
node_webhook -->|"routes to"| node_disposition
node_ptp -->|"appends record"| node_calllog
node_escalate -->|"appends record"| node_calllog
node_disposition -->|"appends record"| node_calllog
node_query -->|"reads records"| node_calllog

click node_prompt "https://github.com/gana37/kapture-collections-voicebot/blob/main/vapi/system_prompt.txt"
click node_tools "https://github.com/gana37/kapture-collections-voicebot/blob/main/vapi/tool_definitions.json"
click node_webhook "https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js"
click node_verify "https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js"
click node_ptp "https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js"
click node_payment "https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js"
click node_escalate "https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js"
click node_disposition "https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js"
click node_calllog "https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js"
click node_query "https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.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_vapi,node_prompt,node_tools,node_speech,node_llm,node_voice toneBlue
class node_webhook,node_verify toneAmber
class node_ptp,node_payment,node_escalate,node_disposition,node_calllog,node_query toneMint
class node_borrower toneIndigo
```

## Components

### Voice interaction

- **Vapi assistant**
- [Conversation rules](https://github.com/gana37/kapture-collections-voicebot/blob/main/vapi/system_prompt.txt): `vapi/system_prompt.txt`
- [Tool schemas](https://github.com/gana37/kapture-collections-voicebot/blob/main/vapi/tool_definitions.json): `vapi/tool_definitions.json`
- **Deepgram transcription**
- **OpenAI model**
- **ElevenLabs voice**

### Webhook operations

- [Express webhook](https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js): `mock-server/server.js`
- [Identity verification](https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js): `mock-server/server.js`

### Collection outcomes

- [Promise logging](https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js): `mock-server/server.js`
- [Payment link response](https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js): `mock-server/server.js`
- [Agent escalation](https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js): `mock-server/server.js`
- [Disposition logging](https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js): `mock-server/server.js`
- [In-memory call log](https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js): `mock-server/server.js`
- [Disposition query](https://github.com/gana37/kapture-collections-voicebot/blob/main/mock-server/server.js): `mock-server/server.js`

### Other components

- **Borrower**

## Connections

- Borrower → Vapi assistant: speaks with (evidence: `README.md`)
- Conversation rules → Vapi assistant: guides responses (evidence: `README.md`)
- Tool schemas → Vapi assistant: registers tools (evidence: `README.md`)
- Vapi assistant → Deepgram transcription: uses transcription (evidence: `README.md`)
- Vapi assistant → OpenAI model: uses model (evidence: `README.md`)
- Vapi assistant → ElevenLabs voice: uses voice (evidence: `README.md`)
- Vapi assistant → Express webhook: posts tool calls (evidence: `README.md`)
- Express webhook → Identity verification: routes to (evidence: `mock-server/server.js`)
- Express webhook → Promise logging: routes to (evidence: `mock-server/server.js`)
- Express webhook → Payment link response: routes to (evidence: `mock-server/server.js`)
- Express webhook → Agent escalation: routes to (evidence: `mock-server/server.js`)
- Express webhook → Disposition logging: routes to (evidence: `mock-server/server.js`)
- Promise logging → In-memory call log: appends record (evidence: `mock-server/server.js`)
- Agent escalation → In-memory call log: appends record (evidence: `mock-server/server.js`)
- Disposition logging → In-memory call log: appends record (evidence: `mock-server/server.js`)
- Disposition query → In-memory call log: reads records (evidence: `mock-server/server.js`)
