How to Generate a Semantic Model in Precog

Precog can automatically generate semantic models for your data connections, enabling natural language queries through Snowflake Cortex Analyst. This guide walks you through enabling semantic modeling and generating your first model.

Prerequisites

Before you begin:

  • You have a Snowflake destination configured in your workspace
  • You have at least one data source connected

Steps

1. Open Your Workspace

From the Organization Dashboard, select the workspace containing the sources you want to model.

2. Create or Edit a Connection with Semantic Modeling

Semantic modeling is configured at the connection level. When you create or edit a connection, you describe the use cases you want the semantic model to address.

When Creating a New Connection

During connection setup, after selecting your sources and destination, you'll see a step to describe your use cases. This tells Precog how to generate the best semantic model for your data.

For an Existing Connection

  1. In the workspace menu, select Connections
  2. Select the connection you want to add semantic modeling to
  3. Edit the connection to add use case descriptions

3. Write a Clear Use Case Description

The quality of your semantic model depends on how well you describe your use case. Include:

  • What business questions this data should answer
  • Key metrics and KPIs that matter
  • Important entities in your data (customers, orders, products, etc.)
  • How you want to slice the data (by region, by time period, etc.)

See Writing Effective Use Case Descriptions for detailed examples and templates.

4. Run a Data Load

Once use cases are configured on your connection, trigger a data load to generate the model.

Go to Connections, find the connection, and select Run Now.

During this run, Precog will:

  1. Load your data into Snowflake from all connected sources
  2. Analyze the schemas across your sources
  3. Generate a semantic model that spans your entire connection
  4. Upload the model to Snowflake

5. Track Model Generation

After the run completes, you can track the status of your semantic model directly on the connection details page. The Semantic Models card shows:

  • Semantic contexts with their generation status (pending, processing, succeeded, or failed)
  • Connected sources as compact chips for quick reference
  • Generation history showing past runs and their outcomes

6. View Your Semantic Model in Snowflake

After the model generates (typically within 5 minutes), it will be available in Snowflake. You can:

  • View the YAML file directly in Snowflake
  • Edit the model to add descriptions, synonyms, or custom metrics
  • Use the model with Snowflake Cortex Analyst for natural language queries

If your destination is Snowflake, you'll see an Open Cortex button on the connection page for quick access.

Result

Your semantic model is now generated and available in Snowflake. Each time you run the connection, the model updates to reflect any schema changes in your sources.

Users with access to your Snowflake warehouse can now use Cortex Analyst to ask natural language questions about your data, such as:

  • "What were total sales last month?"
  • "Show me the top 10 customers by order value"
  • "How does this quarter compare to last quarter?"

Multi-Source Semantic Models

A key advantage of connection-level semantic modeling is multi-source support. When your connection includes multiple data sources, Precog generates a unified semantic model that spans all of them.

For example, if your connection includes both a CRM source (like HubSpot) and an accounting source (like Xero), the generated semantic model can answer questions that join across both:

  • "Which customers with the highest deal values also have overdue invoices?"
  • "How does sales pipeline activity correlate with revenue trends?"

This cross-source intelligence is generated automatically — you just need to describe the use cases that span your data.

Why Semantic Models Matter

Self-service analytics: Business users can query data without writing SQL or waiting for analyst support.

Consistent definitions: Metrics like "revenue" or "active customer" are defined once and used consistently across queries.

Faster insights: Natural language removes the translation step between business questions and data queries.

Cross-source intelligence: A single semantic model can span multiple data sources, enabling questions that would otherwise require manual SQL joins.

Practical Advice

Write clear use cases: The quality of your semantic model depends on how well you describe your use case. Include specific metrics, entities, and the types of questions you want to answer. See Writing Effective Use Case Descriptions for examples and templates.

Start with your most important connection: Generate semantic models for your highest-value data pipeline first. Expand to other connections once you're comfortable with the workflow.

Review the generated model: While Precog creates a solid baseline, you may want to add business-specific descriptions or synonyms to improve natural language matching.

Combine related sources: If you have sources that users frequently need to analyze together, put them in the same connection to get a unified semantic model.

Next Steps

Once your semantic model is generated, you can improve its accuracy over time: