Data Analysis
bsl-model-builder avatar

bsl-model-builder

Expert tool for building and managing BSL (Boring Semantic Layer) models, including dimensions, measures, joins, and YAML configurations, powered by Ibis.

Introduction

The BSL Model Builder is an specialized agent skill designed to bridge raw database tables with business-ready semantic models using the Boring Semantic Layer. It is built upon the Ibis framework, providing a high-performance, Python-native abstraction that enables developers and data analysts to define reusable data models programmatically or via YAML configuration. The tool is ideal for organizations looking to standardize their metrics, streamline BI reporting, or provide structured data interfaces to LLMs and automated agents. By translating complex SQL operations into a fluent, object-oriented API, this skill allows users to define categorical dimensions, quantitative measures, and sophisticated table joins with minimal boilerplate code.

  • Define granular semantic tables using Ibis-powered expressions including lambda functions and unbound syntax for efficiency.

  • Configure time-based dimensions with automated truncation capabilities for Year, Quarter, Month, Week, and Day intervals.

  • Implement advanced aggregation logic, including complex ratios, percent-of-total calculations using the all() reference, and custom measure descriptors.

  • Support complex relational modeling through flexible join types: join_many, join_one, and cross joins, with support for view-based aliasing.

  • Facilitate production-grade deployments through declarative YAML schema definitions that ensure version control and configuration consistency.

  • Seamlessly integrate with various database backends supported by Ibis, such as DuckDB, Snowflake, BigQuery, and PostgreSQL.

  • Expected inputs include raw Ibis table objects or path strings to YAML configuration files, while outputs consist of instantiated SemanticTable objects or complex query expressions ready for execution.

  • Best practice: Always include human-readable descriptions in your Dimension and Measure definitions to improve model discoverability and AI interpretability.

  • Practical constraint: When working with multiple joins to the same table, ensure you use the .view() method to avoid column naming collisions.

  • For production workloads, prefer using YAML files to separate your model definition from your operational code for better maintainability and team collaboration.

  • The tool expects a Python environment with the boring-semantic-layer package installed, ideally with the agent or mcp extra dependencies for advanced LLM integrations.

Repository Stats

Stars
436
Forks
39
Open Issues
10
Language
Python
Default Branch
main
Sync Status
Idle
Last Synced
Apr 28, 2026, 12:49 PM
View on GitHub