Skip to main content
An agent is an AI worker that plans and executes multi-step tasks. Unlike a play (a fixed sequence), an agent reasons over its instructions and the tools, data, and sub-agents you give it. You define one with defineAgent.

Define an agent

Every capability is passed as a handle, so Cargo deploys dependencies first and injects their uuids:
agents/sdr.ts

Anatomy

Each uses entry is a handle — its kind is read from the handle, so order doesn’t matter. Pass a bare handle, or { ref, …options } to tune it: tools / sub-agents / connector actions take { name, description, isBulkAllowed, waitUntilFinished }; a data model takes { readOnly, columns, prompt }. A connector action is an action off a connector handle — hunter.actions.findEmail.

Deploy and chat

Where agents run

Agents can be triggered from plays (scheduled or change-driven), Slack mentions, the Chrome extension, embedded chat, or a CRM button. Bundle them behind an MCP server to expose them to external assistants.

Using the UI

Prefer to build visually? See Using the UI for the Instructions / Actions / Resources walkthrough. Agents built in code and in the UI are interchangeable.