Skip to main content

Definitions

Definitions say once what your project's business words mean in SQL: how revenue is computed, which customers count as active, which orders count at all. A person certifies each one, and from then on Smart search and agents apply it instead of guessing, so the same question gets the same answer everywhere.

RushDB Cloud

Definitions are provided by RushDB Cloud. On a self-hosted engine, keep the equivalent rules in your own prompts and in the SQL you run.

Kinds​

KindWhat it isExample
MetricOne SELECT that computes a number or a tableSELECT SUM("amount") AS revenue FROM "ORDER" WHERE "status" = 'completed'
FilterA condition over one label's rowsOn CUSTOMER: "status" = 'active' AND "churned_at" IS NULL
InstructionsFree text about the project, up to 4,000 characters"Amounts are in cents. A customer is a company, not a person."

Each metric and filter has a name (up to 80 characters), an optional description and up to 20 synonyms: the other words people use for it ("sales", "turnover" for revenue).

Create a definition​

  1. In the project sidebar, open Definitions under Knowledge.
  2. Choose New definition.
  3. Describe it in plain language, for example "only completed orders count for revenue", and choose Draft. The kind, name, SQL and synonyms are filled in for you to review; if the description names an existing definition, the draft revises it. You can also skip the draft and write the SQL yourself.
  4. Choose Create. The SQL is checked against your data before it is saved: SQL that doesn't run is refused with the engine's error.

A definition you create is certified right away.

Review suggestions​

Suggest definitions proposes metrics and filters from your schema and saved queries. The ones whose SQL runs appear under Suggested:

  • Certify puts a suggestion to use.
  • Ignore moves it to Ignored. A name you ignored is never suggested again.

Only certified definitions are used. Editing a definition checks its SQL again. Deleting one stops Smart search and agents from using it right away.

Drafting and suggesting each count as one AI action.

Where definitions apply​

  • Smart search. Every request carries the certified definitions and instructions. The response's definitions lists the ones the generated SQL used, and the dashboard names them after the search.
  • Agents. The schema Markdown (getSchemaMarkdown, and the MCP server's tool of the same name) ends with a ## Definitions section: the instructions, then each metric and filter with its synonyms and SQL. Agents that read the schema first apply them without any change on their side.
Text
## Definitions

### Instructions

Amounts are in cents.

### Metrics

- **revenue**: Earned sales. Also called: sales, turnover. Computed by:

SELECT SUM("amount") AS revenue FROM "ORDER" WHERE "status" = 'completed'
tip

Write definitions in the words your team uses in questions. Synonyms are how "turnover last quarter" finds revenue.

See also​