> ## 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.

# Google Chat

> Connect ArgentOS to Google Workspace Chat for direct messages, group conversations, and threaded replies.

## Overview

The Google Chat channel connects ArgentOS to Google Workspace Chat, enabling your agent to communicate through Google's enterprise messaging platform. The integration uses the Google Chat API with HTTP webhook delivery.

## Capabilities

| Feature               | Supported                            |
| --------------------- | ------------------------------------ |
| Direct messages       | Yes                                  |
| Group conversations   | Yes                                  |
| Threaded replies      | Yes                                  |
| Reactions             | Yes                                  |
| Media attachments     | Yes                                  |
| Streaming             | Block streaming (coalesced delivery) |
| Native slash commands | No                                   |

<Info>
  Google Chat messages are limited to 4,000 characters per message. ArgentOS automatically splits longer responses into multiple messages.
</Info>

## Setup

<Steps>
  <Step title="Create a Google Chat App">
    1. Go to the [Google Cloud Console](https://console.cloud.google.com/)
    2. Create or select a project
    3. Enable the **Google Chat API**
    4. Navigate to **APIs & Services > Google Chat API > Configuration**
    5. Configure the Chat app:
       * **App name**: Your agent's name (e.g., "Argent")
       * **Avatar URL**: Optional agent avatar
       * **Description**: Brief description of your agent
       * **Functionality**: Enable both "Receive 1:1 messages" and "Join spaces and group conversations"
       * **Connection settings**: Select "HTTP endpoint URL"
       * **HTTP endpoint URL**: Your gateway's public webhook URL
  </Step>

  <Step title="Configure ArgentOS">
    Add the Google Chat configuration to `~/.argentos/argent.json`:

    ```json theme={null}
    {
      "channels": {
        "googlechat": {
          "enabled": true,
          "replyToMode": "off",
          "dm": {
            "allowFrom": ["users/123456789"]
          }
        }
      }
    }
    ```
  </Step>

  <Step title="Set Up Allow List">
    The `allowFrom` field controls which Google Workspace users can interact with your agent:

    ```json theme={null}
    {
      "dm": {
        "allowFrom": [
          "users/123456789",
          "user@workspace.com"
        ]
      }
    }
    ```

    User identifiers can be in any of these formats -- the system normalizes them:

    * `users/123456789` (Google Chat user ID)
    * `googlechat:users/123456789`
    * `user:users/123456789`
  </Step>
</Steps>

### Multi-Account Configuration

For multiple Google Chat app instances:

```json theme={null}
{
  "channels": {
    "googlechat": {
      "accounts": {
        "primary": {
          "dm": {
            "allowFrom": ["users/111"]
          }
        },
        "support": {
          "dm": {
            "allowFrom": ["users/222", "users/333"]
          }
        }
      }
    }
  }
}
```

## Threading

Google Chat supports threaded conversations. Configure the reply-to mode:

```json theme={null}
{
  "channels": {
    "googlechat": {
      "replyToMode": "off"
    }
  }
}
```

| Mode     | Behavior                                        |
| -------- | ----------------------------------------------- |
| `off`    | Replies are sent as new messages (default)      |
| `always` | Replies are always threaded                     |
| `auto`   | Thread when the original message is in a thread |

When threading is active, the agent receives thread context including the current thread ID and whether a reply reference exists.

## Group Conversations

### Mention Requirements

In group conversations, you can require that the agent be mentioned before it responds:

```json theme={null}
{
  "channels": {
    "googlechat": {
      "groups": {
        "requireMention": true
      }
    }
  }
}
```

### Tool Policy

Control which tools are available in group conversations:

```json theme={null}
{
  "channels": {
    "googlechat": {
      "groups": {
        "toolPolicy": "restricted"
      }
    }
  }
}
```

| Policy       | Description                       |
| ------------ | --------------------------------- |
| `full`       | All tools available               |
| `restricted` | Limited tool set for group safety |
| `none`       | No tools in group conversations   |

## Block Streaming

<Note>
  Google Chat uses block streaming mode -- the agent collects its full response before sending, rather than streaming tokens incrementally. This is due to Google Chat API limitations on message editing frequency.
</Note>

## Aliases

The Google Chat channel ID can be referenced by any of these aliases:

* `googlechat` (canonical)
* `google-chat`
* `gchat`

## Troubleshooting

<AccordionGroup>
  <Accordion title="Agent Not Responding">
    1. Verify the HTTP endpoint URL is reachable from Google's servers
    2. Check that the user's ID is in the `allowFrom` list
    3. Verify the Google Chat API is enabled in your Cloud Console
    4. Check gateway logs for incoming webhook events
  </Accordion>

  <Accordion title="Messages Not Threading">
    1. Verify `replyToMode` is set to `always` or `auto`
    2. Ensure the original message is in a thread (for `auto` mode)
    3. Check that the thread ID is being passed correctly in the webhook payload
  </Accordion>

  <Accordion title="Group Mention Issues">
    1. Verify `requireMention` is configured correctly
    2. Ensure users are mentioning the Chat app by its configured name
    3. Check that the mention detection is parsing the Google Chat mention format
  </Accordion>
</AccordionGroup>
