Skip to content
Workflows / Enrich

Add columns without rewriting the table.

Add a model’s output as an Enrichment, or an expression as a Derived Column. An Enrichment refresh computes only new and changed rows, and reads compute a Derived Column.

Video, force, pose, actions, and model output

Derived Columncontacts/slip_distance
DefinitionObject displacement after stable contactrowcontactunitmillimeters
Lineagecontactsobject_positiontracker_v3computed on read a fill stores values
The missing column

Hand-made features go stale and cannot be rebuilt.

Nobody recorded the code or the model, so nobody can compute the next batch the same way.

Chained Enrichments

One Enrichment can read another.

Spiral Robotics, an app built on Spiral, chains Enrichments into a signal graph. It tracks objects, scores progress with WARP-RM, and splits each episode into subtasks, and each step reads the column that the step before it appended.

run modelsbreak downsearchselecttop_cameravideo · per episodeobject_positiontrack × frameprogressWARP-RM · per framesubtaskssubtask × episodesimilar_subtasksneighbors × subtaskslip_distanceyour expression · mmclean_graspstraining set · grasps
Models

A model’s output becomes a new column.

Run a detection model to add object tracks, a classifier to add a class to each clip, or an embedding model to add a vector. Each Enrichment is its own resource with its own grants. It can live in another project and enrich a table that you can only read. A Task computes its values, and each version records the model revision that made it.

Enrichmentepisodes/subtasks
Sourcetop_camera
Modelbreakdown_task
Columnsubtasks

pinned model each version records its definition

The mechanics

Each refresh computes only new and changed rows.

01Aligned to the source rowsAn Enrichment stores its values in its own files, row for row with the source table. A scan reads them with no join, and nothing rewrites the table.
02Backfill any set of rowsCompute an Enrichment for every row you already have, or only for the rows you need. Rows that no Task has computed read NULL.
03Refresh only what changedA refresh Task computes the new rows and the rows whose inputs changed, and nothing else. One changed input row recomputes one row, and table maintenance reruns no model.
Derived Columns

Write the logic once, update automatically.

A Derived Column is part of the table’s schema: an expression over the stored columns of each row. Old and new rows read it as soon as you declare it, and a fill Task stores the values so that scans skip the work.

Python · contacts/slip_distance

Docs
import spiral
from spiral import call, column

client = spiral.Client()
main = client.project("robotics").branch("main")
contacts = main.table("contacts")

# Each contact row holds 2 s of object_position.
pos = column("object_position")
first = call("spql.list.first", pos)
last = call("spql.list.last", pos)
slip = call("spql.tensor.l2_norm", last - first)

contacts = contacts.declare_derived_column("slip_distance", slip)
commit = main.commit()
commit.update_table(contacts)
commit.publish()

one value per contact object_position in mm, from tracker_v3

What you keep

Each Enrichment records what it was derived from.

Each version stores its expression, including the model and the columns that it reads, and the source table version that its values cover. Tags, run records, and checks read it at a version that you pin, not from a copy that can drift.

LineageExample · episodes

Source column

  • top_cameravideo · recorded column

Enrichment versions

  • subtasksversion 7a1c5e02spql.ai.breakdown_task(top_camera)covers episodes @ 41f2c9
  • progressversion c90d2b6fspql.ai.warp_rm(top_camera)covers episodes @ 41f2c9
  • subtask_countversion 3f0b8e61spql.list.len(subtasks)covers episodes @ 41f2c9

Incremental refresh

  1. 01Commit 9d03e1 changes top_camera in 3 rows.
  2. 02subtasks and progress mark those 3 rows stale, and they read NULL until a refresh. Every other row keeps its value.
  3. 03A refresh Task computes those 3 rows and publishes versions that cover 9d03e1. Then subtask_count recomputes the rows where subtasks changed.
faqs

Before you add a column.

An Enrichment can use any SPQL function on the columns of its row, and the models that Spiral runs, each pinned to a revision. Each version of an Enrichment records its definition, including the model, and the source table version that it covers.

Use an Enrichment for a model’s output, or for a column on a table that you do not own. A Task computes its values into its own files, with its own grants, and rows that it has not computed read NULL. Use a Derived Column for an exact expression over your own table’s columns. It is part of the table’s schema, and reads compute it.

It runs beside the data, on your own compute. Spiral schedules the work on the recordings where they are.

Yes. An Enrichment is its own resource, and it can live in your project. Compute columns over public, partner, or cross-cloud data that you can only read. The source table does not change, and large objects such as video stay where they are.

You publish a new version of the Enrichment, and Spiral computes it for every row. Each training set stays on the old version until you move it, and the source recordings do not change.

No. You can fill an Enrichment for only the rows that you need and backfill the rest later. A refresh computes only the rows whose inputs changed. A Derived Column needs no fill at all, because reads compute it.