Skip to main content

Azure AI Search Tool

The Azure AI Search tool connects agents to new or existing search indexes, enabling retrieval and summarization of indexed documents to ground agent responses in proprietary content.

Prerequisites

  • Microsoft Foundry agent
  • Azure AI Search index with vector search configured
  • One or more Edm.String (text) fields (searchable and retrievable)
  • One or more Collection(Edm.Single) (vector) fields (searchable)

Quick Start

from azure.ai.projects.models import AzureAISearchTool

search_tool = AzureAISearchTool(
    connection_id="<connection-id>",
    index_name="products-index"
)

agent = project.agents.create_agent(
    model="gpt-4o",
    name="search-agent",
    instructions="Search the products index to answer questions",
    tools=search_tool.definitions,
    tool_resources=search_tool.resources,
)

Search Types

  • Simple: Basic keyword search
  • Semantic: AI-enhanced ranking
  • Vector: Semantic similarity search
  • Hybrid (vector + keyword): Combined approach (default)
  • Hybrid + semantic: Best of all methods

Setup Process

1

Create Project Connection

Connect your project to Azure AI Search service
2

Configure Index

Ensure index has vector and text fields
3

Add Tool to Agent

Configure agent with search tool

Limitations

  • One index per agent (use multiple agents for multiple indexes)
  • Private search requires Standard Setup
  • Same tenant requirement for search resource and agent
See Azure Functions for advanced integrations.

Build docs developers (and LLMs) love