All guides

Guide

Google Drive AI Agent: Getting Files In and Out of Chat

Drive is where the output of a chat conversation goes to survive. Connect it and your agent can find a file, read what is inside it, and write new ones back — with one real gotcha around binary uploads.

What connecting Drive actually gives you

Two capabilities that sound similar and are not. The first is retrieval: the agent can locate a file by name or description and read its contents, which turns Drive into a knowledge source it can answer questions from. The second is persistence: whatever the agent produces in a chat — a summary, a draft, a CSV of scraped numbers — can be written into a real file in a real folder instead of scrolling out of a chat window.

The second one is what most people underestimate. Chat output is disposable by default. Drive is where it stops being disposable.

Connect it in three steps

  1. Open openclawlaunch.com/integrations while signed in.
  2. Find Google Drive and click Connect, then approve the Google account whose Drive you want the agent working in.
  3. Ask for something in chat. The agent has the tools on its next message.

What the agent actually runs

Connecting installs a composio command in your instance. The agent discovers the action it needs, then executes it:

composio search googledrive upload

composio execute GOOGLEDRIVE_CREATE_FILE_FROM_TEXT '{"file_name":"notes.md","text_content":"# Notes\nBody here.","mime_type":"text/markdown"}'

The Drive actions worth knowing by name:

  • GOOGLEDRIVE_FIND_FILE and GOOGLEDRIVE_FIND_FOLDER — locate things before touching them
  • GOOGLEDRIVE_PARSE_FILE — extract the text so the agent can actually read a document
  • GOOGLEDRIVE_DOWNLOAD_FILE — pull a file into the instance to work on it
  • GOOGLEDRIVE_CREATE_FILE_FROM_TEXT — write Markdown, plain text, HTML, JSON, or CSV straight into Drive, no staging step
  • GOOGLEDRIVE_UPLOAD_FILE and GOOGLEDRIVE_RESUMABLE_UPLOAD — the binary path

The text-versus-binary split

This is the one piece of Drive behaviour that produces confusing failures, so it is worth understanding rather than debugging repeatedly. Text content goes up in a single call. Binary content — images, video, PDFs, archives — goes through a two-step staging flow, and the right action depends on size.

ContentActionNotes
Markdown, text, HTML, JSON, CSVGOOGLEDRIVE_CREATE_FILE_FROM_TEXTOne call, no staging
Binary up to ~5 MBGOOGLEDRIVE_UPLOAD_FILEStage the file, then upload
Binary 5–50 MBGOOGLEDRIVE_RESUMABLE_UPLOADOriginal quality, no compression needed
Binary over 50 MBPast the staging cap; compress, or send it through a chat channel

If a 30 MB video comes back compressed and grainy, that is an agent that reached for the small upload action and squeezed the file to fit. The fix is to name the right action, not to accept the quality loss.

Things worth asking for

  • “Find the pricing deck in Drive and tell me what we charge for the mid tier.”
  • “Save this conversation as a Markdown file in my Notes folder.”
  • “Read the contract PDF in Drive and list every date I have to act on.”
  • “Turn these numbers into a CSV and put it in Drive.”
  • “Upload the screenshot I just sent you to the Design folder.”

Limits and revoking access

Executed actions are metered daily: 100 on free trial and Lite, 1,000 on Pro. Finding the right action does not count against that — only the calls that do work. Adding your own Composio API key on the integrations page removes the cap and bills the calls to your own Composio project instead. Disconnecting is one click, and it takes effect immediately.

Frequently asked questions

Can the agent see my entire Drive?

The OAuth grant covers the Drive of the Google account you approve, so scope it the way you would any app: if you keep work and personal in separate Google accounts, connect the one you actually want the agent working in. Access is revocable in one click from the integrations page, and separately from Google's third-party access screen.

Why did my uploaded video fail?

Almost always size. GOOGLEDRIVE_UPLOAD_FILE handles files up to about 5 MB; between 5 MB and 50 MB the agent has to switch to GOOGLEDRIVE_RESUMABLE_UPLOAD, which uploads at original quality. Above 50 MB you are past the staging limit and the file needs to be compressed or handed over through a chat channel instead. A well-behaved agent picks the action by size rather than compressing your video to squeeze it into the small one.

Can it read a PDF or a Doc stored in Drive?

Yes — GOOGLEDRIVE_PARSE_FILE extracts text so the agent can answer questions about the contents rather than just hand you a link. For documents you also want to edit, connect Google Docs as well; Drive handles the file, Docs handles the body.

Does one connection cover all my instances?

Yes. The connection belongs to your OpenClaw Launch account, not to a container, so every OpenClaw and Hermes instance you own can use it — including ones you deploy later.

Related guides

Connect Google Drive to your agent

Sign in, click Connect on Google Drive, approve the Google consent screen. No config file, no restart.

Open Integrations