Analytics Copilots
摘要
An analytics copilot is not just “LLM → SQL.” It’s a compact semantic layer the model can reason over, a query compiler that never executes unsafe SQL, a chart spec generator that speaks the same grammar as your front end, and governance hooks that record lineage and enforce policy. The code below wires these pieces into a tiny service you can extend: declare metrics and dimensions, translate intent to a safe query, return both the SQL and a Vega-Lite–style chart spec, and log everything through a governance gate.