Skip to main content
On this page

Model Workspaces

Workspaces

The boundary for saved analysis: one shared model, the filters every query shares, and the queries, charts and dashboard built on it.

Audience
Data teams
Prerequisites
  • A semantic model or Kater dataset to start from

A workspace is where analysis is saved. Its root reads exactly one shared model and sets the filters and parameters every query in it shares. Queries, charts, a dashboard and apps live inside it. A workspace is private to you, or shared on the connection for your team.

What a workspace holds

PathWhat it is
workspace.sqlThe root: one model_type: workspace declaration over one semantic model or Kater dataset.
query_contracts/<name>.sqlQueries. A file can hold several. See Queries.
charts/<name>.sqlSaved charts, each bound to one query.
dashboard.yamlThe workspace’s one dashboard, made of its saved charts. See Dashboards.
default-inputs.jsonSaved parameter values and filter selections.
tests/<root>.sqlTests of the root’s filters and parameters, in a connection workspace.
apps/<app>/Apps of a connection workspace. Your own apps live beside your workspaces, in users/<email>/apps/.

Private and connection workspaces

KindPathWho can edit it
Privateconnections/<c>/users/<email>/workspaces/<w>/You, and anyone you share it with. Organisation admins have full access.
Connectionconnections/<c>/workspaces/<w>/People with edit access to that folder.

A workspace’s identity is its full path, owner included, so two people’s workspaces with the same name never collide. A workspace is never verified: only a field is. To recommend a workspace, add curated: ["true"] to its tags. A tag grants no access. See Promotion and verification and Files and access.

The root

workspaces/shop/workspace.sql
---
name: shop
model_type: workspace
label: Shop
description: Orders from the sample DuckDB shop, with each order's customer.
parameters:
- name: is_one_of__region
label: Region
kater_data_type: string
subtype: multiselect
- name: order_date
label: Order Date
kater_data_type: date
subtype: range
- name: min_amount
label: Minimum amount
kater_data_type: number
default_value: 0
---
SELECT
*
FROM semantic.shop
WHERE
OPTIONAL_FILTER('is_one_of__region', KATER__IS_ONE_OF(region, $is_one_of__region), label='Region')
AND OPTIONAL_FILTER('order_date', KATER__IS_BETWEEN(order_date, $order_date), label='Order date')
AND OPTIONAL_FILTER('min_amount', KATER__IS_AT_LEAST(amount, $min_amount), label='Minimum amount')

SELECT * passes every field of the shared model through, each measure still a measure. The root can also select fields by name, declare new dimensions and measures, and hold optional and required filters.

KeyWhat it doesExample
nameThe root’s name. Queries read it as workspace.<name>. It does not need to match the folder.shop
model_typeAlways workspace.workspace
label, description, ai_contextDisplay name, a sentence for people, and guidance for agents working in this workspace.label: Shop
business_questions, tagsWhat the workspace answers, and tags by facet.- Which ads have spend but no reported conversions?
parametersThe workspace’s variables. Every query can read them. See Filters and parameters.- name: min_amount
query_orderThe order of the query tabs, as a list of query names. Dragging a tab writes it.[spend_by_platform, ...]
insights, chart_authoringOptional settings for insight templates and chart authoring.
  • One source. The root reads exactly one semantic model or Kater dataset, including a custom SQL dataset. It cannot join.
  • No windows. Its optional filters apply first, so a window would change with each reader’s filters. Put windows in a query.
  • The root is the workspace overview. In the workspace editor, Workspace in the header opens the root as the workspace overview.

Create a workspace

  • From Explore. New workspace and Make something new › Workspace on the Workspaces page open Explore, and so does File › New workspace in a workspace. There, Add to workspace saves cards as queries, in a new or an existing workspace.
  • From a shared model. With a model open in Shared models, select File › Start a workspace from this model. The New workspace dialog opens on Manual, with the model filled in. New › Workspace opens it on Prompt AI, where you describe the workspace.
  • From a terminal. kater new workspace NAME --connection CONNECTION --from-model semantic.shop. Add --kind connection for a connection workspace. kater workspace source use MODEL --scope WORKSPACE gives a workspace another source.
  • From your agent. It creates a private workspace for you.

A workspace made without a model opens on a start page, where you search for a model or select one in the Model Selector. See Workspaces under Analyze.

The workspace overview

The overview is the root, drawn as a page. It opens from Workspace in the header, and the Files page and the VS Code extension show it for any workspace.sql. Its three tabs are Overview, Definitions and Source.

The Marketing Sessions overview with its bar, title block and facts, the About and Data sections, and nine Workspace filters as cards
The overview of the Marketing Sessions workspace.

Overview

The title block shows the name, the description and the facts: the model with its verified mark, the number of queries and filters, how many fields were added, and who changed the workspace last. Add a description writes description into the frontmatter. The sections below it map to the root like this:

SectionWhat it shows and editsIn the root
AboutBusiness questions, AI context and tagsbusiness_questions, ai_context, tags
DataThe model it reads, how many fields from how many sources, and Preview sampleFROM semantic.<model>
Workspace filtersA card for each filter: its switch, condition and value. Each card’s settings edit the filter and its parameter. Add makes a filter or a parameter.The filters in WHERE, and parameters
ParametersThe parameters no filter reads, with type, values, default and valueparameters
Added in this workspaceEach field the root declares, with its expression, “Used by” and how many queries, and its menuFields declared in the SELECT
QueriesEach query, its columns and when it last changedquery_contracts/

More in the bar has Show SQL parameter names and Reset filters to defaults. See Filters and parameters for the filter cards and their settings.

Definitions

Every field the workspace offers, as a card with its address, description and what it computes. Fields from the model come first, by measures and dimensions. Created in this workspace follows, with the root’s fields and then each query’s. Open definition in any field menu lands here, on that field’s card.

The Definitions tab: From Marketing Sessions, Measures, and the lifetime_sessions card with its address, Inputs and Computes
The overview’s Definitions tab.

Source

The root’s Kater SQL, which you can edit in place. It saves itself, and it compiles when you ask.

Change the model

Select Change Model in the overview’s bar, or in the model button’s menu. Before anything changes, If you switch checks every query’s fields and every filter against the new model. It lists each query that loses a field, each filter that keeps working or is removed with the field it needs, and the fields added in this workspace. Switch to the model writes the new source into workspace.sql, and a message offers Undo.

Change Model with GA4 Lifecycle Sessions selected: two queries lose Lifetime Sessions, 7 filters keep working, two filters are removed, and Switch to GA4 Lifecycle Sessions
Change Model shows what breaks before you switch.

After the switch, a query that reads a missing field cannot run. Its rows name the field and offer Replace with and Remove column. From a terminal, kater workspace source use MODEL --scope WORKSPACE changes the source.

Try changes safely

To change a workspace without touching the original, copy it into your brainstorm folder: kater brainstorm copy WORKSPACE --topic TOPIC. The copy’s banner offers Compare and Apply, and kater workspace apply COPY writes it back. See Try changes safely.

Common errors

CodeCauseFix
window_not_allowedA window in the root.Move it to a query.
relationship_not_allowedA join in the root.Join in the shared model, or in a query.
field_name_in_scopeA root field takes the name of a field in the shared source.Give it a new name.
parameterized_required_filterA required filter reads a parameter.Make it optional.