Azure AI 검색 인용 기반 응답에 응답 합성 사용(미리 보기)

참고

Azure AI 검색 Azure 포털, REST API 및 Azure SDK 통해 사용할 수 있습니다. 또한 엔터프라이즈 콘텐츠를 Microsoft Foundry 포털의 에이전트에 대해 재사용 가능한 사용 권한 인식 기술 자료로 변환하는 관리되는 기술 계층인 Foundry IQ를 뒷받침합니다.

중요

기능, 기능 또는 표시된 속성(미리 보기)은 서비스 수준 계약에 포함되지 않으며 프로덕션 워크로드에는 권장되지 않으며 일반적으로 사용 가능해지기 전에 변경되거나 제한될 수 있습니다. Azure AI 검색 미리 보기 용어는 독립 실행형 기능이든 일반 공급 기능의 일부이든 관계없이 모든 미리 보기 기능에 적용됩니다.

기본적으로 Azure AI 검색의 지식 베이스는 데이터 추출을 수행하며, 이 과정에서 지식 원본의 원시 그라운딩 청크를 반환합니다. 데이터 추출은 특정 정보를 검색하는 데 유용하지만 복잡한 쿼리에 필요한 컨텍스트 및 추론이 부족합니다.

대신 기술 자료에 지정된 LLM을 사용하여 자연어로 쿼리에 응답하는 응답 합성 (미리 보기)을 사용하도록 설정할 수 있습니다. 각 답변에는 검색된 원본에 대한 인용이 포함되며 글머리 기호 목록 사용과 같이 사용자가 제공한 모든 지침을 따릅니다.

기술 자료 또는 검색 요청에서 이 속성을 설정할 수 있습니다. 기술 자료 설정은 모든 쿼리에 대한 기본값을 설정하는 반면, 검색 요청 설정은 쿼리별로 기본값을 재정의합니다.

사용량 지원

Azure Portal Microsoft Foundry 포털 .NET SDK Python SDK Java SDK JavaScript SDK REST API
✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️

필수 구성 요소

  • Azure AI 검색 서비스는 LLM을 지정하는 지식 베이스를 포함합니다.

  • 기술 자료를 업데이트할 수 있는 권한입니다. 사용자 계정에 할당된 Search Service 기여자 역할로 키 없는 인증을 구성하거나(권장) 관리자 API 키를 사용합니다.

  • LLM으로의 아웃바운드 호출을 위해, 검색 서비스는 Microsoft Foundry 리소스에 대해 관리 ID와 Cognitive Services 사용자 권한을 갖고 있어야 합니다.

  • 최신 Azure.Search.Documents 미리 보기 패키지: dotnet add package Azure.Search.Documents --prerelease

  • 키 없는 인증의 경우 패키지:Azure.Identitydotnet add package Azure.Identity

제한 사항 및 고려 사항

  • minimal 검색 추론 작업은 LLM 처리를 사용하지 않도록 설정하므로 기술 자료 정의 및 검색 요청 모두에서 응답 합성과 호환되지 않습니다. 자세한 내용은 검색 추론 작업 설정을 참조하세요.

  • 응답 합성은 입력 및 출력 토큰 수를 기반으로 하는 Azure OpenAI에서 종량제 요금이 발생합니다. 요금은 기술 자료에 할당된 LLM 아래에 표시됩니다. 자세한 내용은 지역 가용성, 제한 및 청구를 참조하세요.

기술 자료에서 응답 합성 사용

이 섹션에서는 기존 기술 자료에서 응답 합성을 사용하도록 설정하는 방법을 보여 줍니다. 이 구성을 새 기술 자료에 사용할 수 있지만 기술 자료 만들기는 이 문서의 범위를 벗어납니다.

OutputMode 정의에서 "answerSynthesis"을 KnowledgeBase로 설정합니다. 필요에 따라 응답 출력을 사용자 지정하도록 설정합니다 AnswerInstructions . 다음 예에서는 지식 베이스가 Use concise bulleted lists하도록 지시합니다.

var aoaiParams = new AzureOpenAIVectorizerParameters
{
    ResourceUri = new Uri("<aoai-endpoint>"),
    DeploymentName = "<aoai-gpt-deployment>",
    ModelName = "<aoai-gpt-model>",
};

var knowledgeBase = new KnowledgeBase(
    name: "<knowledge-base-name>",
    knowledgeSources: new[] { new KnowledgeSourceReference("<knowledge-source-name>") })
{
    Models = { new KnowledgeBaseAzureOpenAIModel(aoaiParams) },
    OutputMode = "answerSynthesis",
    AnswerInstructions = "Use concise bulleted lists",
};

await indexClient.CreateOrUpdateKnowledgeBaseAsync(knowledgeBase);

참조:SearchIndexClient, KnowledgeBase

output_mode 정의에서 "answerSynthesis"을 KnowledgeBase로 설정합니다. 필요에 따라 응답 출력을 사용자 지정하도록 설정합니다 answer_instructions . 다음 예에서는 지식 베이스가 Use concise bulleted lists하도록 지시합니다.

from azure.search.documents.indexes import SearchIndexClient
from azure.search.documents.indexes.models import (
    AzureOpenAIVectorizerParameters,
    KnowledgeBase,
    KnowledgeBaseAzureOpenAIModel,
    KnowledgeSourceReference,
)

aoai_params = AzureOpenAIVectorizerParameters(
    resource_url="<aoai-endpoint>",
    deployment_name="<aoai-gpt-deployment>",
    model_name="<aoai-gpt-model>",
)

knowledge_base = KnowledgeBase(
    name="<knowledge-base-name>",
    models=[KnowledgeBaseAzureOpenAIModel(azure_open_ai_parameters=aoai_params)],
    knowledge_sources=[KnowledgeSourceReference(name="<knowledge-source-name>")],
    output_mode="answerSynthesis",
    answer_instructions="Use concise bulleted lists",
)

index_client = SearchIndexClient(endpoint=search_endpoint, credential=credential)
index_client.create_or_update_knowledge_base(knowledge_base)

참조:SearchIndexClient, KnowledgeBase

기술 자료 정의에서 outputMode을(를) "answerSynthesis"(으)로 설정합니다. 필요에 따라 응답 출력을 사용자 지정하도록 설정합니다 answerInstructions . 다음 예에서는 지식 베이스가 Use concise bulleted lists하도록 지시합니다.

### Enable answer synthesis in a knowledge base
PUT {{search-endpoint}}/knowledgebases/{{knowledge-base-name}}?api-version=2026-08-01-preview
Content-Type: application/json
Authorization: Bearer {{search-access-token}}

{
    "name": "{{knowledge-base-name}}",
    "knowledgeSources": [ ... // OMITTED FOR BREVITY ],
    "models": [ ... // OMITTED FOR BREVITY ],
    "outputMode": "answerSynthesis",
    "answerInstructions": "Use concise bulleted lists"
}

참조:기술 자료 - 만들기 또는 업데이트

검색 요청에서 응답 합성 사용

응답 형식에 대한 쿼리별 제어의 경우 쿼리 시간에 응답 합성을 사용하도록 설정할 수 있습니다. 이 방법은 기술 자료에 지정된 기본 출력 모드를 재정의합니다.

OutputMode에서 "answerSynthesis"을(를) KnowledgeBaseRetrievalRequest(으)로 설정합니다.

var client = new KnowledgeBaseRetrievalClient(
    endpoint: new Uri(searchEndpoint),
    knowledgeBaseName: knowledgeBaseName,
    credential: credential);

var request = new KnowledgeBaseRetrievalRequest();
request.Messages.Add(
    new KnowledgeBaseMessage(
        content: new[]
        {
            new KnowledgeBaseMessageTextContent("What is healthcare?")
        }) { Role = "user" });
request.OutputMode = "answerSynthesis";

var result = await client.RetrieveAsync(request);

참조:KnowledgeBaseRetrievalClient, KnowledgeBaseRetrievalRequest

output_mode에서 "answerSynthesis"을(를) KnowledgeBaseRetrievalRequest(으)로 설정합니다.

from azure.search.documents.knowledgebases import KnowledgeBaseRetrievalClient
from azure.search.documents.knowledgebases.models import (
    KnowledgeBaseMessage,
    KnowledgeBaseMessageTextContent,
    KnowledgeBaseRetrievalRequest,
)

agent_client = KnowledgeBaseRetrievalClient(
    endpoint=search_endpoint,
    credential=credential,
    knowledge_base_name=knowledge_base_name,
)

request = KnowledgeBaseRetrievalRequest(
    messages=[
        KnowledgeBaseMessage(
            role="user",
            content=[KnowledgeBaseMessageTextContent(text="What is healthcare?")],
        )
    ],
    output_mode="answerSynthesis",
)

result = agent_client.retrieve(retrieval_request=request)

참조:KnowledgeBaseRetrievalClient, KnowledgeBaseRetrievalRequest

가져오기 요청에서 outputMode을 "answerSynthesis"(으)로 설정합니다.

### Enable answer synthesis in a retrieve request
POST {{search-endpoint}}/knowledgebases/{{knowledge-base-name}}/retrieve?api-version=2026-08-01-preview
Content-Type: application/json
Authorization: Bearer {{search-access-token}}

{
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "What is healthcare?"
                }
            ]
        }
    ],
    "outputMode": "answerSynthesis"
}

참조:지식 검색 - 검색

합성된 답변 가져오기

응답 합성을 사용하도록 설정하면 기술 자료는 기술 자료에서 선택적으로 지정한 지침에 따라 자연어 답변을 반환합니다. 지식 원본에 대한 인용 형식은 다음과 같습니다 [ref_id:<number>].

예를 들어 지침이 Use concise bulleted lists 있고 쿼리인 경우 응답은 What is healthcare?다음 예제와 유사해야 합니다.

{
  "response": [
    {
      "content": [
        {
          "type": "text",
          "text": "- Healthcare encompasses various services provided to patients and the general population ..."
        }
      ]
    }
  ]
}

전체 text 출력은 다음과 같습니다.

"- Healthcare encompasses various services provided to patients and the general population, including primary health services, hospital care, dental care, mental health services, and alternative health services [ref_id:1].\n- It involves the delivery of safe, effective, patient-centered care through different modalities, such as in-person encounters, shared medical appointments, and group education sessions [ref_id:0].\n- Behavioral health is a significant aspect of healthcare, focusing on the connection between behavior and overall health, including mental health and substance use [ref_id:2].\n- The healthcare system aims to ensure quality of care, access to providers, and accountability for positive outcomes while managing costs effectively [ref_id:2].\n- The global health system is evolving to address complex health needs, emphasizing the importance of cross-sectoral collaboration and addressing social determinants of health [ref_id:4]."

기술 자료의 구성에 따라 응답에는 활동 로그 및 참조 배열과 같은 다른 정보가 포함될 수 있습니다. 자세한 내용은 기술 자료 만들기를 참조하세요.