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
- Go to Settings > Integrations.
- Click Connect next to Gmail.
- Sign in with your Google account and grant VectorChat access.
- 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:
| Operator | Example | Description |
|---|---|---|
from: | from:alice@example.com | Messages from a specific sender |
to: | to:bob@example.com | Messages to a specific recipient |
subject: | subject:invoice | Messages with a word in the subject |
has:attachment | has:attachment | Messages with attachments |
after: | after:2025/01/01 | Messages after a date |
before: | before:2025/06/01 | Messages before a date |
is:unread | is:unread | Unread messages |
label: | label:important | Messages 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.