How itsmevibhor2005/multi-agent-ai-platform works
CortexAI is a multi-agent AI chat product. A signed-in user sends a prompt or file through the frontend and authenticated gateway; the agent service routes it to a specialist, returns a response or artifact, and persists the exchange through the chat service. Separate branches cover account sessions, credit metering, and paid plan upgrades. The graph preserves the README’s documented specialist capabilities and major service integrations; some agent wiring is based on that documentation because the graph implementation was not sampled.
Main entry points: router.js Agent router · auth.controller.js Auth and credits · index.js API gateway · agent.controller.js Agent request handler
Components 29
Web client
- Chat interface
frontend/src/pages/Home.jsx - Client API actions
frontend/src/features/sendMessage.js
Gateway and identity
- API gateway
backend/gateway/index.js - Session guard
backend/gateway/middleware/auth.middleware.js - Session and memory cache
backend/shared/redis/redis.js - Auth and credits
backend/services/auth/controllers/auth.controller.js - User records
backend/services/auth/models/user.model.js
Conversation services
- Conversation API
backend/services/chat/controllers/chat.controller.js - Conversation records
backend/services/chat/models/coversation.model.js - Message history
backend/services/chat/models/message.model.js
Agent platform
- Agent request handler
backend/services/agent/controllers/agent.controller.js - Agent router
backend/services/agent/graph/router.js - General chat
backend/services/agent/agents/chat.agent.js - Web search
backend/services/agent/agents/search.agent.js - Code artifacts
backend/services/agent/agents/coding.agent.js - PDF authoring
backend/services/agent/agents/pdf.agent.js - Slide authoring
backend/services/agent/agents/ppt.agent.js - Image generation
backend/services/agent/agents/vision.agent.js - PDF question answering
backend/services/agent/agents/pdfRag.agent.js - Image understanding
backend/services/agent/agents/imageAnalyzer.agent.js - Model selection
backend/services/agent/config/llmModels.js
Billing
- Billing API
backend/services/billing/controllers/billing.controller.js - Payment records
backend/services/billing/models/payment.model.js
Other components
- User
- Firebase identity
- Tavily search
- Qdrant vectors
- AWS S3 files
- Razorpay checkout
Connections 38
- User → Chat interface: sends prompt
- Chat interface → Client API actions: invokes actions
- Client API actions → API gateway: calls API
- API gateway → Session guard: guards routes
- Session guard → Session and memory cache: looks up session
- API gateway → Auth and credits: proxies auth
- Auth and credits → Firebase identity: verifies token
- Auth and credits → User records: reads and writes
- Auth and credits → Session and memory cache: stores sessions
- API gateway → Agent request handler: proxies request
- Agent request handler → Conversation API: saves messages
- Agent request handler → Agent router: invokes graph
- Agent router → Model selection: classifies prompt
- Agent router → General chat: dispatches
- Agent router → Web search: dispatches
- Agent router → Code artifacts: dispatches
- Agent router → PDF authoring: dispatches
- Agent router → Slide authoring: dispatches
- Agent router → Image generation: dispatches
- Agent router → PDF question answering: dispatches
- Agent router → Image understanding: dispatches
- Web search → General chat: hands off results
- Web search → Tavily search: searches web
- General chat → Model selection: gets model
- Code artifacts → Model selection: gets model
- PDF question answering → Qdrant vectors: retrieves vectors
- PDF question answering → Model selection: gets model
- PDF authoring → AWS S3 files: uploads output
- Slide authoring → AWS S3 files: uploads output
- Agent request handler → Session and memory cache: updates memory
- Agent request handler → Conversation API: persists response
- Conversation API → Conversation records: reads and writes
- Conversation API → Message history: reads and writes
- API gateway → Billing API: proxies request
- Billing API → Razorpay checkout: creates order
- Billing API → Payment records: records payment
- Billing API → Auth and credits: applies plan
- Auth and credits → User records: updates credits