# anmol1578/vortex-multi-agent-ai architecture

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

- Interactive diagram: https://gitdiagram.com/anmol1578/vortex-multi-agent-ai
- Repository: https://github.com/anmol1578/vortex-multi-agent-ai
- Video tour (about a minute): https://gitdiagram.com/anmol1578/vortex-multi-agent-ai/video

## Overview

Vortex is a React-based multi-agent AI platform. A user signs in, opens a conversation, and sends a prompt or attachment; the gateway authenticates and proxies the request to the agent service, whose graph routes work through credit checks to a specialist and returns text or artifacts. Chat persistence, account identity, billing, and retrieval are distinct supporting capabilities. Relationships among gateway routes, graph nodes, and major product capabilities are documented in the README; unsampled implementation details are not inferred.

Main entry points: [`backend/services/agent/graph/graph.js`](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/graph/graph.js) (State graph), [`backend/gateway/index.js`](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/gateway/index.js) (API gateway), [`backend/services/auth/controllers/auth.controller.js`](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/auth/controllers/auth.controller.js) (Authentication), [`backend/services/billing/controllers/billing.controller.js`](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/billing/controllers/billing.controller.js) (Plans and payments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_chatui["Chat interface<br/>[ChatArea.jsx]"]
  node_artifacts["Artifact panel<br/>[ArtifactPanel.jsx]"]
  node_billingui["Billing drawer<br/>[BillingDrawer.jsx]"]
end

subgraph group_edge["Gateway"]
  node_gateway["API gateway<br/>[index.js]"]
  node_authmiddleware["Session protection<br/>[auth.middleware.js]"]
end

subgraph group_agents["Agent orchestration"]
  node_agentcontroller["Agent endpoint"]
  node_graph["State graph<br/>[graph.js]"]
  node_router["Intent router<br/>[router.js]"]
  node_credit["Credit gate<br/>[credit.agent.js]"]
  node_chatagent["Chat and search<br/>[chat.agent.js]"]
  node_coding["Coding agent<br/>[coding.agent.js]"]
  node_pdf["PDF generation<br/>[pdf.agent.js]"]
  node_pdfrag["PDF retrieval<br/>[pdfRag.agent.js]"]
  node_ppt["Slide generation<br/>[ppt.agent.js]"]
  node_vision["Image generation<br/>[vision.agent.js]"]
  node_imageanalyzer["Image analysis"]
  node_models["Model selection<br/>[llmModels.js]"]
end

subgraph group_platform["Platform services"]
  node_auth["Authentication<br/>[auth.controller.js]"]
  node_chatservice["Conversation service<br/>[chat.controller.js]"]
  node_billing["Plans and payments"]
end

subgraph group_infra["Data and integrations"]
  node_userdb[("User records<br/>[user.model.js]")]
  node_conversations[("Conversation records")]
  node_messages[("Message records<br/>[message.model.js]")]
  node_payments[("Payment records<br/>[payment.model.js]")]
  node_redis[("Redis<br/>[redis.js]")]
  node_qdrant[("Qdrant<br/>[vectorDb.js]")]
  node_s3[("S3 artifact storage<br/>[s3.js]")]
  node_firebase["Firebase identity<br/>[firebase.js]"]
  node_razorpay["Razorpay<br/>[razorpay.js]"]
end

node_user(("User"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_chatui
node_chatui -->|"sends requests"| node_gateway
node_gateway -->|"protects routes"| node_authmiddleware
node_gateway -->|"proxies auth"| node_auth
node_gateway -->|"proxies chat"| node_chatservice
node_gateway -->|"proxies agents"| node_agentcontroller
node_gateway -->|"proxies billing"| node_billing
node_authmiddleware -->|"checks sessions"| node_redis
node_auth -->|"verifies identity"| node_firebase
node_auth -->|"reads and writes"| node_userdb
node_auth -->|"stores sessions"| node_redis
node_agentcontroller -->|"invokes"| node_graph
node_agentcontroller -->|"saves messages"| node_chatservice
node_graph -->|"routes through"| node_router
node_graph -->|"dispatches"| node_credit
node_graph -->|"dispatches"| node_chatagent
node_graph -->|"dispatches"| node_coding
node_graph -->|"dispatches"| node_pdf
node_graph -->|"dispatches"| node_pdfrag
node_graph -->|"dispatches"| node_ppt
node_graph -->|"dispatches"| node_vision
node_graph -->|"dispatches"| node_imageanalyzer
node_router -->|"selects model"| node_models
node_chatservice -->|"reads and writes"| node_conversations
node_chatservice -->|"reads and writes"| node_messages
node_billingui -->|"requests billing"| node_gateway
node_billing -->|"records payments"| node_payments
node_billing -->|"creates orders"| node_razorpay
node_billing -->|"updates user plan"| node_auth
node_artifacts -->|"shows outputs"| node_chatui
node_pdfrag -->|"retrieves context"| node_qdrant
node_ppt -.->|"stores artifacts"| node_s3
node_vision -.->|"stores images"| node_s3

click node_dashboard "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/frontend/src/pages/Dashboard.jsx"
click node_chatui "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/frontend/src/components/ChatArea.jsx"
click node_artifacts "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/frontend/src/components/ArtifactPanel.jsx"
click node_billingui "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/frontend/src/components/BillingDrawer.jsx"
click node_gateway "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/gateway/index.js"
click node_authmiddleware "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/gateway/middleware/auth.middleware.js"
click node_auth "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/auth/controllers/auth.controller.js"
click node_chatservice "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/chat/controllers/chat.controller.js"
click node_billing "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/billing/controllers/billing.controller.js"
click node_agentcontroller "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/controllers/agent.controller.js"
click node_graph "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/graph/graph.js"
click node_router "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/graph/router.js"
click node_credit "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/credit.agent.js"
click node_chatagent "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/chat.agent.js"
click node_coding "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/coding.agent.js"
click node_pdf "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/pdf.agent.js"
click node_pdfrag "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/pdfRag.agent.js"
click node_ppt "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/ppt.agent.js"
click node_vision "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/vision.agent.js"
click node_imageanalyzer "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/imageAnalyzer.agent.js"
click node_models "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/config/llmModels.js"
click node_userdb "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/auth/models/user.model.js"
click node_conversations "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/chat/models/conversation.model.js"
click node_messages "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/chat/models/message.model.js"
click node_payments "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/billing/models/payment.model.js"
click node_redis "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/shared/redis/redis.js"
click node_qdrant "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/config/vectorDb.js"
click node_s3 "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/config/s3.js"
click node_firebase "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/auth/config/firebase.js"
click node_razorpay "https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/billing/config/razorpay.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_dashboard,node_chatui,node_artifacts,node_billingui,node_user toneBlue
class node_gateway,node_authmiddleware toneAmber
class node_agentcontroller,node_graph,node_router,node_credit,node_chatagent,node_coding,node_pdf,node_pdfrag,node_ppt,node_vision,node_imageanalyzer,node_models toneMint
class node_auth,node_chatservice,node_billing toneRose
class node_userdb,node_conversations,node_messages,node_payments,node_redis,node_qdrant,node_s3,node_firebase,node_razorpay toneIndigo
```

## Components

### Client

- [Dashboard](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Chat interface](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/frontend/src/components/ChatArea.jsx): `frontend/src/components/ChatArea.jsx`
- [Artifact panel](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/frontend/src/components/ArtifactPanel.jsx): `frontend/src/components/ArtifactPanel.jsx`
- [Billing drawer](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/frontend/src/components/BillingDrawer.jsx): `frontend/src/components/BillingDrawer.jsx`

### Gateway

- [API gateway](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/gateway/index.js): `backend/gateway/index.js`
- [Session protection](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/gateway/middleware/auth.middleware.js): `backend/gateway/middleware/auth.middleware.js`

### Agent orchestration

- [Agent endpoint](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/controllers/agent.controller.js): `backend/services/agent/controllers/agent.controller.js`
- [State graph](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/graph/graph.js): `backend/services/agent/graph/graph.js`
- [Intent router](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/graph/router.js): `backend/services/agent/graph/router.js`
- [Credit gate](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/credit.agent.js): `backend/services/agent/agents/credit.agent.js`
- [Chat and search](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/chat.agent.js): `backend/services/agent/agents/chat.agent.js`
- [Coding agent](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/coding.agent.js): `backend/services/agent/agents/coding.agent.js`
- [PDF generation](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/pdf.agent.js): `backend/services/agent/agents/pdf.agent.js`
- [PDF retrieval](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/pdfRag.agent.js): `backend/services/agent/agents/pdfRag.agent.js`
- [Slide generation](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/ppt.agent.js): `backend/services/agent/agents/ppt.agent.js`
- [Image generation](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/vision.agent.js): `backend/services/agent/agents/vision.agent.js`
- [Image analysis](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/agents/imageAnalyzer.agent.js): `backend/services/agent/agents/imageAnalyzer.agent.js`
- [Model selection](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/config/llmModels.js): `backend/services/agent/config/llmModels.js`

### Platform services

- [Authentication](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/auth/controllers/auth.controller.js): `backend/services/auth/controllers/auth.controller.js`
- [Conversation service](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/chat/controllers/chat.controller.js): `backend/services/chat/controllers/chat.controller.js`
- [Plans and payments](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/billing/controllers/billing.controller.js): `backend/services/billing/controllers/billing.controller.js`

### Data and integrations

- [User records](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/auth/models/user.model.js): `backend/services/auth/models/user.model.js`
- [Conversation records](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/chat/models/conversation.model.js): `backend/services/chat/models/conversation.model.js`
- [Message records](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/chat/models/message.model.js): `backend/services/chat/models/message.model.js`
- [Payment records](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/billing/models/payment.model.js): `backend/services/billing/models/payment.model.js`
- [Redis](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/shared/redis/redis.js): `backend/shared/redis/redis.js`
- [Qdrant](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/config/vectorDb.js): `backend/services/agent/config/vectorDb.js`
- [S3 artifact storage](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/agent/config/s3.js): `backend/services/agent/config/s3.js`
- [Firebase identity](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/auth/config/firebase.js): `backend/services/auth/config/firebase.js`
- [Razorpay](https://github.com/anmol1578/vortex-multi-agent-ai/blob/main/backend/services/billing/config/razorpay.js): `backend/services/billing/config/razorpay.js`

### Other components

- **User**

## Connections

- User → Dashboard: uses
- Dashboard → Chat interface: renders (evidence: `frontend/src/pages/Dashboard.jsx`)
- Chat interface → API gateway: sends requests
- API gateway → Session protection: protects routes (evidence: `backend/gateway/index.js`)
- API gateway → Authentication: proxies auth (evidence: `backend/gateway/index.js`)
- API gateway → Conversation service: proxies chat (evidence: `backend/gateway/index.js`)
- API gateway → Agent endpoint: proxies agents (evidence: `backend/gateway/index.js`)
- API gateway → Plans and payments: proxies billing (evidence: `backend/gateway/index.js`)
- Session protection → Redis: checks sessions (evidence: `backend/gateway/middleware/auth.middleware.js`)
- Authentication → Firebase identity: verifies identity (evidence: `backend/services/auth/controllers/auth.controller.js`)
- Authentication → User records: reads and writes (evidence: `backend/services/auth/controllers/auth.controller.js`)
- Authentication → Redis: stores sessions (evidence: `backend/services/auth/controllers/auth.controller.js`)
- Agent endpoint → State graph: invokes (evidence: `backend/services/agent/controllers/agent.controller.js`)
- Agent endpoint → Conversation service: saves messages (evidence: `backend/services/agent/controllers/agent.controller.js`)
- State graph → Intent router: routes through (evidence: `backend/services/agent/graph/graph.js`)
- State graph → Credit gate: dispatches (evidence: `backend/services/agent/graph/graph.js`)
- State graph → Chat and search: dispatches (evidence: `backend/services/agent/graph/graph.js`)
- State graph → Coding agent: dispatches (evidence: `backend/services/agent/graph/graph.js`)
- State graph → PDF generation: dispatches (evidence: `backend/services/agent/graph/graph.js`)
- State graph → PDF retrieval: dispatches (evidence: `backend/services/agent/graph/graph.js`)
- State graph → Slide generation: dispatches (evidence: `backend/services/agent/graph/graph.js`)
- State graph → Image generation: dispatches (evidence: `backend/services/agent/graph/graph.js`)
- State graph → Image analysis: dispatches (evidence: `backend/services/agent/graph/graph.js`)
- Intent router → Model selection: selects model (evidence: `backend/services/agent/graph/router.js`)
- Conversation service → Conversation records: reads and writes (evidence: `backend/services/chat/controllers/chat.controller.js`)
- Conversation service → Message records: reads and writes (evidence: `backend/services/chat/controllers/chat.controller.js`)
- Billing drawer → API gateway: requests billing
- Plans and payments → Payment records: records payments (evidence: `backend/services/billing/controllers/billing.controller.js`)
- Plans and payments → Razorpay: creates orders (evidence: `backend/services/billing/controllers/billing.controller.js`)
- Plans and payments → Authentication: updates user plan (evidence: `backend/services/billing/controllers/billing.controller.js`)
- Artifact panel → Chat interface: shows outputs
- PDF retrieval → Qdrant: retrieves context (evidence: `backend/services/agent/agents/pdfRag.agent.js`)
- Slide generation → S3 artifact storage: stores artifacts
- Image generation → S3 artifact storage: stores images
