在 Foundry IQ(Azure AI 搜尋服務)中使用 Microsoft Retriever 1

Important

Microsoft Retriever 1 目前為公開預覽版,並受 Microsoft Azure 預覽版補充使用條款規範。

有關此功能專屬的預覽條款,請參閱 「預覽功能」。

microsoft-retriever-1 是一個專門的擷取模型,託管於 Foundry IQ(Azure AI 搜尋服務)。 您不需要連接外部規劃模型,也不需要為其所提供的擷取規劃設定其網路與驗證。 此工作流程會直接搜尋一個小型政策索引,然後透過知識庫公開相同內容。

使用支援

Azure portal Microsoft Foundry 入口網站 .NET SDK Python SDK Java SDK JavaScript SDK REST API
❌ ❌ ✔️ ✔️ ✔️ ✔️ ✔️

Prerequisites

  • 在支援區域內提供一套具備標準知識檢索計畫的 Foundry IQ 服務。
  • 授權建立、填充、查詢及刪除範例索引、知識來源及知識庫。 若要進行無金鑰驗證,請在 Foundry IQ 服務上將搜尋服務貢獻者、搜尋索引資料貢獻者及搜尋索引資料讀取者角色指派給您的身分。
  • 一個 .NET 8 或更新版本的主控台專案,且使用最新預覽版本的 Azure.Search.Documents。 請參閱 .NET 用戶端函式庫。

建立一個小型政策索引

建立一個包含可搜尋政策文字及可篩選管轄區欄位的索引。

依照 「Connect to Foundry IQ」中的說明登入。 依序執行 SDK 片段。

from azure.identity import DefaultAzureCredential
from azure.search.documents import SearchClient
from azure.search.documents.indexes import SearchIndexClient

search_endpoint = "<search-endpoint>"
index_name = "mr1-policy-index"
knowledge_source_name = "mr1-policy-source"
knowledge_base_name = "mr1-policy-kb"
credential = DefaultAzureCredential()
index_client = SearchIndexClient(search_endpoint, credential)
search_client = SearchClient(search_endpoint, index_name, credential)

參考:DefaultAzureCredential、 SearchClient、 SearchIndexClient。

建立索引並上傳兩個模擬保單。

from azure.search.documents.indexes.models import (
    SearchFieldDataType,
    SearchIndex,
    SearchableField,
    SimpleField,
)

index = index_client.create_index(SearchIndex(
    name=index_name,
    fields=[
        SimpleField(
            name="id", type=SearchFieldDataType.STRING, key=True,
        ),
        SearchableField(name="title"),
        SearchableField(name="content"),
        SimpleField(
            name="jurisdiction",
            type=SearchFieldDataType.STRING,
            filterable=True,
        ),
    ],
))

documents = [
    {
        "id": "ca-leave",
        "title": "Canadian parental leave",
        "jurisdiction": "CA",
        "content": (
            "Canadian employees receive four weeks of paid parental leave."
        ),
    },
    {
        "id": "ca-request",
        "title": "Canadian leave requests",
        "jurisdiction": "CA",
        "content": (
            "Canadian employees submit parental leave requests through "
            "the HR portal at least 30 days before leave."
        ),
    },
]
search_client.upload_documents(documents=documents)

參考資料:SearchIndexClient、 SearchIndex、 SearchClient.upload_documents。

依照 「Connect to Foundry IQ」中的說明登入。 依序執行 SDK 片段。

using Azure.Identity;
using Azure.Search.Documents;
using Azure.Search.Documents.Indexes;

string searchEndpoint = "<search-endpoint>";
string indexName = "mr1-policy-index";
string knowledgeSourceName = "mr1-policy-source";
string knowledgeBaseName = "mr1-policy-kb";
var credential = new DefaultAzureCredential();
var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential);
var searchClient = new SearchClient(
    new Uri(searchEndpoint), indexName, credential);

參考:DefaultAzureCredential、 SearchClient、 SearchIndexClient。

建立索引並上傳兩個合成原則。

using Azure.Search.Documents.Indexes.Models;
using Azure.Search.Documents.Models;

var index = (await indexClient.CreateIndexAsync(
    new SearchIndex(indexName,
    [
        new SimpleField("id", SearchFieldDataType.String)
        {
            IsKey = true,
        },
        new SearchableField("title"),
        new SearchableField("content"),
        new SimpleField("jurisdiction", SearchFieldDataType.String)
        {
            IsFilterable = true,
        },
    ])).Value;

var documents = new SearchDocument[]
{
    new()
    {
        ["id"] = "ca-leave",
        ["title"] = "Canadian parental leave",
        ["jurisdiction"] = "CA",
        ["content"] =
            "Canadian employees receive four weeks of paid parental leave.",
    },
    new()
    {
        ["id"] = "ca-request",
        ["title"] = "Canadian leave requests",
        ["jurisdiction"] = "CA",
        ["content"] =
            "Canadian employees submit parental leave requests through " +
            "the HR portal at least 30 days before leave.",
    },
};
await searchClient.UploadDocumentsAsync(documents);

參考:SearchIndexClient、 SearchIndex、 SearchClient.UploadDocumentsAsync。

  1. 設定 Foundry IQ 服務端點及存取權杖。 若要取得存取權杖,請參閱 「連接至 Foundry IQ」。

    @searchEndpoint = <search-endpoint>
    @searchAccessToken = <search-access-token>
    @indexName = mr1-policy-index
    @knowledgeSourceName = mr1-policy-source
    @knowledgeBaseName = mr1-policy-kb
    
  2. 建立索引。

    PUT {{searchEndpoint}}/indexes/{{indexName}}?api-version=2026-11-01-preview
    Content-Type: application/json
    Authorization: Bearer {{searchAccessToken}}
    
    {
      "name": "{{indexName}}",
      "fields": [
        { "name": "id", "type": "Edm.String", "key": true },
        { "name": "title", "type": "Edm.String", "searchable": true },
        { "name": "content", "type": "Edm.String", "searchable": true },
        { "name": "jurisdiction", "type": "Edm.String", "filterable": true }
      ]
    }
    

    參考:索引 - 建立或更新。

  3. 上傳兩份合成文件。

    POST {{searchEndpoint}}/indexes/{{indexName}}/docs/index?api-version=2026-11-01-preview
    Content-Type: application/json
    Authorization: Bearer {{searchAccessToken}}
    
    {
      "value": [
        {
          "@search.action": "upload", "id": "ca-leave",
          "title": "Canadian parental leave", "jurisdiction": "CA",
          "content": "Canadian employees receive four weeks of paid parental leave."
        },
        {
          "@search.action": "upload", "id": "ca-request",
          "title": "Canadian leave requests", "jurisdiction": "CA",
          "content": "Canadian employees submit parental leave requests through the HR portal at least 30 days before leave."
        }
      ]
    }
    

    參考資料:文件 - 索引。

直接使用 Microsoft Retriever 1 搜尋

請在代理式查詢執行、篩選條件和除錯模式皆設為代理式的情況下提交完整問題。

from azure.search.documents.models import (
    AgenticSearchOptions,
    QueryDebugMode,
    QueryType,
)

question = "What parental leave do Canadian employees receive and how do they request it?"
results = search_client.search(
    search_text=question,
    query_type=QueryType.AGENTIC,
    agentic_options=AgenticSearchOptions(max_runtime_in_seconds=60),
    filter="jurisdiction eq 'CA'",
    select=["id", "title", "content", "jurisdiction"],
    top=5,
    debug=QueryDebugMode.AGENTIC,
)
documents = list(results)
diagnostics = results.get_debug_info()

診斷範例:

{
  "semantic": null,
  "queryRewrites": null,
  "agentic": {
    "terminationReason": "modelStopped",
    "subQueries": [],
    "usage": {
      "agenticPlanningTokens": 102,
      "reasoningTokens": 50
    }
  }
}

參考:SearchClient.search。

請以代理式查詢執行、篩選條件及除錯模式設為 agentic 的方式提交完整問題。

using Azure.Search.Documents;
using Azure.Search.Documents.Models;

string question = "What parental leave do Canadian employees receive and how do they request it?";
var options = new SearchOptions
{
    QueryType = SearchQueryType.Agentic,
    AgenticOptions = new AgenticSearchOptions { MaxRuntimeInSeconds = 60 },
    Filter = "jurisdiction eq 'CA'",
    Select = { "id", "title", "content", "jurisdiction" },
    Size = 5,
    Debug = QueryDebugMode.Agentic,
};
var directResult = await searchClient.SearchAsync<SearchDocument>(
    question, options);

診斷範例:

{
  "semantic": null,
  "queryRewrites": null,
  "agentic": {
    "terminationReason": "modelStopped",
    "subQueries": [],
    "usage": {
      "agenticPlanningTokens": 102,
      "reasoningTokens": 50
    }
  }
}

參考:SearchClient.SearchAsync, SearchOptions。

請以 queryType: "agentic"提交完整問題。 篩選器將證據限制為加拿大,並 select 控制回傳欄位。

POST {{searchEndpoint}}/indexes/{{indexName}}/docs/search?api-version=2026-11-01-preview
Content-Type: application/json
Authorization: Bearer {{searchAccessToken}}

{
  "search": "What parental leave do Canadian employees receive and how do they request it?",
  "queryType": "agentic",
  "agenticOptions": { "maxRuntimeInSeconds": 60 },
  "filter": "jurisdiction eq 'CA'",
  "select": "id,title,content,jurisdiction",
  "top": 5,
  "debug": "agentic"
}

參考資料:文件 - 搜尋 POST。

200 回應表示請求已完成。 「206 回應」代表部分成功,且回應仍可包含文件。

終止原因為 modelStopped 表示處理已於模型停止後或服務達到其迭代上限後完成。 maxRuntimeExceeded 表示請求在模型停止前已達到執行時上限。 modelFailed 表示模型處理在模型停止前就失敗了。

透過知識庫擷取資料

使用搜尋索引知識來源重複使用相同的索引。

  1. 建立知識來源。

    from azure.search.documents.indexes.models import (
        SearchIndexFieldReference,
        SearchIndexKnowledgeSource,
        SearchIndexKnowledgeSourceParameters,
    )
    
    source = index_client.create_knowledge_source(
        SearchIndexKnowledgeSource(
            name=knowledge_source_name,
            search_index_parameters=SearchIndexKnowledgeSourceParameters(
                search_index_name=index_name,
                source_data_fields=[
                    SearchIndexFieldReference(name="id"),
                    SearchIndexFieldReference(name="title"),
                    SearchIndexFieldReference(name="content"),
                    SearchIndexFieldReference(name="jurisdiction"),
                ],
            ),
        ),
    )
    

    參考:SearchIndexClient。

  2. 建立包含 microsoft-retriever-1 模型、最低推理與擷取輸出的知識庫。

    from azure.search.documents.indexes.models import (
        KnowledgeBase,
        KnowledgeBaseMicrosoftRetriever1Model,
        KnowledgeSourceReference,
    )
    from azure.search.documents.knowledgebases.models import (
        KnowledgeRetrievalOutputMode,
        KnowledgeRetrievalMinimalReasoningEffort,
    )
    
    knowledge_base = index_client.create_knowledge_base(KnowledgeBase(
        name=knowledge_base_name,
        knowledge_sources=[
            KnowledgeSourceReference(name=source.name),
        ],
        models=[KnowledgeBaseMicrosoftRetriever1Model()],
        retrieval_reasoning_effort=KnowledgeRetrievalMinimalReasoningEffort(),
        output_mode=KnowledgeRetrievalOutputMode.EXTRACTIVE_DATA,
    ))
    

    參考:KnowledgeBase,SearchIndexClient。

  3. 擷取時,請使用恰好一個包含完整問題的語意意圖。

    from azure.search.documents.knowledgebases import (
        KnowledgeBaseRetrievalClient,
    )
    from azure.search.documents.knowledgebases.models import (
        KnowledgeBaseRetrievalRequest,
        KnowledgeRetrievalMinimalReasoningEffort,
        KnowledgeRetrievalOutputMode,
        KnowledgeRetrievalSemanticIntent,
    )
    
    retrieval_client = KnowledgeBaseRetrievalClient(
        search_endpoint, credential, knowledge_base_name=knowledge_base.name,
    )
    response = retrieval_client.retrieve(KnowledgeBaseRetrievalRequest(
        intents=[KnowledgeRetrievalSemanticIntent(search=question)],
        retrieval_reasoning_effort=KnowledgeRetrievalMinimalReasoningEffort(),
        output_mode=KnowledgeRetrievalOutputMode.EXTRACTIVE_DATA,
        include_activity=True,
    ))
    

    參考資料:KnowledgeBaseRetrievalClient。

  1. 建立知識來源。

    using Azure.Search.Documents.Indexes.Models;
    
    var source = (await indexClient.CreateKnowledgeSourceAsync(
        new SearchIndexKnowledgeSource(knowledgeSourceName,
            new SearchIndexKnowledgeSourceParameters(indexName)
            {
                SourceDataFields =
                {
                    new SearchIndexFieldReference("id"),
                    new SearchIndexFieldReference("title"),
                    new SearchIndexFieldReference("content"),
                    new SearchIndexFieldReference("jurisdiction"),
                },
            }))).Value;
    

    參考:SearchIndexClient。

  2. 建立包含 microsoft-retriever-1 模型、最少推理與擷取輸出的知識庫。

    using Azure.Search.Documents.Indexes.Models;
    using Azure.Search.Documents.KnowledgeBases.Models;
    
    var knowledgeBase = (await indexClient.CreateKnowledgeBaseAsync(
        new KnowledgeBase(knowledgeBaseName,
            [new KnowledgeSourceReference(source.Name)])
        {
            Models = { new KnowledgeBaseMicrosoftRetriever1Model() },
            RetrievalReasoningEffort =
                new KnowledgeRetrievalMinimalReasoningEffort(),
            OutputMode = KnowledgeRetrievalOutputMode.ExtractiveData,
        })).Value;
    

    參考:KnowledgeBase,SearchIndexClient。

  3. 以恰好一個包含完整問題的語意意圖進行擷取。

    using Azure.Search.Documents.KnowledgeBases;
    using Azure.Search.Documents.KnowledgeBases.Models;
    
    var retrievalClient = new KnowledgeBaseRetrievalClient(
        new Uri(searchEndpoint), knowledgeBase.Name, credential);
    var request = new KnowledgeBaseRetrievalRequest
    {
        Intents = { new KnowledgeRetrievalSemanticIntent(question) },
        RetrievalReasoningEffort =
            new KnowledgeRetrievalMinimalReasoningEffort(),
        OutputMode = KnowledgeRetrievalOutputMode.ExtractiveData,
        IncludeActivity = true,
    };
    var response = await retrievalClient.RetrieveAsync(request);
    

    參考資料:KnowledgeBaseRetrievalClient。

  1. 建立知識來源。

    PUT {{searchEndpoint}}/knowledgesources/{{knowledgeSourceName}}?api-version=2026-11-01-preview
    Content-Type: application/json
    Authorization: Bearer {{searchAccessToken}}
    
    {
      "name": "{{knowledgeSourceName}}",
      "kind": "searchIndex",
      "searchIndexParameters": {
        "searchIndexName": "{{indexName}}",
        "sourceDataFields": [
          { "name": "id" }, { "name": "title" },
          { "name": "content" }, { "name": "jurisdiction" }
        ]
      }
    }
    

    參考:知識來源 - 建立或更新。

  2. 建立使用 microsoftRetriever1 模型類型、簡易推理與擷取式輸出的知識庫。

    PUT {{searchEndpoint}}/knowledgebases/{{knowledgeBaseName}}?api-version=2026-11-01-preview
    Content-Type: application/json
    Authorization: Bearer {{searchAccessToken}}
    
    {
      "name": "{{knowledgeBaseName}}",
      "knowledgeSources": [{ "name": "{{knowledgeSourceName}}" }],
      "models": [{ "kind": "microsoftRetriever1" }],
      "retrievalReasoningEffort": { "kind": "minimal" },
      "outputMode": "extractiveData"
    }
    

    參考:知識庫 - 建立或更新。

  3. 擷取時,恰好包含一個完整問題的語義意圖。

    POST {{searchEndpoint}}/knowledgebases/{{knowledgeBaseName}}/retrieve?api-version=2026-11-01-preview
    Content-Type: application/json
    Authorization: Bearer {{searchAccessToken}}
    
    {
      "intents": [{
        "type": "semantic",
        "search": "What parental leave do Canadian employees receive and how do they request it?"
      }],
      "retrievalReasoningEffort": { "kind": "minimal" },
      "outputMode": "extractiveData",
      "includeActivity": true
    }
    

    參考資料:知識檢索 - 檢索。

活動日誌包含一個規劃結果,類似以下範例:

{
  "type": "modelQueryPlanning",
  "id": 1,
  "inputTokens": 94,
  "outputTokens": 26,
  "elapsedMs": 251,
  "model": {
    "modelName": "microsoft-retriever-1"
  }
}

在證據檢查期間解析並關聯 JSON 回應,請依照 Extracted response、 References 陣列及 Activity 陣列操作。

自動擷取的推理工作量

請求難度可能有所不同。 有些請求只需快速查詢即可回答,而有些則需要更深入的規劃。 當你無法事先預測每個請求的難度時,就用 Auto。 Auto 不會對每個請求套用固定的推理努力,而是為每個請求選擇擷取深度。

自動對每個請求會遵循兩種路徑之一。 預設路徑從初始的 Auto 階段開始,使用最少擷取推理工作量,只有在需要時才會進入更深入的規劃。 如果請求不符合預設路徑的資格,自動會改為以中等努力開始。 Auto 需要外部規劃模型,當請求從 Medium 開始或升級到 Medium 時,它會使用這個模型。 只有當請求符合以下所有條件時,預設路徑才可用:

  • Foundry IQ 服務位於支援 Auto retrieval 推理工作量的區域。
  • 這個請求只包含一個語意意圖。
  • 知識庫中的每個知識來源都支持 最少的檢索推理工作。
  • 知識庫中至少有一個知識來源支援初始的自動掃描,如下表所示。 任何將 alwaysQuerySource 設定為 true 的知識來源也必須支援此輪處理。
知識來源 初始自動核准
搜尋索引 ✔️
Azure Blob ✔️
Azure SQL ✔️
檔案 ✔️
OneLake ✔️
已索引的 SharePoint ✔️
遠端 SharePoint ❌
Fabric 資料代理程式 ❌
Fabric 本體論 ❌
MCP 伺服器 ❌
Work IQ ❌
Web ❌
  • 對於初始自動傳遞中的知識來源,影像服務已關閉,且 resultsProcessing 未設定為 none。

如果請求包含多個語意意圖,或未滿足初始 Auto pass 的其他要求,Auto 會從 Medium 開始。 即使知識來源未在初始 Auto 階段中使用,仍可在後續規劃階段查詢。

當請求符合預設路徑資格時,Auto 會根據需要從較簡單的擷取升級至更複雜的規劃:

  1. 自動會先將查詢傳送到適用於初始階段的知識來源。 如果排名最高的結果足夠相關,Auto 會立即回傳這些結果。
  2. 如果請求過於複雜,無法完成初始處理,且 microsoft-retriever-1 支援該請求可用的所有知識來源,則 microsoft-retriever-1 會進行更深入的擷取。
  3. 最後,當請求需要更深入的規劃時,microsoft-retriever-1 可以升級至以 中等強度 運作的外部規劃模型。

若要使用 Auto,請將 支援的外部模型 新增至知識庫, 設定對該模型的存取權限,並將檢索推理工作量設為 Auto。

  1. 新增外部規劃模型,並將自動設定為知識庫預設。

    from azure.search.documents.indexes.models import (
        AzureOpenAIVectorizerParameters,
        KnowledgeBaseAzureOpenAIModel,
        KnowledgeBaseMicrosoftRetriever1Model,
    )
    from azure.search.documents.knowledgebases.models import (
        KnowledgeRetrievalAutoReasoningEffort,
    )
    
    azure_open_ai_model = KnowledgeBaseAzureOpenAIModel(
        azure_open_ai_parameters=AzureOpenAIVectorizerParameters(
            resource_url="<azure-openai-endpoint>",
            deployment_name="<model-deployment-name>",
            model_name="<model-name>",
        ),
    )
    knowledge_base.models = [
        KnowledgeBaseMicrosoftRetriever1Model(),
        azure_open_ai_model,
    ]
    knowledge_base.retrieval_reasoning_effort = (
        KnowledgeRetrievalAutoReasoningEffort()
    )
    knowledge_base = index_client.create_or_update_knowledge_base(
        knowledge_base,
    )
    

    參考:KnowledgeBase, SearchIndexClient。

  2. 使用自動擷取。

    from azure.search.documents.knowledgebases.models import (
        KnowledgeBaseRetrievalRequest,
        KnowledgeRetrievalAutoReasoningEffort,
        KnowledgeRetrievalOutputMode,
        KnowledgeRetrievalSemanticIntent,
    )
    
    auto_response = retrieval_client.retrieve(
        KnowledgeBaseRetrievalRequest(
            intents=[KnowledgeRetrievalSemanticIntent(search=question)],
            retrieval_reasoning_effort=(
                KnowledgeRetrievalAutoReasoningEffort()
            ),
            output_mode=KnowledgeRetrievalOutputMode.EXTRACTIVE_DATA,
            include_activity=True,
        )
    )
    

    參考資料:KnowledgeBaseRetrievalClient。

  1. 新增外部規劃模型,並將 Auto 設定為知識庫預設。

    using Azure.Search.Documents.Indexes.Models;
    using Azure.Search.Documents.KnowledgeBases.Models;
    
    var azureOpenAIParameters = new AzureOpenAIVectorizerParameters
    {
        ResourceUri = new Uri("<azure-openai-endpoint>"),
        DeploymentName = "<model-deployment-name>",
        ModelName = "<model-name>",
    };
    knowledgeBase.Models.Clear();
    knowledgeBase.Models.Add(new KnowledgeBaseMicrosoftRetriever1Model());
    knowledgeBase.Models.Add(new KnowledgeBaseAzureOpenAIModel(
        azureOpenAIParameters: azureOpenAIParameters));
    knowledgeBase.RetrievalReasoningEffort =
        new KnowledgeRetrievalAutoReasoningEffort();
    knowledgeBase = (await indexClient.CreateOrUpdateKnowledgeBaseAsync(
        knowledgeBase)).Value;
    

    參考:KnowledgeBase, SearchIndexClient。

  2. 使用 Auto 取回。

    using Azure.Search.Documents.KnowledgeBases.Models;
    
    var autoRequest = new KnowledgeBaseRetrievalRequest
    {
        Intents = { new KnowledgeRetrievalSemanticIntent(question) },
        RetrievalReasoningEffort =
            new KnowledgeRetrievalAutoReasoningEffort(),
        OutputMode = KnowledgeRetrievalOutputMode.ExtractiveData,
        IncludeActivity = true,
    };
    var autoResponse = await retrievalClient.RetrieveAsync(autoRequest);
    

    參考資料:KnowledgeBaseRetrievalClient。

  1. 新增外部規劃模型,並將自動設定為知識庫預設。

    PUT {{searchEndpoint}}/knowledgebases/{{knowledgeBaseName}}?api-version=2026-11-01-preview
    Content-Type: application/json
    Authorization: ******
    
    {
      "name": "{{knowledgeBaseName}}",
      "knowledgeSources": [{ "name": "{{knowledgeSourceName}}" }],
      "models": [
        { "kind": "microsoftRetriever1" },
        {
          "kind": "azureOpenAI",
          "azureOpenAIParameters": {
            "resourceUri": "<azure-openai-endpoint>",
            "deploymentId": "<model-deployment-name>",
            "modelName": "<model-name>"
          }
        }
      ],
      "retrievalReasoningEffort": { "kind": "auto" },
      "outputMode": "extractiveData"
    }
    

    參考:知識庫 - 建立或更新。

  2. 使用 Auto 取回。

    POST {{searchEndpoint}}/knowledgebases/{{knowledgeBaseName}}/retrieve?api-version=2026-11-01-preview
    Content-Type: application/json
    Authorization: ******
    
    {
      "intents": [{
        "type": "semantic",
        "search": "What parental leave do Canadian employees receive and how do they request it?"
      }],
      "retrievalReasoningEffort": { "kind": "auto" },
      "outputMode": "extractiveData",
      "includeActivity": true
    }
    

    參考資料:知識檢索 - 檢索。

以下活動摘要顯示一個自動請求,從 microsoft-retriever-1 轉由外部規劃模型處理:

{
  "activity": [
    {
      "type": "modelQueryPlanning",
      "model": {
        "modelName": "microsoft-retriever-1"
      }
    },
    {
      "type": "modelQueryPlanning",
      "model": {
        "modelName": "<model-name>",
        "deploymentId": "<model-deployment-name>"
      }
    },
    {
      "type": "agenticReasoning",
      "logicalReasoningEffort": {
        "kind": "auto"
      }
    }
  ]
}

第一個規劃記錄顯示 microsoft-retriever-1 活動。 第二項則顯示規劃工作已交由外部規劃模型負責。

更多資訊請參閱 檢索推理努力。

Limitations

  • 僅使用 microsoft-retriever-1 的知識庫不支援低或中等的擷取推理努力或知識來源選擇。
  • 直接搜尋代理執行不支援非零 skip、orderby、count: true、面向、覆蓋範圍低於 100、醒目提示、查詢重寫、拼字、semanticQuery、答案、說明文字、語意等待或錯誤控制、向量查詢重寫、featuresMode、queryLanguage 或 semanticFields。 也不支援啟用 Purview 的索引。

Troubleshooting

如果包含活動的最小請求沒有 model.modelName 為 microsoft-retriever-1 的 modelQueryPlanning 活動,請檢查先決條件並確認請求包含一個語意意圖。 多重意圖會跳過 microsoft-retriever-1 規劃,執行一般最小取回,並返回 agenticReasoning,且在 206 活動記錄中附帶警告。

如果 microsoft-retriever-1 已啟動但未完成規劃,其 modelQueryPlanning 活動記錄中包含錯誤。 在最小模式下,請求會在保留取得的結果時返回 206 ;否則,請求會失敗。 透過 Auto,規劃可以交由外部規劃模型負責,如 Auto 活動範例所示。

清除範例資源

只刪除您為此範例建立的資源,依相依順序:知識庫、知識來源,然後索引。

index_client.delete_knowledge_base(knowledge_base_name)
index_client.delete_knowledge_source(knowledge_source_name)
index_client.delete_index(index_name)

參考:SearchIndexClient。

await indexClient.DeleteKnowledgeBaseAsync(knowledgeBaseName);
await indexClient.DeleteKnowledgeSourceAsync(knowledgeSourceName);
await indexClient.DeleteIndexAsync(indexName);

參考:SearchIndexClient。

### Delete the owned sample KB
DELETE {{searchEndpoint}}/knowledgebases/{{knowledgeBaseName}}?api-version=2026-11-01-preview
Authorization: Bearer {{searchAccessToken}}

### Delete the owned sample knowledge source
DELETE {{searchEndpoint}}/knowledgesources/{{knowledgeSourceName}}?api-version=2026-11-01-preview
Authorization: Bearer {{searchAccessToken}}

### Delete the owned sample index
DELETE {{searchEndpoint}}/indexes/{{indexName}}?api-version=2026-11-01-preview
Authorization: Bearer {{searchAccessToken}}

參考資料:知識庫、 知識來源與 索引。