# gallaxz-lab/nexus-enterprise-ai architecture

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

- Interactive diagram: https://gitdiagram.com/gallaxz-lab/nexus-enterprise-ai
- Repository: https://github.com/gallaxz-lab/nexus-enterprise-ai

## Overview

Nexus Enterprise AI is a multi-tenant FastAPI platform for recruitment evaluation, financial-document auditing, and knowledge-grounded customer support. Users enter through the API; each domain router coordinates its workflow and returns structured results, with shared persistence, authentication, and LLM services. The README documents the intended end-to-end workflows, while source excerpts and the SOURCE INDEX support the concrete routing and selected service relationships. Some unsampled subsystem behavior and integrations are therefore shown only where documented.

Main entry points: [`app/main.py`](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/main.py) (FastAPI Application), [`app/core/database/connection.py`](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/database/connection.py) (Application Database), [`app/modules/audit/router.py`](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/audit/router.py) (Audit API), [`app/modules/support/router.py`](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/router.py) (Support API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform Core"]
  node_api["FastAPI Application<br/>[main.py]"]
  node_auth_api["Auth &amp; Org API<br/>[auth.py]"]
  node_auth_service["Auth Service<br/>[auth_service.py]"]
  node_authz["Identity &amp; Access<br/>[auth_deps.py]"]
  node_db[("Application Database<br/>[connection.py]")]
  node_llm["LLM &amp; Embeddings<br/>[llm.py]"]
end

subgraph group_talent["Nexus Talent"]
  node_talent_api["Talent API<br/>[router.py]"]
  node_candidate_api["Candidate Workflow API<br/>[router.py]"]
  node_candidate_eval["Candidate Evaluation<br/>[services.py]"]
  node_job_api["Job Workflow API<br/>[router.py]"]
  node_job_analysis["Job Extraction &amp; Matching<br/>[services.py]"]
end

subgraph group_audit["Nexus Audit"]
  node_audit_api["Audit API<br/>[router.py]"]
  node_audit_graph{{"Audit Workflow Graph<br/>[graph.py]"}}
  node_reconcile["Discrepancy Reconciliation<br/>[services.py]"]
  node_audit_docs["Financial Document Processing<br/>[services.py]"]
end

subgraph group_support["Nexus Support"]
  node_support_api["Support API<br/>[router.py]"]
  node_support_docs["Knowledge Document Processing<br/>[services.py]"]
  node_rag["Knowledge Retrieval &amp; Answers<br/>[services.py]"]
  node_search["Knowledge Search<br/>[services.py]"]
  node_agent{{"Support Agent<br/>[agent.py]"}}
end

node_users(("Users / Clients"))

node_users -->|"submit requests"| node_api
node_api -->|"registers routes"| node_auth_api
node_api -->|"registers routes"| node_talent_api
node_api -->|"registers routes"| node_audit_api
node_api -->|"registers routes"| node_support_api
node_auth_api -->|"calls"| node_auth_service
node_auth_service -->|"queries and writes"| node_db
node_auth_api -->|"uses identity dependency"| node_authz
node_talent_api -->|"registers routes"| node_candidate_api
node_talent_api -->|"registers routes"| node_job_api
node_candidate_api -->|"calls"| node_candidate_eval
node_candidate_eval -->|"generates evaluation"| node_llm
node_candidate_eval -->|"reads and stores results"| node_db
node_job_api -->|"calls"| node_job_analysis
node_job_analysis -->|"extracts and embeds"| node_llm
node_job_analysis -->|"reads and stores profiles"| node_db
node_audit_api -->|"invokes workflow"| node_audit_graph
node_audit_api -->|"loads documents and saves workflow"| node_db
node_audit_graph -->|"uses reconciliation"| node_reconcile
node_audit_graph -->|"requests analysis"| node_llm
node_audit_api -.->|"document workflow capability"| node_audit_docs
node_support_api -->|"processes uploaded documents"| node_support_docs
node_support_api -->|"answers knowledge queries"| node_rag
node_rag -->|"retrieves context"| node_search
node_search -->|"searches knowledge records"| node_db
node_rag -->|"generates grounded answer"| node_llm
node_support_api -->|"invokes agent workflow"| node_agent
node_agent -->|"uses retrieval"| node_search

click node_api "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/main.py"
click node_auth_api "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/routers/auth.py"
click node_auth_service "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/services/auth_service.py"
click node_authz "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/dependencies/auth_deps.py"
click node_db "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/database/connection.py"
click node_llm "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/ai_factory/llm.py"
click node_talent_api "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/talent/router.py"
click node_candidate_api "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/talent/candidates/router.py"
click node_candidate_eval "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/talent/candidates/services.py"
click node_job_api "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/talent/jobs/router.py"
click node_job_analysis "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/talent/jobs/services.py"
click node_audit_api "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/audit/router.py"
click node_audit_graph "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/audit/audits/graph.py"
click node_reconcile "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/audit/audits/services.py"
click node_audit_docs "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/audit/documents/services.py"
click node_support_api "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/router.py"
click node_support_docs "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/documents/services.py"
click node_rag "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/knowledge/services.py"
click node_search "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/search/services.py"
click node_agent "https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/knowledge/agent.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_api,node_auth_api,node_auth_service,node_authz,node_db,node_llm,node_users toneBlue
class node_talent_api,node_candidate_api,node_candidate_eval,node_job_api,node_job_analysis toneAmber
class node_audit_api,node_audit_graph,node_reconcile,node_audit_docs toneMint
class node_support_api,node_support_docs,node_rag,node_search,node_agent toneRose
```

## Components

### Platform Core

- [FastAPI Application](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/main.py): `app/main.py`
- [Auth & Org API](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/routers/auth.py): `app/core/routers/auth.py`
- [Auth Service](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/services/auth_service.py): `app/core/services/auth_service.py`
- [Identity & Access](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/dependencies/auth_deps.py): `app/core/dependencies/auth_deps.py`
- [Application Database](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/database/connection.py): `app/core/database/connection.py`
- [LLM & Embeddings](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/core/ai_factory/llm.py): `app/core/ai_factory/llm.py`

### Nexus Talent

- [Talent API](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/talent/router.py): `app/modules/talent/router.py`
- [Candidate Workflow API](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/talent/candidates/router.py): `app/modules/talent/candidates/router.py`
- [Candidate Evaluation](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/talent/candidates/services.py): `app/modules/talent/candidates/services.py`
- [Job Workflow API](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/talent/jobs/router.py): `app/modules/talent/jobs/router.py`
- [Job Extraction & Matching](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/talent/jobs/services.py): `app/modules/talent/jobs/services.py`

### Nexus Audit

- [Audit API](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/audit/router.py): `app/modules/audit/router.py`
- [Audit Workflow Graph](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/audit/audits/graph.py): `app/modules/audit/audits/graph.py`
- [Discrepancy Reconciliation](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/audit/audits/services.py): `app/modules/audit/audits/services.py`
- [Financial Document Processing](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/audit/documents/services.py): `app/modules/audit/documents/services.py`

### Nexus Support

- [Support API](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/router.py): `app/modules/support/router.py`
- [Knowledge Document Processing](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/documents/services.py): `app/modules/support/documents/services.py`
- [Knowledge Retrieval & Answers](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/knowledge/services.py): `app/modules/support/knowledge/services.py`
- [Knowledge Search](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/search/services.py): `app/modules/support/search/services.py`
- [Support Agent](https://github.com/gallaxz-lab/nexus-enterprise-ai/blob/main/app/modules/support/knowledge/agent.py): `app/modules/support/knowledge/agent.py`

### Other components

- **Users / Clients**

## Connections

- Users / Clients → FastAPI Application: submit requests (evidence: `README.md`)
- FastAPI Application → Auth & Org API: registers routes (evidence: `app/main.py`)
- FastAPI Application → Talent API: registers routes (evidence: `app/main.py`)
- FastAPI Application → Audit API: registers routes (evidence: `app/main.py`)
- FastAPI Application → Support API: registers routes (evidence: `app/main.py`)
- Auth & Org API → Auth Service: calls (evidence: `app/core/routers/auth.py`)
- Auth Service → Application Database: queries and writes (evidence: `app/core/services/auth_service.py`)
- Auth & Org API → Identity & Access: uses identity dependency (evidence: `app/core/routers/auth.py`)
- Talent API → Candidate Workflow API: registers routes (evidence: `app/modules/talent/router.py`)
- Talent API → Job Workflow API: registers routes (evidence: `app/modules/talent/router.py`)
- Candidate Workflow API → Candidate Evaluation: calls (evidence: `app/modules/talent/candidates/router.py`)
- Candidate Evaluation → LLM & Embeddings: generates evaluation (evidence: `app/modules/talent/candidates/services.py`)
- Candidate Evaluation → Application Database: reads and stores results (evidence: `app/modules/talent/candidates/services.py`)
- Job Workflow API → Job Extraction & Matching: calls (evidence: `app/modules/talent/jobs/router.py`)
- Job Extraction & Matching → LLM & Embeddings: extracts and embeds (evidence: `app/modules/talent/jobs/services.py`)
- Job Extraction & Matching → Application Database: reads and stores profiles (evidence: `app/modules/talent/jobs/services.py`)
- Audit API → Audit Workflow Graph: invokes workflow (evidence: `app/modules/audit/router.py`)
- Audit API → Application Database: loads documents and saves workflow (evidence: `app/modules/audit/router.py`)
- Audit Workflow Graph → Discrepancy Reconciliation: uses reconciliation (evidence: `app/modules/audit/audits/graph.py`)
- Audit Workflow Graph → LLM & Embeddings: requests analysis (evidence: `app/modules/audit/audits/graph.py`)
- Audit API → Financial Document Processing: document workflow capability (evidence: `README.md`)
- Support API → Knowledge Document Processing: processes uploaded documents (evidence: `app/modules/support/router.py`)
- Support API → Knowledge Retrieval & Answers: answers knowledge queries (evidence: `app/modules/support/router.py`)
- Knowledge Retrieval & Answers → Knowledge Search: retrieves context (evidence: `app/modules/support/knowledge/services.py`)
- Knowledge Search → Application Database: searches knowledge records (evidence: `app/modules/support/search/services.py`)
- Knowledge Retrieval & Answers → LLM & Embeddings: generates grounded answer (evidence: `app/modules/support/knowledge/services.py`)
- Support API → Support Agent: invokes agent workflow (evidence: `app/modules/support/router.py`)
- Support Agent → Knowledge Search: uses retrieval (evidence: `app/modules/support/knowledge/agent.py`)
