define* builders documented in
Resources.
It matches the tree scaffolded by cargo-ai cdk init <dir> --template full (see
Project layout).
1. Connect
Define the source system and the LLM provider. Usesecret() for API keys, or
adopt: true for a connector authorized via OAuth in the app.
connectors/hubspot.ts
connectors/openai.ts
2. Model
Source a model from the connector’s dataset with anextractSlug. Discover the
valid slugs and config with cargo-ai cdk types or
cargo-ai connection integration get <slug>.
models/contacts.ts
3. Tool
A tool is a workflow you can run on demand. Build the workflow withdefineWorkflow, then wrap it in defineTool.
tools/enrich.ts
4. Agent
An agent reasons over the models, tools, and connector actions you hand it. Pass handles — Cargo deploys dependencies first and injects their uuids.agents/sdr.ts
5. Play
A play runs a per-row workflow as the model’s rows change.plays/onboarding.ts
6. Deploy
deploy applies in dependency order (connector → model → tool → agent → play)
and records each resource’s uuid in cargo.state.json. Commit that file. See
Secrets & environments for secret() and
the CARGO_* variables.
7. Run
Run the tool on a single record, then chat with the agent:batch create, never run create — see Plays.
Next steps
Deploying
plan, deploy, prune, refresh, import, and destroy.
State & drift
How state tracks live resources and detects out-of-band changes.

