Use Microsoft Retriever 1 in Foundry IQ (Azure AI Search)

Important

Microsoft Retriever 1 is in public preview and is subject to the Supplemental Terms of Use for Microsoft Azure Previews.

For preview terms specific to this feature, see Preview functionality.

microsoft-retriever-1 is a specialized retrieval model hosted in Foundry IQ (Azure AI Search). You don't need to connect an external planning model or configure its networking and authentication for the retrieval planning it provides. This workflow searches a small policy index directly, then exposes the same content through a knowledge base.

Usage support

Azure portal Microsoft Foundry portal .NET SDK Python SDK Java SDK JavaScript SDK REST API
❌ ❌ ✔️ ✔️ ✔️ ✔️ ✔️

Prerequisites

  • A Foundry IQ service with the Standard Knowledge Retrieval plan in a supported region.
  • Permission to create, populate, query, and delete the sample index, knowledge source, and knowledge base. For keyless authentication, assign your identity the Search Service Contributor, Search Index Data Contributor, and Search Index Data Reader roles on the Foundry IQ service.
  • The most recent preview version of azure-search-documents, and the azure-identity package. See the Python client library.
  • A .NET 8 or later console project with the most recent preview version of Azure.Search.Documents. See the .NET client library.

Create a small policy index

Create an index with searchable policy text and a filterable jurisdiction field.

Sign in as described in Connect to Foundry IQ. Run the SDK snippets in order.

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)

Reference: DefaultAzureCredential, SearchClient, SearchIndexClient.

Create the index and upload two synthetic policies.

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)

Reference: SearchIndexClient, SearchIndex, SearchClient.upload_documents.

Sign in as described in Connect to Foundry IQ. Run the SDK snippets in order.

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);

Reference: DefaultAzureCredential, SearchClient, SearchIndexClient.

Create the index and upload two synthetic policies.

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);

Reference: SearchIndexClient, SearchIndex, SearchClient.UploadDocumentsAsync.

  1. Set the Foundry IQ service endpoint and access token. To get an access token, see Connect to Foundry IQ.

    @searchEndpoint = <search-endpoint>
    @searchAccessToken = <search-access-token>
    @indexName = mr1-policy-index
    @knowledgeSourceName = mr1-policy-source
    @knowledgeBaseName = mr1-policy-kb
    
  2. Create the index.

    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 }
      ]
    }
    

    Reference: Indexes - Create or update.

  3. Upload two synthetic documents.

    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."
        }
      ]
    }
    

    Reference: Documents - Index.

Search directly with Microsoft Retriever 1

Submit the full question with agentic query execution, a filter, and debug mode set to agentic.

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()

Example diagnostics:

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

Reference: SearchClient.search.

Submit the full question with agentic query execution, a filter, and debug mode set to 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);

Example diagnostics:

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

Reference: SearchClient.SearchAsync, SearchOptions.

Submit the full question with queryType: "agentic". The filter restricts evidence to Canada, and select controls the returned fields.

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"
}

Reference: Documents - Search POST.

A 200 response means the request completed. A 206 response means partial success, and the response can still include documents.

A termination reason of modelStopped means processing completed after the model stopped or the service reached its iteration limit. maxRuntimeExceeded means the request reached its runtime limit before the model stopped. modelFailed means model processing failed before the model stopped.

Retrieve through a knowledge base

Use a search-index knowledge source to reuse the same index.

  1. Create the knowledge source.

    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"),
                ],
            ),
        ),
    )
    

    Reference: SearchIndexClient.

  2. Create the knowledge base with the microsoft-retriever-1 model, Minimal reasoning, and extractive output.

    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,
    ))
    

    Reference: KnowledgeBase, SearchIndexClient.

  3. Retrieve with exactly one semantic intent containing the complete question.

    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,
    ))
    

    Reference: KnowledgeBaseRetrievalClient.

  1. Create the knowledge source.

    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;
    

    Reference: SearchIndexClient.

  2. Create the knowledge base with the microsoft-retriever-1 model, Minimal reasoning, and extractive output.

    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;
    

    Reference: KnowledgeBase, SearchIndexClient.

  3. Retrieve with exactly one semantic intent containing the complete question.

    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);
    

    Reference: KnowledgeBaseRetrievalClient.

  1. Create the knowledge source.

    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" }
        ]
      }
    }
    

    Reference: Knowledge sources - Create or update.

  2. Create the knowledge base with the microsoftRetriever1 model kind, Minimal reasoning, and extractive output.

    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"
    }
    

    Reference: Knowledge bases - Create or update.

  3. Retrieve with exactly one semantic intent containing the complete question.

    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
    }
    

    Reference: Knowledge retrieval - Retrieve.

The activity log includes a planner result similar to the following example:

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

For parsing and correlating the JSON response during evidence inspection, follow Extracted response, References array, and Activity array.

Auto retrieval reasoning effort

Requests can vary in difficulty. Some requests can be answered with a quick lookup, while others need deeper planning. Use Auto when you can't predict the difficulty of each request in advance. Instead of applying one fixed reasoning effort to every request, Auto chooses the retrieval depth for each request.

Auto follows one of two paths for each request. The default path starts with the initial Auto pass, which uses Minimal retrieval reasoning effort, and moves to deeper planning only when needed. If a request isn't eligible for the default path, Auto starts at Medium effort instead. Auto requires an external planning model, which it uses when a request starts at or escalates to Medium. The default path is available only when the request meets all of the following requirements:

Knowledge source Initial Auto pass
Search index ✔️
Azure Blob ✔️
Azure SQL ✔️
File ✔️
OneLake ✔️
Indexed SharePoint ✔️
Remote SharePoint ❌
Fabric Data Agent ❌
Fabric Ontology ❌
MCP server ❌
Work IQ ❌
Web ❌
  • For knowledge sources in the initial Auto pass, image serving is off, and resultsProcessing isn't set to none.

If the request contains more than one semantic intent or another requirement for the initial Auto pass isn't met, Auto starts with Medium. A knowledge source that isn't used in the initial Auto pass can still be queried in later planning stages.

When a request is eligible for the default path, Auto escalates from simpler retrieval to more complex planning as needed:

  1. Auto first sends queries to the knowledge sources that are eligible for the initial pass. If the top-ranked result is relevant enough, Auto returns these results right away.
  2. If the request is too complex for the initial pass and microsoft-retriever-1 supports all knowledge sources available to the request, microsoft-retriever-1 runs deeper retrieval.
  3. Finally, microsoft-retriever-1 can escalate to the external planning model with Medium effort when the request needs deeper planning.

To use Auto, add a supported external model to the knowledge base, configure access to the model, and set the retrieval reasoning effort to Auto.

  1. Add an external planning model and set Auto as the knowledge base default.

    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,
    )
    

    Reference: KnowledgeBase, SearchIndexClient.

  2. Retrieve with Auto.

    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,
        )
    )
    

    Reference: KnowledgeBaseRetrievalClient.

  1. Add an external planning model and set Auto as the knowledge base default.

    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;
    

    Reference: KnowledgeBase, SearchIndexClient.

  2. Retrieve with 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);
    

    Reference: KnowledgeBaseRetrievalClient.

  1. Add an external planning model and set Auto as the knowledge base default.

    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"
    }
    

    Reference: Knowledge bases - Create or update.

  2. Retrieve with 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
    }
    

    Reference: Knowledge retrieval - Retrieve.

The following shortened activity excerpt shows an Auto request that escalates from microsoft-retriever-1 to the external planning model:

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

The first planning record shows microsoft-retriever-1 activity. The second shows that planning was handed off to the external planning model.

For more information, see retrieval reasoning effort.

Limitations

  • A knowledge base that only uses microsoft-retriever-1 doesn't support Low or Medium retrieval reasoning effort or knowledge source selection.
  • Direct Search agentic execution doesn't support nonzero skip, orderby, count: true, facets, coverage below 100, highlighting, query rewrites, speller, semanticQuery, answers, captions, semantic wait or error controls, vector query rewrites, featuresMode, queryLanguage, or semanticFields. Purview-enabled indexes also aren't supported.

Troubleshooting

If a Minimal request that includes activity has no modelQueryPlanning activity with a model.modelName of microsoft-retriever-1, check the prerequisites and confirm that the request contains one semantic intent. Multiple intents skip microsoft-retriever-1 planning, run ordinary Minimal retrieval, and return 206 with a warning in the agenticReasoning activity record.

If microsoft-retriever-1 starts but doesn't complete planning, its modelQueryPlanning activity record contains an error. With Minimal, the request returns 206 when it retains retrieved results; otherwise, the request fails. With Auto, planning can be handed off to the external planning model, as shown in the Auto activity example.

Clean up sample resources

Delete only resources you created for this sample, in dependency order: knowledge base, knowledge source, then index.

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

Reference: SearchIndexClient.

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

Reference: 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}}

Reference: Knowledge bases, Knowledge sources, and Indexes.