# kkrishhhh/vericall architecture

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

- Interactive diagram: https://gitdiagram.com/kkrishhhh/vericall
- Repository: https://github.com/kkrishhhh/vericall

## Overview

Vantage AI is a video-based loan-origination system: a customer starts a video-KYC session, completes a multilingual interview and identity/document checks, then receives a risk-based decision and offer. The FastAPI backend coordinates specialized agents; the frontend provides the call and admin experiences. README capabilities fill in several agent responsibilities, but sampled backend excerpts are partial, so uncertain module wiring is omitted.

Main entry points: [`backend/main.py`](https://github.com/kkrishhhh/vericall/blob/main/backend/main.py) (FastAPI endpoints), [`backend/agents/orchestrator.py`](https://github.com/kkrishhhh/vericall/blob/main/backend/agents/orchestrator.py) (Agent orchestrator), [`frontend/src/app/call/page.tsx`](https://github.com/kkrishhhh/vericall/blob/main/frontend/src/app/call/page.tsx) (Live KYC call), [`backend/agents/decision_agent.py`](https://github.com/kkrishhhh/vericall/blob/main/backend/agents/decision_agent.py) (Decision agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer experience"]
  node_landing["Video KYC entry<br/>[page.tsx]"]
  node_call["Live KYC call<br/>[page.tsx]"]
  node_stt["Speech recognition<br/>[sttService.ts]"]
  node_dashboard["Admin portal<br/>[page.tsx]"]
end

subgraph group_workflow["Agent workflow"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_orchestrator["Agent orchestrator<br/>[orchestrator.py]"]
  node_interview["Interview agent<br/>[interview_agent.py]"]
end

subgraph group_verification["Verification and decisions"]
  node_kyc["KYC agent<br/>[kyc_agent.py]"]
  node_documents["Document agent<br/>[document_agent.py]"]
  node_extraction["OCR extraction<br/>[extraction.py]"]
  node_vision["Face and liveness<br/>[vision.py]"]
  node_fraud["Fraud checks<br/>[fraud.py]"]
  node_decision["Decision agent<br/>[decision_agent.py]"]
  node_risk["Risk scoring<br/>[risk_engine.py]"]
  node_offer["Loan offer<br/>[offer.py]"]
  node_rag["RBI policy RAG<br/>[rag_agent.py]"]
end

subgraph group_operations["Review and records"]
  node_review["Human review queue"]
  node_analytics["Analytics<br/>[analytics.py]"]
  node_consent["Consent records<br/>[consent_manager.py]"]
  node_audit[("Audit session log<br/>[session_log.py]")]
end

node_customer(("Customer"))
node_admin(("Review officer"))
node_deepgram["Deepgram STT"]
node_daily["Daily video rooms"]
node_sqlite[("SQLite audit store")]

node_customer -->|"starts application"| node_landing
node_landing -->|"requests video KYC"| node_call
node_customer -->|"joins and responds"| node_call
node_call -->|"submits session actions"| node_api
node_call -->|"streams microphone audio"| node_stt
node_stt -.->|"sends audio"| node_deepgram
node_call -.->|"connects video room"| node_daily
node_api -->|"delegates session action"| node_orchestrator
node_orchestrator -->|"dispatches interview"| node_interview
node_orchestrator -->|"dispatches identity checks"| node_kyc
node_orchestrator -->|"dispatches document checks"| node_documents
node_orchestrator -->|"dispatches decision"| node_decision
node_documents -->|"extracts document fields"| node_extraction
node_kyc -->|"checks face and liveness"| node_vision
node_kyc -->|"checks fraud signals"| node_fraud
node_decision -->|"scores application risk"| node_risk
node_decision -->|"generates offer"| node_offer
node_decision -->|"retrieves policy citations"| node_rag
node_api -->|"records consent"| node_consent
node_api -->|"persists session"| node_audit
node_consent -->|"writes consent records"| node_sqlite
node_audit -->|"writes audit sessions"| node_sqlite
node_api -->|"escalates flagged cases"| node_review
node_admin -->|"reviews cases"| node_dashboard
node_dashboard -->|"requests review and analytics"| node_api
node_api -->|"serves analytics"| node_analytics

click node_landing "https://github.com/kkrishhhh/vericall/blob/main/frontend/src/app/page.tsx"
click node_call "https://github.com/kkrishhhh/vericall/blob/main/frontend/src/app/call/page.tsx"
click node_stt "https://github.com/kkrishhhh/vericall/blob/main/frontend/src/lib/sttService.ts"
click node_dashboard "https://github.com/kkrishhhh/vericall/blob/main/frontend/src/app/admin/page.tsx"
click node_api "https://github.com/kkrishhhh/vericall/blob/main/backend/main.py"
click node_orchestrator "https://github.com/kkrishhhh/vericall/blob/main/backend/agents/orchestrator.py"
click node_interview "https://github.com/kkrishhhh/vericall/blob/main/backend/agents/interview_agent.py"
click node_kyc "https://github.com/kkrishhhh/vericall/blob/main/backend/agents/kyc_agent.py"
click node_documents "https://github.com/kkrishhhh/vericall/blob/main/backend/agents/document_agent.py"
click node_extraction "https://github.com/kkrishhhh/vericall/blob/main/backend/extraction.py"
click node_vision "https://github.com/kkrishhhh/vericall/blob/main/backend/vision.py"
click node_fraud "https://github.com/kkrishhhh/vericall/blob/main/backend/fraud.py"
click node_decision "https://github.com/kkrishhhh/vericall/blob/main/backend/agents/decision_agent.py"
click node_risk "https://github.com/kkrishhhh/vericall/blob/main/backend/services/risk_engine.py"
click node_offer "https://github.com/kkrishhhh/vericall/blob/main/backend/offer.py"
click node_rag "https://github.com/kkrishhhh/vericall/blob/main/backend/agents/rag_agent.py"
click node_review "https://github.com/kkrishhhh/vericall/blob/main/backend/services/human_review_queue.py"
click node_analytics "https://github.com/kkrishhhh/vericall/blob/main/backend/services/analytics.py"
click node_consent "https://github.com/kkrishhhh/vericall/blob/main/backend/services/consent_manager.py"
click node_audit "https://github.com/kkrishhhh/vericall/blob/main/backend/session_log.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_landing,node_call,node_stt,node_dashboard,node_admin toneBlue
class node_api,node_orchestrator,node_interview,node_sqlite toneAmber
class node_kyc,node_documents,node_extraction,node_vision,node_fraud,node_decision,node_risk,node_offer,node_rag toneMint
class node_review,node_analytics,node_consent,node_audit toneRose
class node_customer,node_deepgram,node_daily toneIndigo
```

## Components

### Customer experience

- [Video KYC entry](https://github.com/kkrishhhh/vericall/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Live KYC call](https://github.com/kkrishhhh/vericall/blob/main/frontend/src/app/call/page.tsx): `frontend/src/app/call/page.tsx`
- [Speech recognition](https://github.com/kkrishhhh/vericall/blob/main/frontend/src/lib/sttService.ts): `frontend/src/lib/sttService.ts`
- [Admin portal](https://github.com/kkrishhhh/vericall/blob/main/frontend/src/app/admin/page.tsx): `frontend/src/app/admin/page.tsx`

### Agent workflow

- [FastAPI endpoints](https://github.com/kkrishhhh/vericall/blob/main/backend/main.py): `backend/main.py`
- [Agent orchestrator](https://github.com/kkrishhhh/vericall/blob/main/backend/agents/orchestrator.py): `backend/agents/orchestrator.py`
- [Interview agent](https://github.com/kkrishhhh/vericall/blob/main/backend/agents/interview_agent.py): `backend/agents/interview_agent.py`

### Verification and decisions

- [KYC agent](https://github.com/kkrishhhh/vericall/blob/main/backend/agents/kyc_agent.py): `backend/agents/kyc_agent.py`
- [Document agent](https://github.com/kkrishhhh/vericall/blob/main/backend/agents/document_agent.py): `backend/agents/document_agent.py`
- [OCR extraction](https://github.com/kkrishhhh/vericall/blob/main/backend/extraction.py): `backend/extraction.py`
- [Face and liveness](https://github.com/kkrishhhh/vericall/blob/main/backend/vision.py): `backend/vision.py`
- [Fraud checks](https://github.com/kkrishhhh/vericall/blob/main/backend/fraud.py): `backend/fraud.py`
- [Decision agent](https://github.com/kkrishhhh/vericall/blob/main/backend/agents/decision_agent.py): `backend/agents/decision_agent.py`
- [Risk scoring](https://github.com/kkrishhhh/vericall/blob/main/backend/services/risk_engine.py): `backend/services/risk_engine.py`
- [Loan offer](https://github.com/kkrishhhh/vericall/blob/main/backend/offer.py): `backend/offer.py`
- [RBI policy RAG](https://github.com/kkrishhhh/vericall/blob/main/backend/agents/rag_agent.py): `backend/agents/rag_agent.py`

### Review and records

- [Human review queue](https://github.com/kkrishhhh/vericall/blob/main/backend/services/human_review_queue.py): `backend/services/human_review_queue.py`
- [Analytics](https://github.com/kkrishhhh/vericall/blob/main/backend/services/analytics.py): `backend/services/analytics.py`
- [Consent records](https://github.com/kkrishhhh/vericall/blob/main/backend/services/consent_manager.py): `backend/services/consent_manager.py`
- [Audit session log](https://github.com/kkrishhhh/vericall/blob/main/backend/session_log.py): `backend/session_log.py`

### Other components

- **Customer**
- **Review officer**
- **Deepgram STT**
- **Daily video rooms**
- **SQLite audit store**

## Connections

- Customer → Video KYC entry: starts application
- Video KYC entry → Live KYC call: requests video KYC
- Customer → Live KYC call: joins and responds
- Live KYC call → FastAPI endpoints: submits session actions
- Live KYC call → Speech recognition: streams microphone audio
- Speech recognition → Deepgram STT: sends audio
- Live KYC call → Daily video rooms: connects video room
- FastAPI endpoints → Agent orchestrator: delegates session action
- Agent orchestrator → Interview agent: dispatches interview
- Agent orchestrator → KYC agent: dispatches identity checks
- Agent orchestrator → Document agent: dispatches document checks
- Agent orchestrator → Decision agent: dispatches decision
- Document agent → OCR extraction: extracts document fields
- KYC agent → Face and liveness: checks face and liveness
- KYC agent → Fraud checks: checks fraud signals
- Decision agent → Risk scoring: scores application risk
- Decision agent → Loan offer: generates offer
- Decision agent → RBI policy RAG: retrieves policy citations
- FastAPI endpoints → Consent records: records consent
- FastAPI endpoints → Audit session log: persists session
- Consent records → SQLite audit store: writes consent records
- Audit session log → SQLite audit store: writes audit sessions
- FastAPI endpoints → Human review queue: escalates flagged cases
- Review officer → Admin portal: reviews cases
- Admin portal → FastAPI endpoints: requests review and analytics
- FastAPI endpoints → Analytics: serves analytics
