Trilogy

website·Indexed 32 days ago

https://trilogydata.dev/

A typed language for declarative data access that compiles to SQL, enabling users to query a semantic layer directly instead of physical tables. It includes a Python SDK (pytrilogy), a CLI, and Trilogy Studio for data exploration. The language features concept, type, and function statements, supporting various datasources including databases, files, and Python scripts.

Tokens
56.3K
Snippets
385
Records
466
Agent score
66%

What's inside Trilogy

  1. Overview of Trilogy for Data Warehousing

    Trilogy is an analytics infrastructure layer that allows teams to query, model, test, and manage analytics logic directly against their existing data warehouse. It treats the warehouse as a durable execution layer, providing a place to define reusable logic, test transformations, and maintain consistent query logic as data models evolve. It supports a full development lifecycle including ad-hoc exploration, scheduled jobs, and global optimization of the processing graph.
  2. Introduction to Trilogy Language

    Trilogy is a typed, declarative data access language that compiles to SQL. Unlike standard SQL, users query a semantic layer of 'concepts' rather than physical tables. The compiler automatically resolves these concepts into the most efficient set of tables and joins required to produce the result.
  3. Overview of Trilogy Studio features and capabilities

    Trilogy Studio is an open-source dashboard IDE designed for developers and data teams. It emphasizes fast iteration and direct database access, allowing users to write queries directly for modeling. Key capabilities include:

    • Native support for Trilogy queries, SQL, and AI tooling.
    • Generic acceleration via aggregate resolution.
    • Native cross-filtering and natural language filtering.
    • AI-assisted dashboard generation.
    • Flexible deployment: available as a public hosted option, internally served, or run locally.
  4. Overview of trilogy file commands

    The trilogy file command suite provides a backend-agnostic way to manage files. While currently supporting the local filesystem, it is designed to support cloud storage and remote git backends in the future. A key feature is automatic syntax validation for .preql files during write operations to prevent truncated or malformed content from being saved.
  5. Overview of Trilogy Transform

    Trilogy Transform is a declarative data warehouse tool designed to minimize the manual maintenance of staging tables. Instead of manually managing a processing graph of SQL tables, developers define the desired data products (outputs). The system then automatically handles the intermediate graph using an abstracted, declarative language, treating staging assets as transient artifacts rather than manually labeled assets.
  6. Overview of Trilogy Semantic Layer

    Trilogy is an open-source analytics stack that provides a typed semantic model to turn physical data structures into stable, reusable interfaces. It allows developers to define concepts and sources in a language similar to SQL (without YAML), automatically handling fan-out joins, foreign keys, and nulls. The system supports a full lifecycle: defining concepts, querying with SQL flexibility, persisting results into tables, and reusing definitions across the organization.
  7. Overview of Trilogy Studio

    Trilogy Studio is an open-source IDE and component library designed to accelerate analytics. It allows users to write less SQL, refactor queries easily, and create interactive dashboards. It features a native semantic layer to provide a single source of truth for definitions, ensuring that updates in one place propagate across all resources. The tool is built as a Vue application using the Monaco Editor (powering VS Code) and the Vega visualization library.
  8. Overview of Trilogy semantic layer

    Trilogy is a metadata layer that allows users to write SQL against a semantic model rather than physical tables. It late-binds to physical tables to fulfill queries, providing several advantages for AI agents:

    • Rich context by default with progressive disclosure tools.
    • Elimination of fan-out and chasm traps, reducing common SQL errors.
    • Automatic aggregate resolution for improved performance.
    • Strong typing and linting for faster feedback loops.
    • Full SQL expressiveness without the constraints of traditional semantic layers.
  9. Overview of AI integration with Trilogy

    Trilogy improves AI agent performance on complex data warehouses by providing a constrained syntax and a first-class semantic layer. This approach reduces the translation surface area and provides necessary context (like FK/PK constraints, nullability, and cardinality) without requiring the AI to have direct database access for exploration. This results in higher precision, faster feedback loops for syntax errors, and more reliable zero-shot text-to-query generation.
  10. Overview of the Trilogy Data Ecosystem

    Trilogy provides a consistent language and semantic layer that acts as glue between analysts, engineers, and data consumers. It aims to preserve SQL as a lingua franca across the data lifecycle, allowing users to iterate on data models without breaking downstream queries and enabling a shared understanding of information exchange.
  11. Overview of the Trilogy Language

    Trilogy is a semantic-first language that compiles to raw SQL, designed to solve the 'context rot' and sprawl associated with traditional analytics. It separates business intent (semantics) from physical storage details (tables, joins, and partitions). By moving relationships and grain definitions into a reusable semantic layer, Trilogy eliminates the need for developers to manually specify join paths or handle complex grouping mechanics in every query.
  12. Validate concepts and datasources using the validate statement

    The validate statement checks the correctness and consistency of concepts or datasources in the current environment. Validation ensures that concept definitions are complete and consistent, datasource columns map to valid concepts, grain definitions are correct, there are no circular dependencies, and types are consistent.
    validate_statement: ("validate" "all") | ("validate" SCOPE (IDENTIFIER ("," IDENTIFIER)*)?)