Semantic Layer

Explore and manage the semantic model powering your AI Assistant.

The Semantic Layer page gives you a visual representation of the semantic model that your AI Assistant uses to translate natural language questions into accurate data queries. You can browse datasets, fields, and relationships, track generation status, and regenerate the model when your knowledge base changes.

  1. Open your workspace and navigate to AI Assistants in the sidebar
  2. Select your assistant
  3. Click Semantic Model in the assistant's sidebar

Semantic Layer overview showing summary stats and ERD

Summary Statistics

At the top of the page, you'll see a summary of your semantic model:

StatDescription
DatasetsNumber of logical tables in the model
FieldsTotal number of dimensions, time dimensions, and facts across all datasets
RelationshipsNumber of defined joins between datasets
MetricsNumber of pre-defined calculations (e.g., Total Revenue, Customer Count)

Entity Relationship Diagram

The Semantic Layer includes an interactive ERD (entity relationship diagram) that visualizes how your datasets connect to each other. This makes it easy to understand the structure of your semantic model at a glance.

  • Datasets appear as nodes with their field counts
  • Relationships appear as edges connecting related datasets
  • Hover over a relationship to see the join columns and join type

ERD visualization showing dataset nodes and relationship edges

Dataset Details

Click on any dataset in the ERD or the dataset list to view its details:

  • Fields — All columns in the dataset, categorized as dimensions, time dimensions, or facts
  • Description — A plain-language description of what the dataset represents
  • Base table — The underlying database table the dataset maps to

Each field shows its name, data type, and description. Descriptions are generated from your Knowledge Base factors and schema metadata.

Generation Status

The Semantic Layer page shows the current status of your semantic model:

StatusMeaning
PendingModel generation has been queued but hasn't started yet
GeneratingModel is being built from your data schemas and knowledge base
SucceededModel was generated successfully and is ready to use
FailedGeneration encountered an error — check the error message for details

When generation is in progress, the page displays a progress indicator. You can continue using other parts of the assistant while generation completes.

Regenerating the Model

When you make changes to your Knowledge Base — approving new factors, adding definitions, or correcting business rules — your semantic model may become out of date.

A banner appears at the top of the Semantic Layer page when knowledge base factors are newer than the current model. To update the model:

  1. Click the Regenerate button
  2. Precog rebuilds the semantic model incorporating your latest knowledge base changes
  3. The new model replaces the previous version once generation succeeds

Note: Regeneration runs asynchronously. You can continue working while the model rebuilds.

Downloading the Model

You can download the semantic model as a JSON file in OSI (Open Semantic Interface) format:

  1. Click the Download button on the Semantic Layer page
  2. The model is saved as a .json file

The OSI document contains the complete semantic model — datasets, fields, relationships, metrics, and descriptions. You can use this file for external tools, auditing, or version control.

Version Tracking

Each time the semantic model is regenerated, Precog tracks the version. You can see the current model version on the Semantic Layer page, along with when it was last generated.