Google Workspace Integration

Sutra integrates deeply with Google Workspace — giving your agents the ability to read and index documents from Google Drive, schedule and manage Calendar events, and handle Gmail triage and replies. Connect once with OAuth, and your agents have secure, scoped access to the tools your team already lives in.


Setup (OAuth Credentials)

All Google Workspace integrations require a centralized OAuth Client ID.

  1. Go to the Google Cloud Console.
  2. Create a new Project (e.g., "Sutra Agents").
  3. Navigate to APIs & Services > Credentials.
  4. Click Create Credentials > OAuth client ID.
  5. Choose Web application as the application type.
  6. Under Authorized redirect URIs, add your Sutra callback URL (e.g., https://sutra.mycompany.com/api/auth/google/callback).
  7. Save the Client ID and Client Secret.

In Sutra, navigate to Settings > Configuration (Integrations group) and add:

GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
Important: You'll also need to configure the OAuth consent screen in Google Cloud Console. For internal use (Google Workspace accounts only), select "Internal" — this skips Google's app review process. For external users, you'll need to go through verification, which can take several weeks. Start with Internal and switch to External only when you need to support non-organization accounts.

1. Google Drive Integration

Allow your agents to use your Google Drive as a living Knowledge Base.

Configuration

  1. In Google Cloud Console, enable the Google Drive API.
  2. In Sutra, navigate to the Google Drive page (/google-drive).
  3. Click Connect Google Drive and authenticate with your Google account.
  4. Select the specific Folders or Shared Drives you want Sutra to have access to.

How it Works

Sutra will periodically sync the selected folders. Supported files (Google Docs, Sheets, Slides, and PDFs) are downloaded, chunked, and embedded into Sutra's pgvector knowledge base. When an agent uses the search_knowledge_base tool, it will retrieve accurate, up-to-date information directly from your Drive.

Supported file types include Google Docs, Sheets, Slides, PDFs, and plain text files. Google Sheets are converted to structured data with headers preserved, making them ideal for product catalogs, price lists, and FAQ databases that agents need to query precisely.

Tip: For best results, organize your Drive folders by department or topic before connecting them. You can then scope specific folders to specific projects — your marketing agents search marketing docs, your engineering agents search technical specs. This reduces noise and dramatically improves retrieval accuracy.

2. Google Calendar Integration

Enable your agents to schedule meetings, check availability, and manage your calendar.

Configuration

  1. In Google Cloud Console, enable the Google Calendar API.
  2. Equip your agent with the google_calendar toolset in the Agent settings.

Agent Capabilities

With this integration, an agent can:

  • Check Availability: "Does the engineering team have time for a meeting tomorrow afternoon?" (The agent will query the calendars and find an open slot).
  • Create Events: "Schedule a 30-minute sync with Sarah on Friday at 10 AM." (The agent will create the event and send invites).
  • Modify/Cancel: "Push my 10 AM meeting back by 30 minutes."
  • Recurring Events: "Set up a weekly team standup every Monday at 9 AM for the next quarter." The agent handles the recurrence rules and sends invites to all specified attendees.
  • Smart Scheduling: "Find a 45-minute slot next week when both Sarah and Mike are free." The agent cross-references multiple calendars and suggests the best options, factoring in time zones if your team is distributed.

Calendar actions are logged in the audit trail, so you can always see which agent scheduled (or moved) a meeting and why. For sensitive calendars, you can require human approval before any event is created or modified.


3. Gmail Integration

While Sutra supports standard SMTP, the native Gmail integration offers a more robust way for agents to handle email.

Configuration

  1. In Google Cloud Console, enable the Gmail API.
  2. Equip your agent with the gmail_read and gmail_send tools.

Agent Capabilities

  • Triage: Agents can read incoming emails, classify them (e.g., "Support", "Sales", "Spam"), and apply Gmail labels automatically.
  • Drafting: An agent can read an incoming client email, draft a response, and save it to your Drafts folder for your review before sending.
  • Autonomous Replies: For trusted workflows, agents can autonomously reply to specific types of inquiries directly via Gmail.
  • Thread Management: Agents understand email threads — they read the full conversation history before responding, ensuring replies are contextually accurate even in long email chains.
  • Attachment Handling: Agents can read PDF and document attachments by indexing them on the fly, and attach files from the Knowledge Base when composing outbound emails.
Best Practice: Start with the "Drafting" workflow. Let your agents read incoming emails and save responses to Gmail Drafts for your team to review and send. This builds confidence in the agent's quality before you enable fully autonomous replies. Most teams run in draft mode for 2-4 weeks before going fully autonomous on routine inquiry types.