Start free
Docs / AI Agent / Giving the agent tasks
How-to

Giving the agent tasks

The agent works by chatting in the Agent tab — there's no command syntax. You say what you want in plain language; the agent builds a plan, calls the tools it needs, and asks for approval on risky steps.

A simple task

Pull the top 5 most-asked topics this month from the
knowledge base and write a short summary.

The agent uses T1 tools like kb_search and data_aggregate; since they're side-effect free, no approval is needed and the result comes straight to chat.

Multi-step tasks

The agent breaks large jobs into steps on its own. For example:

Find the return requests among last week's orders,
draft a short reply to each customer, and summarize
them all in a table.
  • Each step's result becomes context for the next; independent steps run in parallel.
  • On long jobs you get progress messages ("3/5 done").
  • If interrupted, the task resumes from where it stopped (resume).

Artifacts

The agent can produce documents/decks/spreadsheets/images (doc_generate, xlsx_generate, …). Generated files land as the task's artifacts; list them with list_artifacts and download. Instead of only downloading from chat, you can also have them saved straight to Google Drive.

Approving actions

When a task needs to change the outside world (send email, create a calendar event, update the store), the agent shows an approval card. That step waits for approval while independent steps keep going. More: Autonomy & approvals.

Archiving email attachments to Google Drive

The agent can take attachments from incoming email (invoices, contracts, statements…) and archive them into tidy folders in Google Drive. A typical request:

Put the invoice attachments from emails received in 2026 from
[email protected] into Google Drive under SemAgent > Invoices > Supplier
  1. Prerequisite: Gmail (IMAP) and Google Drive must be connected under Agent Connectors.
  2. The agent first searches the mail (gmail_search), then pulls attachments into a safe quarantine (gmail_attachments) — the attachment bytes (e.g. the PDF) never enter the model.
  3. It then uploads the files to Drive (drive_upload). Missing folders are created; you can give a nested path (e.g. Invoices/<Company>/<Year-Month>).
  4. Uploading requires approval; the agent collects all uploads in the same turn into ONE approval card — you approve once, not seven times for seven files.

You can ask about the content. For questions like "how much did I pay in invoices in 2026?" the agent can read the amount from three sources: (a) the mail body — HTML-only notification/invoice mail is converted to text too, (b) inside the attachmentgmail_attachments with extract_text=true reads PDF/Word/Excel/CSV (OCR for scanned PDFs), (c) the Drive archivedrive_read extracts the text of an uploaded PDF. All of it is external content, so it passes through the security quarantine.

🔁

Want it to run by itself every month? Turn the same request into a scheduled + autonomous task (next section): "…do this on the 27th of each month and email me a summary table".

Generate a spreadsheet/deck → save it to Drive

A file the agent generates no longer has to stay in the chat: it can put the Excel/Word/deck it just produced straight into Google Drive. Typical requests:

Check the mail from ACME, work out what I paid in invoices in 2026,
and save it as an Excel sheet in the xyz folder on Drive

Read the files in the xyz folder on Drive, build a deck out of them
and put it in the same folder
  1. Prerequisite: depending on the source, Gmail (IMAP) / Google Drive must be connected under Agent Connectors, plus Google Drive Upload (drive.file) for writing.
  2. The agent gathers the data first (gmail_search + gmail_attachments, or drive_read) and crunches it (data_aggregate).
  3. It generates the file — xlsx_generate, doc_generate or pptx_generate. This step is side-effect free and needs no approval.
  4. It uploads the generated file to Drive (drive_upload, the artifact source). This step requires approval; all uploads in the same turn are collected into one approval card.
🔒

If it says it can't find that folder, this is why. The one-click Drive connection runs on Google's drive.file scope: the agent sees only the files and folders it created itself. A folder you created by hand is invisible to it. The fix: have the agent create the target folder tree ("create SemAgent > Reports on Drive and always put things there") and keep using that tree; or put a Google identity with the full drive scope into the Vault.

Naming the folder is enough; missing folders are created and you can give a nested path (e.g. Reports/2026/July). If you don't specify a file name, the agent picks one that fits the content.

Autonomous tasks (without approval)

You can set up a task as autonomous from chat: on each run a bounded tool set — read mail · fetch attachments · put in Drive · generate report · send mail — runs without approval; every other action (delete, forward, social publishing, SMS…) still requires approval. Security: email goes only to the account owner and the fixed recipients you name — never to an address derived from mail content. Parameters like sender/folder/report-recipient come from your instruction; mail content can't change them. Scheduling details: Scheduling & briefing.

Tips for writing good tasks

  • State the outcome, not the steps: "prepare a report for…" > "first do X, then Y". The agent plans it.
  • Give context: which source, which date range, to whom.
  • Set constraints: e.g. "only draft it, don't send".
  • Recurring jobs? Schedule them; things you correct often become a rule.
Was this page helpful? Send feedback