Cover of Business Intelligence with Agents, edition 2026.11.15, code 28XD-AHKT Business Intelligence with Agents 28XD-AHKT 15 editions since Nov 2026 Rolling Edition 2026.11.15

基于智能体的商业智能

版次 2026.11.15 示例于 2026年11月19日 通过 78个示例中有78个通过 变化内容

AI 翻译。由人工以英文核验。 我们如何制作图书

译自英文版图书,版次 2026.11.15。 阅读原文

能基于你的数据仓库,把业务问题转化为可信洞察的智能体:分层上下文、语义层中受治理的指标、有防护的 SQL、无法作答时会明确说明的回答、智能体无法用言辞绕过的访问规则,以及基于你自己的标准问题集的评估,通过 MCP 提供服务,全部构建在 DuckDB、sqlglot 和 MetricFlow 之上。

适合谁 本书写给会写 SQL、熟悉自家数据仓库、并受托让人们向数据提问的分析工程师、BI 开发人员和数据科学家,借助能给出正确数字的助手。

开始阅读
版次历史自 2026年十一月 以来的 15个版次每个版次及其变更内容
2026.11.12026.11.15
2026.11.15 · 2026年11月21日文字修订,新内容37节已更改

目录

11章,阅读约需 15小时 47分钟,包含 78个示例。

  1. 1端到端的数据智能体

    读完本章,你将能够构建商店的数据仓库,让一个已录制的模型为某个业务问题编写 SQL,运行该 SQL 并发现它返回的错误数字,用一个已定义的指标回答同一个问题,并在五个黄金问题上为两种做法打分。

  2. 2Where raw text-to-SQL gets the number wrong

    By the end of this chapter, you can name the five ways schema-only text-to-SQL returns a plausible wrong number on a real warehouse, show each one on the shop's warehouse, count them across a set of golden questions, and tell which a better prompt can fix and which need definitions the schema doesn't hold.

  3. 3从你自己的工作中构建黄金问题

    读完本章,你将能够根据企业中人们提出的问题编写黄金问题,并为每个问题配上黄金 SQL、提问的角色以及所需的答案类型。

  4. 4Give the agent layered context

    By the end of this chapter, you can give a model that writes SQL more than the schema, in layers: notes on columns whose names mislead, a glossary of the shop's business terms, and verified queries retrieved for each question.

  5. 5Define metrics once in a semantic layer

    By the end of this chapter, you can write the shop's semantic models and metrics in MetricFlow's YAML spec, compile a metric request to SQL with the book's own compiler, show that its entity joins can't fan out, group by the fiscal calendar, and confirm that MetricFlow compiles the same definitions to the same results.

  6. 6优先将问题路由到受治理的指标

    读完本章,你可以把语义层的指标而不是数据仓库的表作为工具交给智能体,让它返回结构化的指标请求,并在任何查询运行之前先对该请求进行校验;当一个问题可能对应多个指标时,让它向提问者反问;并在黄金问题上衡量这些改变带来的效果。

  7. 7Let the agent write SQL inside guards

    By the end of this chapter, you can handle the questions no metric covers by letting the agent write SQL that runs read-only on a database holding only the rows and columns its role may read, and that is parsed, checked against an allowlist of tables, bounded in rows, size, cost and time, repaired once from an error, and transpiled to your warehouse's dialect.

  8. 8在无法回答时明确说明

    读完本章,你可以把拒答变成一种正式的回答:区分仓库无法回答的问题和能够回答的问题;以已知类别的理由拒答;检查所问时间段的数据是否已经到达;展示每个回答背后的数据来源;并用精确率和召回率衡量拒答,使智能体既不乱猜,也不过于频繁地拒绝。

  9. 9让智能体只在许可范围内查看数据

    读完本章,你将能够在智能体之下、在各角色自己的数据库中,强制执行每个角色的行过滤、列掩码和最小分组规模,并以语义层中的改写作为一道防线,以守卫作为纵深防御,使任何提示词都无法扩大访问范围。

  10. 10评判回答并发现回归

    学完本章,你将能够:同时用多项指标为智能体的一次运行打分;只在结果无法直接比较时才使用模型作为评判者;对照任何人都能重新计算的参考标注来校准这个评判者;看出分数在两次运行之间的波动幅度;并在 CI 中基于已记录的运行,对提示词、上下文或指标的变更设置门禁。

  11. 11Serve the semantic layer over MCP

    By the end of this chapter, you can serve the shop's governed metrics as MCP tools that answer for the role the server was built for, return each answer with its provenance as structured data, test the server in memory, and run the book's agent through it as a host.

引用本节

格式

每种格式均引用英文原书,本译本以其为准。

每种格式都会注明该版次。其链接会打开当前版次,节标题处会说明该节文本最后一次修改的时间。访问日期和检索日期即为您打开此页的当天。