← Docs · Agents and AI

Shared definitions

Define your metrics, tables and joins once, so Fastero's assistant and Claude write SQL that agrees with your team's own numbers.

Checked against the app on 2026-12-02

Shared definitions record what your organization's numbers mean: the SQL expression behind a metric, which table holds what, and how tables join. Fastero's assistant reads them before it writes SQL, and Claude reads them over MCP, so "revenue" means the same thing in every answer. Owners, Admins, Editors and Viewers can read them; Owners, Admins and Editors can change them.

What a definition is

There are three kinds:

  • Metric: a name and one aggregate SQL expression, such as SUM(CASE WHEN status = 'paid' THEN amount END). It can have a description, synonyms, a grain and instructions, such as "exclude test accounts".
  • Dataset: a table, such as public.orders, with a description, its primary key and its fields. Each field can have a description, and can be marked as a time field.
  • Relationship: how two datasets join, with the columns on each side.

A definition applies to every connection, or to one connection only. One saved for a single connection takes the place of an organization-wide one of the same kind and name on that connection.

Alongside them, Claude also receives the notes in Settings → AI instructions, which Owners and Admins write and every member can read.

Edit definitions in the Semantic Layer

  1. In the workbench, choose Semantic in the icon rail on the far left. The rail is not shown on Home; Expand Apps at its bottom shows each icon's name. The Semantic Layer page opens with every definition as text in Raw YAML, including the ones Claude saved.

  2. Edit the text. Datasets are listed under entities:

    metrics:
      - name: revenue
        expression: SUM(CASE WHEN status = 'paid' THEN amount END)
        description: Value of paid orders
        synonyms: [sales]
    entities:
      - name: orders
        tables: [public.orders]
        primaryKey: [id]
        dimensions:
          - name: created_at
            isTime: true
    relationships:
      - from: orders
        to: customers
        fromColumns: [customer_id]
        toColumns: [id]

    A definition saved for one connection carries a connectionId line. Leave it in place to keep it limited to that connection.

  3. Click Validate to check for metrics with no name, duplicate names and metrics with no expression.

  4. Click Save. If Claude or a teammate saved since you opened the page, the save is refused: copy your edits, reload, and apply them again.

To see the SQL a metric produces, choose a Metric and a Table under Preview Metric SQL and click Generate.

Import and export

  • Export Ossie downloads the definitions as an Apache Ossie 0.1.1 file, definitions.ossie.json.
  • Import Ossie reads an Ossie file in JSON or YAML. Each item in it replaces the definition of the same kind and name, and every other definition stays as it is. The page then says what it imported and anything it left out.

Every save, from the editor, an import or Claude, makes a new version of the definitions.

How Fastero's assistant and Claude use them

Fastero's assistant gets a connection's definitions each time it reads that connection's tables, which it does before writing a query.

Claude over MCP has two tools:

  • fastero_get_definitions returns the definitions for a connection, the organization-wide ones plus that connection's own, and the AI instructions. Claude can pass a word to search names, synonyms and descriptions.
  • fastero_save_definition saves or removes one definition. Claude is told to save one once you have confirmed what a number means, not on a guess.

When Claude saves a query, it can record which definitions the query was built from, and at which version.

Through a key, reading needs the Read your connections, queries, dashboards and files permission and saving needs Create and update queries, dashboards and reports. See Connect Claude to Fastero.

Who can do what

Action Owner Admin Editor Viewer
Read definitions, in the Semantic Layer or through Claude Yes Yes Yes Yes
Export Ossie Yes Yes Yes Yes
Save or remove one definition through Claude; Import Ossie Yes Yes Yes No
Save the whole document; Validate; Preview Metric SQL Yes Yes No No

Auditors cannot open definitions.

Related