Grok Bot C4 Architecture Diagrams

xAI/SpaceXAI always-on AI agent teammates with persistent cloud computer

Level 1 Context Diagram

Grok Bot system with external actors and apps.

C4Context title Grok Bot Context Diagram Person(user, "User", "SuperGrok Heavy / Cursor Ultra subscriber") System(grokbot, "Grok Bot Platform", "Always-on AI agent teammates with persistent cloud VM. Browser, filesystem, terminal. Bots work 24/7, coordinate, return for approval.") System_Ext(x_api, "Grok LLM API", "xAI Grok language models for agent reasoning") System_Ext(cursor, "Cursor IDE", "Code editor via Agent Client Protocol ACP") System_Ext(apps, "External Apps", "Gmail, Slack, GitHub, Salesforce, Google Calendar, Jira, browsers") System_Ext(mcp, "MCP Servers", "Model Context Protocol for structured tool access") Rel(user, grokbot, "Messages Bots via desktop / iOS") Rel(grokbot, x_api, "LLM inference calls") Rel(grokbot, cursor, "Integrates via ACP") Rel(grokbot, apps, "Signs in and uses apps on cloud VM") Rel(grokbot, mcp, "Calls MCP servers for tools")

Level 2 Container Diagram

Internal containers of the Grok Bot platform.

C4Container title Grok Bot Container Diagram System_Boundary(b, "Grok Bot Platform") { Container(bot_runtime, "Bot Runtime", "Agent engine", "Named persistent agents with memory, files, browser sessions. End-to-end task execution, approval requests.") Container(cloud_vm, "Cloud VM", "Persistent VM", "Shared cloud computer per user. Browser, filesystem, terminal. All Bots share one VM with own screens for parallel work.") Container(coord, "Coordination Layer", "Messaging", "Bots message each other in threads and group chats. Share context, pass ownership. No human router needed.") Container(skills, "Skills and Routines", "Workflow persistence", "Learn multi-step workflows by watching user. Persists as routine. Re-runs on schedule or demand.") Container(approvals, "Approval Gateway", "Human-in-the-loop", "Pauses for user judgment on sensitive actions. User approves or corrects via app.") } Container(client_desktop, "Desktop App", "Native", "macOS/Linux/Windows client. Message Bots, review work, approve.") Container(client_ios, "iOS App", "Mobile", "Same Bot threads, mobile access.") Container(grok_build, "Grok Build CLI", "Rust binary", "Terminal coding agent. TUI, headless, ACP. Shares Grok LLM.") System_Ext(x_api, "Grok LLM", "xAI models") System_Ext(external_apps, "External Apps", "Gmail Slack GitHub Salesforce browsers") System_Ext(mcp_servers, "MCP Servers", "Tool servers") Rel(client_desktop, bot_runtime, "Messages, reviews, approves") Rel(client_ios, bot_runtime, "Same threads mobile") Rel(bot_runtime, cloud_vm, "Executes tasks on cloud computer") Rel(bot_runtime, coord, "Coordinates with other Bots") Rel(bot_runtime, skills, "Saves and runs workflows") Rel(bot_runtime, approvals, "Pauses for approval") Rel(bot_runtime, x_api, "LLM inference") Rel(cloud_vm, external_apps, "Signs in and uses apps") Rel(bot_runtime, mcp_servers, "Structured tool calls") Rel(grok_build, x_api, "Same Grok LLM for coding")

Bot Coordination Model

Chief-of-staff pattern: one Bot manages specialists in parallel.

flowchart TD user["User"] --> chief["Chief of Staff Bot"] chief --> sales["Sales Bot\nCRM, follow-ups"] chief --> ops["Ops Bot\nHires, invoices"] chief --> eng["Engineering Bot\nBugs, tickets"] chief --> inbox["Inbox Bot\nEmail triage"] eng --> debug["Debug Bot\nFixes"] sales -.->|"approval"| user inbox -.->|"approval"| user debug -.->|"review"| user style user fill:#1d9bf0,color:#fff style chief fill:#1d9bf0,color:#fff style sales fill:#f5a623,color:#fff style ops fill:#f5a623,color:#fff style eng fill:#f5a623,color:#fff style debug fill:#2d4a22,color:#fff style inbox fill:#f5a623,color:#fff

Grok Build Rust Crate Architecture

Open-source grok CLI/TUI from github.com/xai-org/grok-build

graph TD pager_bin["xai-grok-pager-bin\nComposition root"] pager["xai-grok-pager\nTUI: scrollback, prompt, modals"] shell["xai-grok-shell\nAgent runtime + leader/stdio/headless"] tools["xai-grok-tools\nTerminal, file edit, search"] workspace["xai-grok-workspace\nFilesystem, VCS, execution"] config["xai-grok-config\nConfiguration"] mcp["xai-grok-mcp\nMCP integration"] sandbox["xai-grok-sandbox\nSandboxing and security"] common["common/ + build/\nShared leaf crates"] pager_bin --> pager pager_bin --> shell shell --> tools shell --> workspace shell --> config shell --> mcp shell --> sandbox tools --> common workspace --> common style pager_bin fill:#1d9bf0,color:#fff style shell fill:#1d9bf0,color:#fff style tools fill:#f5a623,color:#fff style workspace fill:#f5a623,color:#fff style pager fill:#4a90d9,color:#fff style mcp fill:#2d4a22,color:#fff style sandbox fill:#e94560,color:#fff