> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argentos.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gateway Overview

> The always-on WebSocket control plane that manages agents, channels, and sessions.

## Overview

The gateway is the central nerve system of ArgentOS. It is an always-on process that:

* **Manages channels**: Connects to Telegram, Discord, WhatsApp, and other platforms
* **Routes messages**: Directs incoming messages to the correct agent and session
* **Streams responses**: Delivers agent responses back to channels and the dashboard
* **Runs health checks**: Monitors system health and cleans up zombie processes
* **Triggers heartbeats**: Periodically wakes the agent for autonomous task work

## Starting the Gateway

```bash theme={null}
# Start in the foreground (for debugging)
argent gateway start

# Install as a system service (launchd on macOS, systemd on Linux)
argent gateway install

# Check status
argent gateway status
```

## Architecture

```mermaid theme={null}
graph LR
    TG[Telegram] --> GW["Gateway<br/>(WebSocket Server)"]
    DC[Discord] --> GW
    WA[WhatsApp] --> GW
    SL[Slack] --> GW
    SG[Signal] --> GW
    DB[Dashboard] --> GW
    GW --> AR[Agent Runtime]
    AR --> API[Claude API]
    AR --> Tools
    AR --> MemU
```

The gateway listens on a WebSocket port (default: 18789) and accepts connections from the dashboard and internal components.

## Service Management

<Tabs>
  <Tab title="macOS (launchd)">
    ```bash theme={null}
    argent gateway install    # Install LaunchAgent
    argent gateway uninstall  # Remove LaunchAgent
    argent gateway restart    # Restart the service
    ```

    The LaunchAgent plist is written to:

    ```
    ~/Library/LaunchAgents/ai.argent.gateway.plist
    ```
  </Tab>

  <Tab title="Linux (systemd)">
    ```bash theme={null}
    argent gateway install    # Install systemd service
    sudo systemctl status argent-gateway
    ```
  </Tab>
</Tabs>

## Ports

| Port  | Service   | Description             |
| ----- | --------- | ----------------------- |
| 18789 | Gateway   | WebSocket control plane |
| 3141  | Dashboard | Web UI and API server   |

## Verifying the Gateway

```bash theme={null}
argent gateway status
```

A healthy gateway shows:

* Status: running
* RPC probe: ok
* Listening: \*:18789

<Tip>
  If the RPC probe fails, check the [troubleshooting guide](/help/troubleshooting).
</Tip>
