记忆

cargo-storage

试用

检查并修改 Cargo 工作区的数据模型,并对存储运行 SQL 查询。

它能做什么

通过 CLI 管理 Cargo 工作区的数据层:可列出、创建和更新模型、数据集、列、关系和记录。使用 `storage query execute` 对工作区存储运行 SQL 以即时读取数据,或使用 `storage query download` 导出完整的 CSV/Parquet 文件。支持 ingest(webhook 喂入)模型、列类型与类别配置,以及数据写入后预览行记录。

什么时候用它

  • 列出模型、数据集和列,发现工作区的数据结构
  • 新增或更新列、模型和关系,搭建业务数据结构
  • 使用 execute 或 download 对工作区存储运行 SQL 查询
  • 配置 ingest(webhook 喂入)模型,在批次写入后预览数据

技能文档

Cargo CLI — Storage

Data layer management: inspecting and modifying models, datasets, columns, relationships, and records, and running SQL queries against workspace storage.

See references/response-shapes.md for full JSON response structures. See references/troubleshooting.md for common errors and how to fix them. See references/examples/models.md for model CRUD, DDL inspection, and schema discovery examples. See references/examples/datasets.md for dataset listing and navigation examples. See references/examples/columns.md for column creation and management examples. See references/examples/queries.md for storage query execute / storage query download SQL examples (WHERE, aggregations, joins, pagination, exports). See references/examples/ingest-webhook.md for ingest (webhook-fed) models — deriving the webhook URL and POSTing records.

Prerequisites

See ../cargo/references/prerequisites.md for install, login (--oauth / --token), JSON output conventions, and error shapes. Verify the session with cargo-ai whoami before running any of the commands below.

Discover resources first

Always list before inspecting or modifying.

cargo-ai storage dataset list              # all datasets (uuid, slug)
cargo-ai storage model list                # all models (uuid, name, slug, columns)
cargo-ai storage model list --dataset-uuid    # models in a specific dataset

Retrieve in the UI: models live at app.getcargo.io/workspaces//models/. Get `` from cargo-ai whoami under workspace.uuid.

Quick reference

cargo-ai storage model list
cargo-ai storage model get 
cargo-ai storage model get-ddl 
cargo-ai storage dataset list
cargo-ai storage column list --model-uuid 
cargo-ai storage relationship list --model-uuid 
cargo-ai storage record list --model-uuid 
cargo-ai storage query execute "SELECT * FROM default.companies LIMIT 10"
cargo-ai storage query download --query "SELECT * FROM default.companies"

Models

Models are structured tables in your workspace (e.g. Companies, Contacts).

# List all models
cargo-ai storage model list

# List models in a dataset
cargo-ai storage model list --dataset-uuid 

# Get a single model (includes columns)
cargo-ai storage model get 

# Get the DDL (full schema, table name and SQL dialect)
cargo-ai storage model get-ddl 
# → Useful for column discovery and SQL dialect (BigQuery vs Snowflake) before writing queries

# Create a model
cargo-ai storage model create \
  --slug contacts \
  --name "Contacts" \
  --dataset-uuid  \
  --extractor-slug  \
  --config '{}'

# Update a model
cargo-ai storage model update --uuid  --name "New Name"

# Remove a model
cargo-ai storage model remove 

Querying: Use cargo-ai storage query execute "" (or storage query download --query "" for full exports) to run SQL against storage. Tables are referenced as . (e.g. default.companies) and rewritten to the underlying storage table under the hood. See Query with SQL below.

Ingest models (webhook-fed)

A model whose extractor has mode.kind === "ingest" — http.listenHook and friends — is filled by pushing records to Cargo. The app shows a "Webhook URL" on the model settings screen; no CLI command or API field returns it, but it's assembled from values the CLI already exposes:

/v1/models//records/ingest?token=
MODEL_UUID=
BASE=$(cargo-ai whoami | jq -r '.baseUrl')
TOKEN=$(cargo-ai workspaceManagement token list | jq -r '.tokens[0].token')
echo "$BASE/v1/models/$MODEL_UUID/records/ingest?token=$TOKEN"

Check the extractor's mode first — when it reports "autoIngest": true (calendly, smartlead, instantlyV2, heyReach, datachimp, cargo signals) Cargo registers the hook with the provider itself and the URL must not be handed out. Full flow, payload shapes, and limits: references/examples/ingest-webhook.md.

Datasets

Datasets are logical groupings of models.

# List all datasets
cargo-ai storage dataset list

# Get a single dataset
cargo-ai storage dataset get 

Columns

Columns define the schema of a model.

# List columns for a model
cargo-ai storage column list --model-uuid 

# Create a column
cargo-ai storage column create \
  --model-uuid  \
  --column '{"slug":"my_column","type":"string","label":"My Column","kind":"custom"}'

# Update a column (pass the full column object — columns are identified by slug, not UUID)
cargo-ai storage column update \
  --model-uuid  \
  --column '{"slug":"my_column","type":"string","label":"Updated Label","kind":"custom"}'

# Remove a column
cargo-ai storage column remove --model-uuid  --column-slug 

# Reorder a column (move to a specific index)
cargo-ai storage column reorder --model-uuid  --column-slug  --to-index 2

Column types: string, number, boolean, date, object, array, vector, any.

Column kinds: custom (user-defined), computed (expression over other columns), metric (aggregated from a related model), lookup (single field pulled from a related model via a join).

Preview what you built

A column list doesn't tell the user whether the model is right — rows do. Two checkpoints (the pack-wide convention lives in ../cargo/references/interaction.md §4):

1. Right after model create / column create — show the schema, not rows. A new model is empty; a LIMIT 10 here returns nothing and reads as failure. Echo the columns as a compact table instead (column, type, what will fill it).

2. As soon as data lands — show the rows. After a batch, play, or import writes into the model, preview it:

cargo-ai storage query execute \
  "SELECT * FROM . LIMIT 10"

Show ~10 rows and only the columns that carry meaning. Storage queries are free, so this costs nothing but a few lines of output — and it's the first moment the user can actually see what they built. When a play fills a new column, preview that column next to the record's identifying fields (name, domain) so filled vs. empty is obvious.

If the preview comes back empty or all-null when it shouldn't, that's a finding — surface it rather than reporting the write as a success. See cargo-diagnostics to trace why.

Relationships

Relationships link models together (e.g. Contacts belong to Companies).

# List relationships for a model
cargo-ai storage relationship list --model-uuid 

# Set a relationship between two models
cargo-ai storage relationship set \
  --from-model-uuid  \
  --to-model-uuid 

Records

# List records in a model
cargo-ai storage record list --model-uuid 

For advanced record queries (filtering, sorting, pagination), use segmentation segment fetch from the cargo-orchestration skill.

Query with SQL

Run SQL against workspace storage with storage query execute. Tables are referenced as . (e.g. default.companies) and rewritten to the underlying storage table under the hood — no DDL lookup is needed for the table name.

cargo-ai storage query execute \
  "SELECT name, domain FROM default.companies LIMIT 10"
# → { "rows": [...] } on success; non-zero exit with { "errorMessage": "..." } on error

For full exports, use storage query download — it returns a signed URL to a CSV (default) or Parquet file:

cargo-ai storage query download \
  --query "SELECT name, domain, revenue FROM default.companies ORDER BY revenue DESC"

cargo-ai storage query download \
  --query "SELECT * FROM default.companies" --format parquet

Get column slugs from storage column list --model-uuid (or run storage model get-ddl for the full schema and SQL dialect). Page through large result sets with LIMIT / OFFSET directly in the SQL.

See references/examples/queries.md for WHERE clauses, aggregations, joins, date queries, pagination, and the failure shapes returned on error.

Help

Every command supports --help:

cargo-ai storage model list --help
cargo-ai storage column create --help
cargo-ai storage relationship set --help
cargo-ai storage query execute --help
cargo-ai storage query download --help

常见问题

这个技能可以管理哪些数据结构?
模型、数据集、列、关系和记录。列支持的类型包括 string、number、boolean、date、object、array、vector、any,类别包括 custom、computed、metric、lookup。
如何对工作区运行 SQL 查询?
使用 `cargo-ai storage query execute "..."` 获取行结果,或使用 `storage query download --query "..."` 获取 CSV(默认)或 Parquet 导出文件的签名 URL。表以 `dataset.table` 形式引用,会在底层被改写到实际存储表。
什么时候应该改用其他技能?
查询运行或批次遥测数据应使用 `cargo-orchestration`;命名可复用的筛选受众应使用 `cargo-segmentation`。本技能只处理业务数据结构和针对工作区存储的 SQL,不处理执行遥测。

相关技能

诊断生产力系统反复失效的根因,给出最小干预——容量测算、瓶颈定位、可靠的本地记录。

作者 Iván855 次安装69 星标

把自然语言描述转为结构化 JSON,并由 mcp-diagram-generator MCP 服务生成 Draw.io、Mermaid 或 Excalidraw 图表文件。

作者 nssa.io1.0k 次安装47 星标

在本地磁盘以分类纯 Markdown 文件保存需要长期留存的事实,与智能体内置记忆并存。

作者 Iván559 次安装18 星标

以 AI 机器人身份加入视频会议,提供语音、虚拟形象与屏幕共享四种模式。

作者 johnpatternai22 次安装8 星标

从 AdMapix API 拉取广告创意、应用、榜单和收入预估等数据,原样返回结构化 JSON。

作者 fly0pants4.3k 次安装296 星标

执行 Git 操作(提交、分支、合并、变基、冲突解决与恢复)时强制套用安全规则。

作者 Iván535 次安装31 星标

cargo-ai 的更多技能

浏览全部技能

读写团队的 GTM 知识库——一个由 Git 管理的 Markdown 仓库,记录 ICP、人设、玩法、证据、异议等。

作者 cargo-ai16 次安装

用一个 CLI 表面执行、构建、绘制并查询 Cargo 工作流、动作、批量与 AI 代理。

作者 cargo-ai16 次安装

查找、认证并配置 Cargo 工作流节点所需的外部系统连接器。

作者 cargo-ai14 次安装

在 Cargo 上跑 B2B 拓客、联系人补全、线索打分与 CRM 同步,每一步都内置授权基础与抑制名单校验。

作者 cargo-ai13 次安装

通过 Cargo CLI 管理 AI agent、release、MCP server 与 memory。

作者 cargo-ai17 次安装