数据代理是一种功能强大的工具,旨在提高数据结果的准确性,并为创建者提供将业务上下文纳入其数据查询的方法。 通过使用数据代理,用户可以通过自然语言与数据交互,使复杂的数据操作更易于访问和可操作。
此外,数据代理还有助于创建、管理和配置数据专家,使组织能够构建反映其独特流程、方案和业务逻辑的自定义解决方案。 此自定义可确保生成的见解不仅准确,而且与上下文相关。
本文介绍可用于增强数据代理的各种配置。
数据代理说明
数据代理说明指导代理生成对用户问题的准确相关响应。 这些说明可以指定要确定优先级的数据源、概述如何处理某些类型的查询,并提供有用的术语或上下文来解释用户意向。
下面是用于编写有效代理级指令的建议起始格式:
## Objective
// Describe the overall goal of the agent.
// Example: "Help users analyze retail sales performance and customer behavior across regions."
## Data sources
// Specify which data sources the agent should consider, and in what order of priority.
// Example: "Use 'SalesLakehouse' for product and transaction data. Use 'CRMModel' for customer demographics."
## Key terminology
// Define terms or acronyms the agent may encounter in user queries.
// Example: "'GMV' refers to Gross Merchandise Value."
## Response guidelines
// Set expectations for how the agent should format or present answers.
// Example: ""
## Handling common topics
// Provide special handling rules or context for frequently asked topics.
// Example: "When asked about customers, use the 'ChurnModelScoring' Lakehouse to get customer details. Then, list any open support tickets"
数据源说明
当代理将问题路由到特定数据源时,将应用数据源说明。 这些说明提供了构建精确查询(无论是在 SQL、DAX 还是 KQL 中)所需的上下文,以便代理可以检索准确的信息。
本部分应包括特定于数据源的指南,例如相关表、列、关系以及回答常见或复杂问题所需的任何查询逻辑。 提供的上下文越多,代理就越能生成准确且有意义的查询。
使用以下模板作为起点:
## General knowledge
// Share general background information the agent should consider when querying this data source.
## Table descriptions
// Describe key tables and important columns within those tables.
## When asked about
// Provide query-specific logic or table preferences for certain topics.
// Example: “When asked about shoe sales, always use the SalesProduct table.”
数据源示例查询
数据代理工具使用示例查询(也称为少量示例),以提高生成的查询质量。 它们允许创建者传递代理在形成响应时可以引用的示例查询逻辑。 使用数据源时,相应的工具会自动查找用户问题最相关的示例查询,并将前三个查询传递给数据代理工具。 这些示例合并到生成过程中,帮助代理生成更准确且上下文适当的查询结果。