Skip to content

Get started / 4. Generate a model

4. Generate a model ​

After every successful scan, Keel generates the semantic model for each model that includes the source (automatic generation is on by default). A workspace with no model gets one — "Semantic model", authored by Keel — on its first scan. You can also run it on demand: POST …/models/{id}:generate.

What generation uses ​

  • Accepted proposals, plus High-confidence undecided ones by default (joins ≥ 0.85, table classifications ≥ 0.6). Rejected proposals never.
  • Staging and unclassified tables are left out, with a note saying why.

What it produces ​

  • Entities for facts, dimensions and slowly changing dimensions, with dimensions (and time grains), measures, hierarchies (from functional dependencies proven on the profile sample) and segments.
  • Joins with cardinality and roles — including role-playing dates such as order, due and ship date.
  • Metrics: count measures and simple metrics; with an LLM, suggested ratio and derived metrics (names only, never values) stored as Draft with origin LlmSuggested, confidence ≤ 0.7 and the rationale.
  • Every object carries provenance (origin, confidence, rationale), so generated objects stay identifiable.

On AdventureWorksDW, generation produces 29 entities, 47 joins and 36 metrics with no validation errors.

Where it goes ​

Generation never touches main. It commits to a branch named keel/proposals-{run} and opens (or re-checks) one change request. Objects you defined yourself on that branch win over regenerated ones. Re-running generation for the same scan is idempotent: it commits only when the content changed.

Look at it ​

  • Change requests › #n — the object-level diff, the checks, reviewers.
  • Workspace (/models/:id/workspace) — the model as a graph: entity cards with typed fields, crow's-foot joins, domain groups, trace path, problems panel, a YAML code view and SQL preview. Edits autosave to your private working copy and commit to a branch (main is protected). Proposed objects are drawn dashed with their confidence.
  • Strategy (/models/:id/strategy) — see below.

The strategy report ​

Keel recommends how to deliver the layer, not only what is in it. It measures the schema's shape (star-ness, normalization depth, subject areas, volumes, cross-source joins) and scores four patterns 0–100 with a rationale: Star-schema centric, Entity / metrics-first, Virtual / federated and One big table. It also suggests where to serve (from a short questionnaire), derived facts for header/detail pairs (with the SQL, in the source's dialect), readiness, and up to ten next actions you can tick off.

Next: 5. Release it.

Anchor Keel is a working product name: one platform, a shared core and licensed modules (Keel Semantic, Keel Migrate). Documentation built from the repository — facts are derived from code, ADRs and the decisions log.