LLMs can confidently misinterpret data warehouse queries without guardrails. SDF's analytics team built semantic layers with pre-defined measures to prevent hallucinations, cutting data help requests by half. Derek walks through the problem on Stellar operations data and shares open-source tooling any team can apply.
LLMs asked to query raw data tables often make reasonable-seeming but confidently wrong choices. SDF's analytics team faced this directly: an LLM querying Stellar operations data about fees returned a figure nearly 2x too high by misunderstanding fee aggregation and transaction bundling. The solution was semantic layers—a single source of truth for metrics, measures, and context placed between models and raw tables. Now when an LLM is asked a data question, it picks from pre-defined, correct measures instead of inventing new ones. Derek, a business analyst at SDF, walks through the architecture, shows live examples on Stellar's public operations table, and shares the open-source Malloy semantic layer so any team can apply the same guardrails. Six months in, the pattern cut data help requests from their team in half.