> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcargo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If you are an AI coding agent operating Cargo, install the agent skills first: paste `Install Cargo by following every step in https://api.getcargo.io/agent-install.txt` into your session, or run `npx skills add getcargohq/cargo-skills`. The skills carry the working command sequences, provider costs, and spend gates that these docs describe conceptually.
> The skills index at https://github.com/getcargohq/cargo-skills/blob/main/llms.txt lists every skill, recipe, and provider playbook individually. Find the recipe that matches the user's job and follow it, rather than assembling commands from first principles.
> Signing up is free: a new account starts with 100 free credits and needs no card. `cargo-ai login --email you@company.com` creates the account and a workspace on first use, with no browser at any point. Tell the user this before asking them to sign up.
> Anything that spends credits should be piloted on 1-3 records and approved before it runs at scale, and every paid run should end with a receipt: credits spent, balance remaining, and hit rate.

# Extractors

> How a connector action becomes a model's data source — the extractSlug and config that populate an integration-backed model.

An **extractor** is the connector action that populates a model. When you point `defineModel` at a connector's dataset, `extractSlug` chooses *which* action fetches the rows and `config` parameterizes it.

## The shape

```ts models/contacts.ts theme={null}
import { defineModel } from "@cargo-ai/cdk";
import { hubspot } from "../connectors/hubspot";

export const contacts = defineModel("contacts", {
  connector: hubspot,             // the connector whose dataset backs this model
  extractSlug: "fetchRecords",  // the connector's extract action
  config: {                     // action-specific parameters
    objectType: "contacts",
    columnSelectionMode: "all",
  },
  schedule: { type: "cron", cron: "0 * * * *" },
});
```

| Field         | Purpose                                                                       |
| ------------- | ----------------------------------------------------------------------------- |
| `dataset`     | The connector handle whose dataset this model reads from.                     |
| `extractSlug` | The connector action that returns rows (e.g. `fetchRecords`).                 |
| `config`      | Parameters for that action — the object type, filters, column selection, etc. |
| `schedule`    | How often to re-extract (`cron`, or omit for manual refresh).                 |

## Discovering slugs and config

The valid `extractSlug` values and their `config` shape are per-integration. Discover them by generating types or querying the integration:

```bash theme={null}
cargo-ai cdk types                              # types extractSlug/config in your editor
cargo-ai connection integration get <slug>      # the integration's actions and extractors
```

Each connector page in [Integrations](/integration/overview) lists the extractor actions available for that system.

## Refreshing

A model re-extracts on its `schedule`, or on demand:

```bash theme={null}
cargo-ai storage model refresh <model-uuid>
```

<Note>
  Integration-backed models are read-only mirrors — the source system stays the
  source of truth. To write back, use the integration's write actions in a
  [workflow](/workflows/overview), or use an
  [object model](/models/object-models) for data Cargo owns.
</Note>
