Skip to main content
With your data connected and indexed, you’re ready to build semantic models in VS Code. This guide covers setting up the IDE, connecting to Credible, and using AI assistance to create your models.

Set Up VS Code

Install the Extension

  1. Open VS Code and go to Extensions (Cmd+Shift+X on Mac, Ctrl+Shift+X on Windows/Linux)
  2. Search for “Credible” and install the extension
  3. Restart VS Code to activate the extension

Connect to Credible

  1. In the VS Code Explorer sidebar, expand “Credible Service”
  2. Click “Sign In” and add your organization name
  3. Complete the login flow in your browser
  4. Select your project from the dropdown
VS Code Service Panel The Credible Service panel shows your projects, connections, and published packages. The extension automatically discovers your project’s database connections—no need to store credentials locally.

VS Code Extension Features

The extension provides several panels and features to help you build models:
  • Connection Explorer: Browse your connected databases, schemas, and tables
  • Local Packages: View and publish packages from your workspace
  • Malloy Schema Explorer: See all sources, dimensions, measures, and views in your .malloy files
  • Schema/Explore/Preview buttons: Above each source, use these to view structure, open the Data Explorer, or preview data

Building Models with AI

The Credible AI agent has access to your connected data sources and can build semantic models through natural conversation:
  1. Open the Credible Chat panel in VS Code
  2. Give the agent a prompt like: “Build a model of ecommerce so I can analyze sales by product and brand”
  3. Follow the agent’s prompts and review the generated model in your editor
The AI agent will analyze your data and create:
  • Sources connected to your tables
  • Dimensions for grouping and filtering
  • Measures for calculations and aggregations
  • Joins between related tables
  • Views for common analysis patterns

Add Views to Your Model

Create reusable views to validate your model:

Create Nested Views

Build complex analyses with nested queries:

Test & Validate

Once the agent generates your model, you can test or improve it in a few ways:
  • Click “Run” to execute queries defined in your Malloy model
  • Click “Explore” to open the Data Explorer for visual analysis
  • Ask the agent to update the model for you, or edit the code yourself
VS Code Results

Working with Your Model

Package Structure

A complete package can contain:
  • .malloy files - Your semantic model definitions
  • .malloynb files - Malloy notebooks for analysis and documentation
  • data/ folder - Embedded CSV or Parquet files
  • package.json - Package manifest with metadata

Running Queries

You can execute queries in multiple ways:
  1. Run button - Click Run next to any view definition
  2. Explore button - Open the visual query builder
  3. Command palette - Use Malloy: Run Query command
  4. Inline execution - Right-click on a query and select Run

Iterating on Models

The development workflow is designed for rapid iteration:
  1. Make changes to your model definition
  2. Save the file to trigger validation
  3. Run queries to test your changes
  4. View results inline or in the results panel
  5. Refine based on results and requirements

Next Steps

I