Home / Companies / PostHog / Blog / Post Details
Content Deep Dive

Building a semantic layer: What it is and how we did it at PostHog

Blog post from PostHog

Post Details
Company
Date Published
Author
Thiago Rocha Salvatore and Lizzie Epton
Word Count
1,685
Company Posts That Month
5
Language
-
Hacker News Points
-
Post removed?
No
Summary

PostHog describes its beta semantic layer as a governed, SQL-accessible catalog intended to prevent AI agents and analysts from producing inconsistent answers to business questions such as monthly recurring revenue. Rather than copying or moving data, the layer documents approved metric definitions, trusted tables, deprecated sources, and relationships between datasets within PostHog’s context warehouse, allowing agents to find and execute canonical definitions instead of reconstructing them independently. Agents can propose metrics, tables, and joins, but human approval is required before any definition becomes canonical; edits to approved metrics return them to proposed status, while changes to source insights trigger drift warnings. PostHog supports SQL-backed, Markdown-described, and insight-backed metrics, with insight queries snapshotted to preserve alignment with the underlying funnel or trend engine while detecting later changes. The company chose not to build a new semantic query language in its first version, instead relying on existing views and metric execution endpoints, and is evaluating the feature through agent accuracy, use of approved metrics, and continued catalog growth.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.