# piyushdeshmukh-apperentice/automated_kyc_management architecture

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

- Interactive diagram: https://gitdiagram.com/piyushdeshmukh-apperentice/automated_kyc_management
- Repository: https://github.com/piyushdeshmukh-apperentice/automated_kyc_management

## Overview

This repository appears to provide mock KYC data services, shared workflow storage, and JSON configurations for KYC agents. A visible service workflow is request-to-document retrieval: clients call identity or financial-data endpoints, which return files from customer datasets. Shared-memory endpoints create sessions and store raw data or agent messages in PostgreSQL. The agent configurations suggest additional review and decision stages, but no orchestration or agent execution code is present in the supplied excerpts, so those connections are not asserted.

Main entry points: [`services/shared_memory_service/main.py`](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/shared_memory_service/main.py) (Workflow memory API), [`services/digilocker_service/main.py`](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/digilocker_service/main.py) (Identity documents), [`services/account_aggregator_service/main.py`](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/account_aggregator_service/main.py) (Financial records), [`services/shared_memory_service/db.py`](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/shared_memory_service/db.py) (Database session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Client access"]
end

subgraph group_retrieval["Data retrieval"]
  node_identity_api["Identity documents<br/>[main.py]"]
  node_file_readers["Document readers<br/>[utils.py]"]
  node_financial_api["Financial records<br/>[main.py]"]
  node_customer_datasets["Customer datasets"]
  node_profile_api["Customer profile<br/>[main.py]"]
end

subgraph group_workflow["KYC workflow"]
  node_agent_configs["KYC agent roles"]
end

subgraph group_storage["Workflow storage"]
  node_shared_api["Workflow memory API<br/>[main.py]"]
  node_request_schemas["Request schemas<br/>[schemas.py]"]
  node_orm_models["Workflow records<br/>[models.py]"]
  node_db_session["Database session<br/>[db.py]"]
  node_postgres[("PostgreSQL")]
end

node_client(("Client"))

node_client -->|"requests documents"| node_identity_api
node_identity_api -->|"reads files"| node_file_readers
node_identity_api -->|"loads documents"| node_customer_datasets
node_client -->|"requests records"| node_financial_api
node_financial_api -->|"parses JSON"| node_file_readers
node_financial_api -->|"loads records"| node_customer_datasets
node_client -->|"requests profile"| node_profile_api
node_client -->|"submits workflow data"| node_shared_api
node_shared_api -->|"validates requests"| node_request_schemas
node_shared_api -->|"creates records"| node_orm_models
node_shared_api -->|"opens sessions"| node_db_session
node_db_session -->|"connects to"| node_postgres

click node_identity_api "https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/digilocker_service/main.py"
click node_file_readers "https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/digilocker_service/utils.py"
click node_financial_api "https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/account_aggregator_service/main.py"
click node_customer_datasets "https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/tree/master/datasets"
click node_profile_api "https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/customer_profile_service/main.py"
click node_agent_configs "https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/tree/master/agents"
click node_shared_api "https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/shared_memory_service/main.py"
click node_request_schemas "https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/shared_memory_service/schemas.py"
click node_orm_models "https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/shared_memory_service/models.py"
click node_db_session "https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/shared_memory_service/db.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_identity_api,node_file_readers,node_financial_api,node_customer_datasets,node_profile_api toneAmber
class node_agent_configs toneMint
class node_shared_api,node_request_schemas,node_orm_models,node_db_session,node_postgres toneRose
class node_client toneBlue
```

## Components

### Data retrieval

- [Identity documents](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/digilocker_service/main.py): `services/digilocker_service/main.py`
- [Document readers](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/digilocker_service/utils.py): `services/digilocker_service/utils.py`
- [Financial records](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/account_aggregator_service/main.py): `services/account_aggregator_service/main.py`
- [Customer datasets](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/tree/master/datasets): `datasets`
- [Customer profile](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/customer_profile_service/main.py): `services/customer_profile_service/main.py`

### KYC workflow

- [KYC agent roles](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/tree/master/agents): `agents`

### Workflow storage

- [Workflow memory API](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/shared_memory_service/main.py): `services/shared_memory_service/main.py`
- [Request schemas](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/shared_memory_service/schemas.py): `services/shared_memory_service/schemas.py`
- [Workflow records](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/shared_memory_service/models.py): `services/shared_memory_service/models.py`
- [Database session](https://github.com/piyushdeshmukh-apperentice/automated_kyc_management/blob/master/services/shared_memory_service/db.py): `services/shared_memory_service/db.py`
- **PostgreSQL**

### Other components

- **Client**

## Connections

- Client → Identity documents: requests documents (evidence: `services/digilocker_service/main.py`)
- Identity documents → Document readers: reads files (evidence: `services/digilocker_service/main.py`)
- Identity documents → Customer datasets: loads documents (evidence: `services/digilocker_service/main.py`)
- Client → Financial records: requests records (evidence: `services/account_aggregator_service/main.py`)
- Financial records → Document readers: parses JSON (evidence: `services/account_aggregator_service/main.py`)
- Financial records → Customer datasets: loads records (evidence: `services/account_aggregator_service/main.py`)
- Client → Customer profile: requests profile (evidence: `services/customer_profile_service/main.py`)
- Client → Workflow memory API: submits workflow data (evidence: `services/shared_memory_service/main.py`)
- Workflow memory API → Request schemas: validates requests (evidence: `services/shared_memory_service/main.py`)
- Workflow memory API → Workflow records: creates records (evidence: `services/shared_memory_service/main.py`)
- Workflow memory API → Database session: opens sessions (evidence: `services/shared_memory_service/main.py`)
- Database session → PostgreSQL: connects to (evidence: `services/shared_memory_service/db.py`)
