VectorChat Docs

Gmail

Connect your Gmail account to let agents read, send, search, and manage your email.

The Gmail integration lets your AI agents interact with your email. Agents can read messages, send emails on your behalf, search your inbox, and organize messages with labels.

Connecting Gmail

  1. Go to Settings > Integrations.
  2. Click Connect next to Gmail.
  3. Sign in with your Google account and grant VectorChat access.
  4. You'll be redirected back to VectorChat once the connection is complete.

VectorChat uses OAuth 2.0 with PKCE for a secure authorization flow. Your credentials are encrypted at rest and tokens are automatically refreshed when they expire.

What Agents Can Do

Read and Search Email

  • Read a message -- Retrieve the full content of any email by its message ID.
  • Search emails -- Search your inbox using Gmail's query syntax (e.g., from:alice@example.com subject:invoice). Returns up to 25 results by default.
  • List labels -- View all Gmail labels in your account.

Send Email

  • Send a message -- Compose and send emails with a recipient, subject, and body. Supports both plain text and HTML content.
  • Reply in a thread -- Send a reply within an existing email thread by specifying the thread ID.
  • CC and BCC -- Include additional recipients on outgoing messages.

Organize Email

  • Archive / Unarchive -- Move messages out of or back into your inbox.
  • Mark as read / unread -- Update the read status of messages.
  • Add / Remove labels -- Apply or remove Gmail labels to organize messages.
  • Move messages -- Reclassify messages by adding and removing label combinations.
  • Delete -- Permanently delete a message.

Write operations (sending, deleting, archiving) require confirmation before the agent executes them. You'll see a preview of the action before it happens.

Gmail Search Syntax

When asking an agent to search your email, you can use Gmail's search operators:

OperatorExampleDescription
from:from:alice@example.comMessages from a specific sender
to:to:bob@example.comMessages to a specific recipient
subject:subject:invoiceMessages with a word in the subject
has:attachmenthas:attachmentMessages with attachments
after:after:2025/01/01Messages after a date
before:before:2025/06/01Messages before a date
is:unreadis:unreadUnread messages
label:label:importantMessages with a specific label

Disconnecting

Go to Settings > Integrations, find Gmail, and click Disconnect. This removes your stored credentials and revokes the agent's access to your email.