# govindsingh8905/production-ready-multi-agent-ai-platform architecture

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

- Interactive diagram: https://gitdiagram.com/govindsingh8905/production-ready-multi-agent-ai-platform
- Repository: https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform

## Overview

CortexAI is a browser-based AI chat application with Google sign-in, saved conversations, and a multi-agent assistant backend. The main workflow is signing in, selecting or creating a conversation, sending messages, and viewing responses; the agent graph routes requests among chat, search, coding, and artifact-oriented agents. Authentication is backed by Firebase verification and Redis sessions, while chat history uses conversation and message models. The source index documents additional PDF, presentation, and image agent modules, but their runtime details are unsampled; edges are limited to relationships evidenced by excerpts or the index.

Main entry points: [`frontend/src/pages/Home.jsx`](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/pages/Home.jsx) (Home and login), [`Backend/Services/agent/graph/graph.js`](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/graph/graph.js) (Agent workflow graph), [`Backend/Services/auth/controllers/auth.controller.js`](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/auth/controllers/auth.controller.js) (Login and logout), [`frontend/src/components/SideBar.jsx`](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/components/SideBar.jsx) (Conversation sidebar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_home["Home and login<br/>[Home.jsx]"]
  node_sidebar["Conversation sidebar<br/>[SideBar.jsx]"]
  node_chatui["Chat interface<br/>[ChatArea.jsx]"]
  node_composer["Message composer<br/>[ChatInput.jsx]"]
  node_clientfeatures["Conversation API actions"]
  node_clientstate["Client state"]
  node_axios["HTTP client<br/>[axios.js]"]
  node_firebaseclient["Firebase client auth<br/>[firebase.js]"]
end

subgraph group_gateway["Gateway and auth"]
  node_gatewayentry["API gateway<br/>[index.js]"]
  node_authguard["Session guard<br/>[auth.middleware.js]"]
  node_authcontroller["Login and logout<br/>[auth.controller.js]"]
  node_authmodel[("User records<br/>[user.model.js]")]
end

subgraph group_chat["Conversation service"]
  node_chatcontroller["Conversation handlers<br/>[chat.controller.js]"]
  node_conversationmodel[("Conversation records")]
  node_messagemodel[("Message records<br/>[message.model.js]")]
end

subgraph group_agents["AI agent runtime"]
  node_agentcontroller["Agent request handler"]
  node_agentgraph["Agent workflow graph<br/>[graph.js]"]
  node_agentrouting["Intent router<br/>[router.js]"]
  node_chatagent["Chat agent<br/>[chat.agent.js]"]
  node_searchagent["Search agent<br/>[search.agent.js]"]
  node_specialagents["Coding and media agents"]
end

subgraph group_state["Persistence and session state"]
  node_redis[("Redis sessions<br/>[redis.js]")]
end

node_person(("User"))
node_firebaseadmin["Firebase identity"]
node_llm["Language model"]

node_person -->|"uses"| node_home
node_home -->|"starts sign-in"| node_firebaseclient
node_home -->|"posts login"| node_gatewayentry
node_home -->|"renders"| node_sidebar
node_home -->|"renders"| node_chatui
node_sidebar -->|"creates and loads"| node_clientfeatures
node_sidebar -->|"updates"| node_clientstate
node_composer -->|"sends and updates"| node_clientfeatures
node_chatui -->|"renders"| node_composer
node_clientfeatures -->|"sends requests"| node_axios
node_axios -.->|"HTTP requests"| node_gatewayentry
node_gatewayentry -->|"protects routes"| node_authguard
node_authguard -->|"reads sessions"| node_redis
node_authcontroller -->|"verifies token"| node_firebaseadmin
node_authcontroller -->|"finds or creates"| node_authmodel
node_authcontroller -->|"stores and deletes sessions"| node_redis
node_chatcontroller -->|"reads and writes"| node_conversationmodel
node_chatcontroller -->|"reads and writes"| node_messagemodel
node_agentcontroller -->|"invokes"| node_agentgraph
node_agentgraph -->|"routes requests"| node_agentrouting
node_agentrouting -.->|"classifies intent"| node_llm
node_agentgraph -->|"dispatches"| node_chatagent
node_agentgraph -->|"dispatches"| node_searchagent
node_agentgraph -->|"dispatches"| node_specialagents

click node_home "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/pages/Home.jsx"
click node_sidebar "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/components/SideBar.jsx"
click node_chatui "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/components/ChatArea.jsx"
click node_composer "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/components/ChatInput.jsx"
click node_clientfeatures "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/features/createConversation.js"
click node_clientstate "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/redux/conversationSlice.js"
click node_axios "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/utils/axios.js"
click node_firebaseclient "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/utils/firebase.js"
click node_gatewayentry "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Gateway/index.js"
click node_authguard "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Gateway/middleware/auth.middleware.js"
click node_authcontroller "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/auth/controllers/auth.controller.js"
click node_authmodel "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/auth/models/user.model.js"
click node_chatcontroller "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/chat/controllers/chat.controller.js"
click node_conversationmodel "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/chat/models/conversation.model.js"
click node_messagemodel "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/chat/models/message.model.js"
click node_agentcontroller "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/controller/agent.controller.js"
click node_agentgraph "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/graph/graph.js"
click node_agentrouting "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/graph/router.js"
click node_chatagent "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/agents/chat.agent.js"
click node_searchagent "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/agents/search.agent.js"
click node_specialagents "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/tree/main/Backend/Services/agent/agents"
click node_redis "https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Shared/redis/redis.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_home,node_sidebar,node_chatui,node_composer,node_clientfeatures,node_clientstate,node_axios,node_firebaseclient,node_person toneBlue
class node_gatewayentry,node_authguard,node_authcontroller,node_authmodel toneAmber
class node_chatcontroller,node_conversationmodel,node_messagemodel toneMint
class node_agentcontroller,node_agentgraph,node_agentrouting,node_chatagent,node_searchagent,node_specialagents toneRose
class node_redis,node_firebaseadmin,node_llm toneIndigo
```

## Components

### Web client

- [Home and login](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Conversation sidebar](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/components/SideBar.jsx): `frontend/src/components/SideBar.jsx`
- [Chat interface](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/components/ChatArea.jsx): `frontend/src/components/ChatArea.jsx`
- [Message composer](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/components/ChatInput.jsx): `frontend/src/components/ChatInput.jsx`
- [Conversation API actions](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/features/createConversation.js): `frontend/src/features/createConversation.js`
- [Client state](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/src/redux/conversationSlice.js): `frontend/src/redux/conversationSlice.js`
- [HTTP client](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/utils/axios.js): `frontend/utils/axios.js`
- [Firebase client auth](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/frontend/utils/firebase.js): `frontend/utils/firebase.js`

### Gateway and auth

- [API gateway](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Gateway/index.js): `Backend/Gateway/index.js`
- [Session guard](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Gateway/middleware/auth.middleware.js): `Backend/Gateway/middleware/auth.middleware.js`
- [Login and logout](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/auth/controllers/auth.controller.js): `Backend/Services/auth/controllers/auth.controller.js`
- [User records](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/auth/models/user.model.js): `Backend/Services/auth/models/user.model.js`

### Conversation service

- [Conversation handlers](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/chat/controllers/chat.controller.js): `Backend/Services/chat/controllers/chat.controller.js`
- [Conversation records](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/chat/models/conversation.model.js): `Backend/Services/chat/models/conversation.model.js`
- [Message records](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/chat/models/message.model.js): `Backend/Services/chat/models/message.model.js`

### AI agent runtime

- [Agent request handler](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/controller/agent.controller.js): `Backend/Services/agent/controller/agent.controller.js`
- [Agent workflow graph](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/graph/graph.js): `Backend/Services/agent/graph/graph.js`
- [Intent router](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/graph/router.js): `Backend/Services/agent/graph/router.js`
- [Chat agent](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/agents/chat.agent.js): `Backend/Services/agent/agents/chat.agent.js`
- [Search agent](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Services/agent/agents/search.agent.js): `Backend/Services/agent/agents/search.agent.js`
- [Coding and media agents](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/tree/main/Backend/Services/agent/agents): `Backend/Services/agent/agents`

### Persistence and session state

- [Redis sessions](https://github.com/govindsingh8905/production-ready-multi-agent-ai-platform/blob/main/Backend/Shared/redis/redis.js): `Backend/Shared/redis/redis.js`

### Other components

- **User**
- **Firebase identity**
- **Language model**

## Connections

- User → Home and login: uses (evidence: `frontend/src/pages/Home.jsx`)
- Home and login → Firebase client auth: starts sign-in (evidence: `frontend/src/pages/Home.jsx`)
- Home and login → API gateway: posts login (evidence: `frontend/src/pages/Home.jsx`)
- Home and login → Conversation sidebar: renders (evidence: `frontend/src/pages/Home.jsx`)
- Home and login → Chat interface: renders (evidence: `frontend/src/pages/Home.jsx`)
- Conversation sidebar → Conversation API actions: creates and loads (evidence: `frontend/src/components/SideBar.jsx`)
- Conversation sidebar → Client state: updates (evidence: `frontend/src/components/SideBar.jsx`)
- Message composer → Conversation API actions: sends and updates (evidence: `frontend/src/components/ChatInput.jsx`)
- Chat interface → Message composer: renders (evidence: `frontend/src/components/ChatArea.jsx`)
- Conversation API actions → HTTP client: sends requests (evidence: `frontend/src/features/createConversation.js`)
- HTTP client → API gateway: HTTP requests
- API gateway → Session guard: protects routes (evidence: `Backend/Gateway/index.js`)
- Session guard → Redis sessions: reads sessions (evidence: `Backend/Gateway/middleware/auth.middleware.js`)
- Login and logout → Firebase identity: verifies token (evidence: `Backend/Services/auth/controllers/auth.controller.js`)
- Login and logout → User records: finds or creates (evidence: `Backend/Services/auth/controllers/auth.controller.js`)
- Login and logout → Redis sessions: stores and deletes sessions (evidence: `Backend/Services/auth/controllers/auth.controller.js`)
- Conversation handlers → Conversation records: reads and writes (evidence: `Backend/Services/chat/controllers/chat.controller.js`)
- Conversation handlers → Message records: reads and writes (evidence: `Backend/Services/chat/controllers/chat.controller.js`)
- Agent request handler → Agent workflow graph: invokes (evidence: `Backend/Services/agent/controller/agent.controller.js`)
- Agent workflow graph → Intent router: routes requests (evidence: `Backend/Services/agent/graph/graph.js`)
- Intent router → Language model: classifies intent
- Agent workflow graph → Chat agent: dispatches (evidence: `Backend/Services/agent/graph/graph.js`)
- Agent workflow graph → Search agent: dispatches (evidence: `Backend/Services/agent/graph/graph.js`)
- Agent workflow graph → Coding and media agents: dispatches (evidence: `Backend/Services/agent/graph/graph.js`)
