Skip to main content
A data model is a structured table in your Cargo warehouse. Models feed play triggers, back model-search steps, and give agents structured context. You define them in code with defineModel.

Define a model

A model sourced from a connector’s dataset wires to the connector by handle and pulls rows with an extractor:
models/contacts.ts
See Extractors for how a connector action becomes a model’s data source.

Model types

Models live side-by-side in the same warehouse and can be queried, joined, and used as triggers. What differs is who owns the schema and who writes the rows.
  • Object models — native, writable Account / Contact / Deal / Lead or custom schemas.
  • Unification — read-only merged views across all sources.
  • Querying data — SQL over your models.
  • Segments — named, filtered views defined with defineSegment.
  • Activities — event models.

Capabilities

  • Change-based triggers — plays react in real time to added / updated / removed rows.
  • Segments — named, filtered views that batches, exports, and plays target.
  • Relationships — join models on shared columns with defineRelationship.
  • Additional columns — custom, computed, and metric columns extend a model without touching the source.

From the CLI

Using the UI

Build the same models in the web app — see Using the UI for the visual walkthrough of object models, integration loaders (native, webhook, SQL), and relationships.
Cargo hosts your models on a data warehouse. By default you get a managed Snowflake instance, or connect your own — see Snowflake and BigQuery.