Skip to main content
The fastest way to build a semantic model is with the Cursor agent. The Credible Extension equips the agent with MCP tools to discover your data, modeling skills to guide best practices, and Malloy-aware rules — so it can analyze your data sources and generate a comprehensive model with sources, joins, dimensions, and measures.
New to semantic modeling? See What is a Semantic Layer? to understand the concepts, or the Malloy Language Documentation for language details.

Prerequisites

The agent only knows about your data after the connection is indexed — this is configured when you set up the connection. Indexing can take some time, so if the agent doesn’t have data for a new connection, wait a few minutes and verify you’re within the table limits.

Build a Model with the Agent

  1. Open Cursor’s agent chat and describe what you want to model. Be specific about your data and analysis goals:
    • “Build a model of my ecommerce data so I can analyze sales by product and brand”
    • “Create a semantic model for customer analytics including lifetime value”
    • “Model the orders table with customer and product relationships”
  2. The agent discovers your data — Using its MCP tools, the agent explores your available tables and schemas, then generates a .malloy file with sources, joins, dimensions, measures, and views. The extension’s skills and rules guide the agent to follow Malloy best practices automatically.
  3. Review the generated model in your editor and approve the changes.
The agent will create:
  • Sources connected to your tables
  • Joins between related tables
  • Dimensions for grouping and filtering
  • Measures for calculations and aggregations
  • Views for common analysis patterns

Working with the Agent

Beyond initial model creation, the agent can help with a range of modeling workflows:
  • Build and modify models — Generate sources, joins, dimensions, and measures, or refine existing ones
  • Explore available data — Discover tables and schemas in your connected databases
  • Fix compile errors — Diagnose and fix Malloy syntax errors
  • Create interactive dashboards — Build .malloynb notebooks with visualizations and filters
  • Document your model — Add #(doc) and #(index_values) tags for AI discoverability. These tags are what the Credible Context Engine searches against during analysis — good documentation directly improves the quality of chat-based analysis downstream
  • Publish — Type /credible-publish in the agent chat to publish your model to the Credible service
  • Learn Malloy — Ask the agent questions about the Malloy language (e.g., “How do I write date filters in Malloy?”)

Validate as You Build

Use the buttons above each source definition to validate your model:
  • Schema — View the compiled structure of your source
  • Explore — Open the Explorer to interactively query
  • Preview — Quick data preview to verify connections

Next Steps