For the complete documentation index, see llms.txt. This page is also available as Markdown.

Exploring and editing a context model

Find, open, explore, edit, compare, share, archive and delete Kaiya context models from the Context Models tab on the Data page.

Every Kaiya context model you can open is listed on the Data page, in the Context Models tab next to Business View. From there you can read everything the model holds, see its joins as a diagram, edit its YAML, compare versions, review suggestions, and share, archive or delete it.

The Context Models tab appears only when your role has Read Access or Full Access to the Context Models module. With Read Access, you can open and read models but not change them: creating, editing, sharing, archiving and deleting a model need Full Access. See Who can work with a context model.

Watch a one-minute walkthrough, or read the sections below.

The Context Models list

The list is a table with these columns:

  • Name: the model's name, its current version (for example, v1), an Archived tag for an archived model, and its description.

  • Datasource: the datasource's icon and name, and a Live or Non-live tag.

  • Owner: who owns the model.

  • Updated: when the model was last saved.

Select anywhere on a row to open the model.

Use the controls above the list to narrow it down:

  • Search context models: find a model by name.

  • All, Mine, Shared with me and Archived: show every model you can open, only the models you own, only the models others have shared with you, or only archived models. Archived models don't appear in the other tabs.

  • Datasource: once your models use more than one datasource, pick one to list only its models, or Non-live for models that aren't on a live datasource.

Each row has a menu (three dots) with Share, Archive (or Unarchive for an archived model) and Delete. You see only the actions you can take: Share needs a role that can share context models, and Archive and Delete are for the model's owner or an admin.

The Context Models list, with the All, Mine, Shared with me and Archived tabs
The row menu in the Context Models list, with Share, Archive and Delete

When there are no models yet, the tab shows No context models yet with two buttons, Build with Kaiya and Migrate a Business View.

Creating a context model

Select New context model. The dialog offers two ways to start:

  • Build with Kaiya: opens a conversation in which Kaiya asks which datasource and tables to model, checks them against the data, and saves the model when you agree.

  • Migrate a Business View: pick a view from the Business View list, then select Migrate with Kaiya. Kaiya writes a new context model from the view and shows what couldn't carry over. The view isn't changed.

Cancel or the close icon closes the dialog. Both paths continue in the chat. See Building a context model in the conversation.

The New context model dialog, with Build with Kaiya and Migrate a Business View

The context model page

Opening a model shows its page. The header holds:

  • the back arrow, which returns to the list,

  • the model's name, with a Live or Non-live tag and, for a live model, its datasource type (for example, Snowflake),

  • Version: lists every saved version, with the current one marked (current). Pick an older version to read it. The page then shows Viewing vN (read-only) and Back to current version, and nothing can be changed until you go back to the current version.

  • Edit, and a menu (three dots) with Share, Archive (or Unarchive) and Delete. The menu is hidden while you edit.

The tabs below the name are Explore, Diagram, Suggestions, Versions and YAML. The Suggestions tab appears only when suggestions are turned on, and shows how many are pending. See Context model suggestions.

The menu in a context model's header, with Share, Archive and Delete

Explore

Explore shows the model's description and its tables. In this model, on the left, lists the parts of the model with how many items each holds: Tables, Relationships, Metrics, Vocabulary, Rules and Analyses. Use it to move between the sections.

Section
What each row shows

Tables

The table's display name, its name in the datasource, a green dot when it is live, its row count and its number of columns.

Relationships

Joins (which table joins to which), Use when (the questions the join is meant for), Cardinality, Fan-out guard, Join on (the exact key match) and Technical name.

Metrics

Metric, Description, Synonyms (other words people use for it), Format (for example, a percentage with one decimal), Formula (the calculation in the datasource's SQL) and Technical name.

Vocabulary

Term, Means (what the term stands for in your business) and Maps to (what it becomes in a query, usually a filter).

Rules

Name, Description, Applies to (the tables or metrics it covers), Use when, Rule (the instruction itself) and Technical name.

Analyses

Step-by-step recipes for the questions the business asks most. No analyses yet means the model has none so far.

Cards at the right show the model's state at a glance:

  • Suggestions (when suggestions are on): how many are pending and when Kaiya last ran.

  • Used by: the Missions, Apps and conversations that use the model, or No mission, app or conversation uses this model yet.

  • Versions: the latest version, with All versions to open the Versions tab.

The Explore tab, with the In this model list on the left and the Used by and Versions cards on the right

Opening a table

Select a table to see its details. The table page shows its description, its grain (for example, One row per TERRITORY_ID), its row count and how many measures it has. Below that:

  • Columns lists every column with Display name, Role (for example, Dimension), Description, Synonyms, Aggregation, Point in time, Security tag and Data type. Use Search columns to find one.

  • Relationships lists only the joins that involve this table. Not joined means no relationship connects the table to the rest of the model.

Select the back arrow beside the table name to return to the model.

Diagram

Diagram draws the tables and their joins.

  • Each table card shows the table name, whether it is a fact or a dimension table, and its number of columns. Select Show N columns to list the columns on the card, and Hide columns to fold them away.

  • Lines between cards show each join with its cardinality, for example N:1 (many to one).

  • Select Auto layout to arrange the cards neatly. Use the zoom controls at the bottom left to zoom in, zoom out, or fit the whole diagram on screen. Selecting a table highlights it, and Clear selection removes the highlight.

  • Beside the diagram, Relationships lists one card per join, with the key match, the cardinality and the "use when" note. On a narrow screen, the list sits below the diagram.

The Diagram tab, with the Relationships list beside the diagram and Auto layout

If the YAML has an error, the diagram can't be drawn and the tab shows the error instead.

YAML

YAML shows the whole model as it is stored: vocabulary, tables, columns, relationships, metrics, rules and analyses, the calendar and the default date column, with the version number. The calendar and the default date column appear only here, not in Explore. The tab is read-only until you select Edit.

Editing the YAML

You can edit a model if you own it, if you are an admin, or if it is shared with you with Can Edit access. In each case, your role also needs Full Access to Context Models.

  1. Select Edit. The YAML tab opens as an editor, and the header shows Cancel, Validate and Save as new version. The Version list is inactive while you edit.

  2. Make your change in the editor.

  3. Select Validate to check the model. Kaiya reports The model is valid. or the number of problems to fix.

  4. Select Save as new version. The model is saved as the next version, and Kaiya answers from it straight away. To drop your changes, select Cancel instead.

If someone else saved a version while you were editing, the save stops and asks you to load the latest version into the editor and apply your change again. Select Load latest to do that. If you try to leave the page with unsaved changes, Tellius asks whether to discard them.

Edit the YAML or ask Kaiya? Edit the YAML for a small, exact change you already know how to write, such as a synonym or a description. Ask Kaiya in the chat for anything that depends on the data, such as a new join or metric, because Kaiya checks it against the data and runs draft checks before it saves.

Versions

Versions lists every saved version with Version, Saved by, Saved at, Name, Description and Actions. The current version is marked (current). A model with a single version shows This model has one version; save a change to compare versions.

To see what changed, select Compare with current on an earlier version. The comparison shows how many changes there are and lists the Changes by section: each table, relationship, metric, term, rule or analysis that was added, removed or changed, and which fields changed, with changed rows tinted. If two versions have the same content, the comparison says so. Below that, YAML, side by side shows both versions' YAML next to each other, with removed lines in red and added lines in green.

Sharing a context model

Select Share in the model page's menu (three dots), or in the row menu in the list. In the Share Context model dialog:

  1. Under Share with, type a first or last name, username, email or user group name.

  2. Choose the access level: Can view or Can Edit. The Business View, datasets and datasources the model uses are shared along with it.

  3. Select Share, or Cancel to close the dialog without sharing.

People you share with see the model under Shared with me. Anyone with Can Edit access can edit the model and approve, publish or reject suggestions, as long as their role has Full Access to Context Models. Sharing a model also needs Full Access. Only the owner or an admin can delete it.

Archiving and deleting

  • Archive hides a model from the main list without deleting it. Open the Archived tab to see it again, and select Unarchive to bring it back.

  • Delete removes the model and all its versions, and conversations that used it no longer have it. This can't be undone. Only the model's owner or an admin can delete a model. Before deleting, Tellius checks what still uses the model. If Kaiya Missions, Kaiya Apps or conversations depend on it, the dialog lists them under This model is still in use. Those Missions and Apps are kept but lose their data source, so published Missions fail on their next run and Apps stop refreshing. To delete anyway, you must confirm that you understand this.

Last updated

Was this helpful?