How nomihabib36/cortexai---multiagent-chatbot works
CortexAI is a multi-agent chatbot with a React client and gateway-backed authentication, chat history, billing, and AI-agent services. The main interaction runs from the user through the frontend and gateway to the agent controller, which saves the prompt, invokes the agent graph, and persists the response through chat. The tree shows specialist agents and payment capabilities, but the graph implementation and most frontend feature modules were not sampled; uncertain dispatch and client-to-endpoint wiring are therefore omitted.
Main entry points: index.js API gateway · billing.controller.js Billing controller · auth.controller.js Auth controller · chat.controller.js Chat controller
Components 23
Web client
- Chat UI
Frontend/src/pages/Home.jsx - App bootstrap
Frontend/src/App.jsx - Client API features
Frontend/src/features
Gateway
- API gateway
Backend/gateway/index.js - Session guard
Backend/gateway/middleware/auth.middleware.js
Identity
- Auth controller
Backend/services/auth/controllers/auth.controller.js - User records
Backend/services/auth/models/user.model.js - Session cache
Backend/shared/redis/redis.js
Chat history
- Chat controller
Backend/services/chat/controllers/chat.controller.js - Conversations
Backend/services/chat/models/conversation.model.js - Messages
Backend/services/chat/models/message.model.js
AI agents
- Agent controller
Backend/services/agent/controllers/agent.controller.js - Agent graph
Backend/services/agent/graph/graph.js - Agent routing
Backend/services/agent/graph/router.js - Specialist agents
Backend/services/agent/agents - PDF retrieval
Backend/services/agent/agents/pdfRag.agent.js - Vector store
Backend/services/agent/config/vectorDb.js
Billing
- Billing controller
Backend/services/billing/controller/billing.controller.js - Payment records
Backend/services/billing/models/billing.model.js
Other components
- User
- LLM providers
- Safepay
- Browser redirect
Connections 22
- User → Chat UI: uses
- App bootstrap → Chat UI: renders
- Chat UI → Client API features: uses
- API gateway → Session guard: guards routes
- API gateway → Auth controller: proxies auth
- API gateway → Chat controller: proxies chat
- API gateway → Agent controller: proxies agent
- API gateway → Billing controller: proxies billing
- Session guard → Session cache: reads session
- Auth controller → User records: reads/writes
- Auth controller → Session cache: stores session
- Chat controller → Conversations: reads/writes
- Chat controller → Messages: reads/writes
- Agent controller → Chat controller: saves messages
- Agent controller → Agent graph: invokes
- Agent routing → LLM providers: requests model
- PDF retrieval → Vector store: searches
- PDF retrieval → LLM providers: requests model
- Billing controller → Safepay: creates/verifies
- Billing controller → Payment records: reads/writes
- Billing controller → Auth controller: updates plan
- Browser redirect → Chat UI: redirects