# princeverma73/rider-payout-ai-desk architecture

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

- Interactive diagram: https://gitdiagram.com/princeverma73/rider-payout-ai-desk
- Repository: https://github.com/princeverma73/rider-payout-ai-desk

## Overview

QuickDrop is a rider payout-dispute support desk. A rider submits a message to the service; the agent uses conversation context and investigative tools to check identity, trip and payout records, then either requests a guarded payout or creates an Ops review item and replies. PaySwift handles automated transfers, while the service also exposes an Ops dashboard. The source excerpts show agent/tool and persistence relationships; the API entry point was not sampled, so its dispatch to the agent is marked unverified.

Main entry points: [`app/agent/core.py`](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/core.py) (Agent orchestrator), [`app/db/session.py`](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/db/session.py) (PostgreSQL), [`app/agent/tools.py`](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py) (Payout decision), [`app/main.py`](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/main.py) (Service API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Service and conversations"]
  node_service["Service API<br/>[main.py]"]
  node_dashboard["Ops dashboard<br/>[index.html]"]
end

subgraph group_agent["Agent and investigation"]
  node_agent_core["Agent orchestrator<br/>[core.py]"]
  node_prompts["Conversation prompts<br/>[prompts.py]"]
  node_identity["Rider lookup<br/>[tools.py]"]
  node_trip_audit["Trip and date audit<br/>[tools.py]"]
  node_payout_history["Payout history<br/>[tools.py]"]
  node_policy["Refund policy<br/>[policy.py]"]
end

subgraph group_finance["Payout and operations"]
  node_payout["Payout decision<br/>[tools.py]"]
  node_services["Payment and trace services<br/>[services.py]"]
  node_ops_queue["Ops dispute queue<br/>[tools.py]"]
  node_payswift["PaySwift sandbox"]
end

subgraph group_storage["Persistence"]
  node_models["Domain records<br/>[models.py]"]
  node_database[("PostgreSQL<br/>[session.py]")]
end

node_rider(("Rider"))

node_rider -->|"submits message"| node_service
node_service -.->|"dispatches message"| node_agent_core
node_service -->|"serves dashboard"| node_dashboard
node_agent_core -->|"uses prompt"| node_prompts
node_agent_core -->|"routes tool call"| node_identity
node_agent_core -->|"routes tool call"| node_trip_audit
node_agent_core -->|"routes tool call"| node_payout_history
node_agent_core -->|"routes tool call"| node_payout
node_agent_core -->|"routes tool call"| node_ops_queue
node_identity -->|"reads rider"| node_database
node_trip_audit -->|"reads trip records"| node_database
node_payout_history -->|"reads payout lines"| node_database
node_payout -->|"checks disputes"| node_database
node_payout -->|"requests transfer"| node_services
node_payout -->|"queues approval"| node_ops_queue
node_ops_queue -->|"writes dispute"| node_database
node_services -->|"posts payout"| node_payswift
node_services -->|"records trace"| node_database
node_models -->|"defines tables"| node_database

click node_service "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/main.py"
click node_dashboard "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/ops-ui/index.html"
click node_agent_core "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/core.py"
click node_prompts "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/prompts.py"
click node_identity "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py"
click node_trip_audit "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py"
click node_payout_history "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py"
click node_policy "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/policy.py"
click node_payout "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py"
click node_services "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/services.py"
click node_ops_queue "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py"
click node_payswift "https://github.com/princeverma73/rider-payout-ai-desk/tree/main/payswift"
click node_models "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/db/models.py"
click node_database "https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/db/session.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_service,node_dashboard toneBlue
class node_agent_core,node_prompts,node_identity,node_trip_audit,node_payout_history,node_policy toneAmber
class node_payout,node_services,node_ops_queue,node_payswift toneMint
class node_models,node_database toneRose
class node_rider toneIndigo
```

## Components

### Service and conversations

- [Service API](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/main.py): `app/main.py`
- [Ops dashboard](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/ops-ui/index.html): `ops-ui/index.html`

### Agent and investigation

- [Agent orchestrator](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/core.py): `app/agent/core.py`
- [Conversation prompts](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/prompts.py): `app/agent/prompts.py`
- [Rider lookup](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py): `app/agent/tools.py`
- [Trip and date audit](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py): `app/agent/tools.py`
- [Payout history](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py): `app/agent/tools.py`
- [Refund policy](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/policy.py): `app/agent/policy.py`

### Payout and operations

- [Payout decision](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py): `app/agent/tools.py`
- [Payment and trace services](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/services.py): `app/agent/services.py`
- [Ops dispute queue](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/agent/tools.py): `app/agent/tools.py`
- [PaySwift sandbox](https://github.com/princeverma73/rider-payout-ai-desk/tree/main/payswift): `payswift`

### Persistence

- [Domain records](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/db/models.py): `app/db/models.py`
- [PostgreSQL](https://github.com/princeverma73/rider-payout-ai-desk/blob/main/app/db/session.py): `app/db/session.py`

### Other components

- **Rider**

## Connections

- Rider → Service API: submits message (evidence: `README.md`)
- Service API → Agent orchestrator: dispatches message
- Service API → Ops dashboard: serves dashboard (evidence: `README.md`)
- Agent orchestrator → Conversation prompts: uses prompt (evidence: `app/agent/core.py`)
- Agent orchestrator → Rider lookup: routes tool call (evidence: `app/agent/core.py`)
- Agent orchestrator → Trip and date audit: routes tool call (evidence: `app/agent/core.py`)
- Agent orchestrator → Payout history: routes tool call (evidence: `app/agent/core.py`)
- Agent orchestrator → Payout decision: routes tool call (evidence: `app/agent/core.py`)
- Agent orchestrator → Ops dispute queue: routes tool call (evidence: `app/agent/core.py`)
- Rider lookup → PostgreSQL: reads rider (evidence: `app/agent/tools.py`)
- Trip and date audit → PostgreSQL: reads trip records (evidence: `app/agent/tools.py`)
- Payout history → PostgreSQL: reads payout lines (evidence: `app/agent/tools.py`)
- Payout decision → PostgreSQL: checks disputes (evidence: `app/agent/tools.py`)
- Payout decision → Payment and trace services: requests transfer (evidence: `app/agent/tools.py`)
- Payout decision → Ops dispute queue: queues approval (evidence: `app/agent/tools.py`)
- Ops dispute queue → PostgreSQL: writes dispute (evidence: `app/agent/tools.py`)
- Payment and trace services → PaySwift sandbox: posts payout (evidence: `app/agent/services.py`)
- Payment and trace services → PostgreSQL: records trace (evidence: `app/agent/services.py`)
- Domain records → PostgreSQL: defines tables (evidence: `app/db/models.py`)
