You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Azure AI Search, a *knowledge agent* is a top-level resource representing a connection to a chat completion model for use in agentic retrieval workloads. A knowledge agent specifies:
18
+
In Azure AI Search, a *knowledge agent* is a top-level resource representing a connection to a chat completion model for use in agentic retrieval workloads. A knowledge agent is used by the [retrieve method](search-agentic-retrieval-how-to-retrieve.md) in an LLM-powered information retrieval pipeline.
19
+
20
+
knowledge agent specifies:
19
21
20
22
+ A model that provides reasoning capabilities
21
-
+ A search index used at query time
22
-
+ Parameters on the index for setting default response behavior
23
+
+ A target search index used at query time
24
+
+ Parameters on the index for setting default behaviors and response shaping
23
25
24
26
After you can create a knowledge agent, you can update its properties at any time. If the knowledge agent is in use, updates take effect on the next job.
25
27
26
28
## Prerequisites
27
29
28
30
+ Familiarity with [agentic retrieval concepts and use cases](search-agentic-retrieval-concept.md).
29
31
30
-
+ A chat completion model on Azure OpenAI.
32
+
+ A [supported chat completion model](#supported-models) on Azure OpenAI.
31
33
32
34
+ Azure AI Search, in any [region that provides semantic ranker](search-region-support.md), on the basic pricing tier or higher. Your search service must have a [managed identity](search-howto-managed-identities-data-sources.md) for role-based access to the model.
33
35
@@ -104,7 +106,7 @@ You can use API keys if you don't have permission to create role assignments.
104
106
# List Indexes
105
107
GET https://{{search-url}}/indexes?api-version=2025-05-01-preview
106
108
Content-Type: application/json
107
-
@api-key = <YOUR-SEARCH-SERVICE-API-KEY>
109
+
@api-key: {{search-api-ke}}
108
110
```
109
111
110
112
## Check for existing knowledge agents
@@ -117,7 +119,7 @@ The following request lists knowledge agents by name on your search service. Wit
117
119
# List knowledge agents
118
120
GET https://{{search-url}}/agents?api-version=2025-05-01-preview
119
121
Content-Type: application/json
120
-
@token = <a long GUID>
122
+
Authorization: Bearer {{accessToken}}
121
123
```
122
124
123
125
You can also return a single agent by name to review its JSON definition.
@@ -126,7 +128,7 @@ You can also return a single agent by name to review its JSON definition.
126
128
# Get knowledge agent
127
129
GET https://{{search-url}}/agents/{{agent-name}}?api-version=2025-05-01-preview
128
130
Content-Type: application/json
129
-
@token = <a long GUID>
131
+
Authorization: Bearer {{accessToken}}
130
132
```
131
133
132
134
<!-- --- -->
@@ -145,12 +147,12 @@ To create an agent, use the 2025-05-01-preview data plane REST API or an Azure S
Copy file name to clipboardExpand all lines: articles/search/search-agentic-retrieval-how-to-retrieve.md
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ ms.date: 05/30/2025
17
17
18
18
In Azure AI Search, *agentic retrieval* is a new parallel query architecture that uses a chat completion model for query planning. It generates subqueries that broaden the scope of what's searchable and relevant.
19
19
20
-
This article explains how to use the [**retrieve** method](/rest/api/searchservice/knowledge-retrieval/retrieve?view=rest-searchservice-2025-05-01-preview&preserve-view=true) that invokes a knowledge agent and parallel query processing. This article also explains the three components of the retrieval response:
20
+
This article explains how to use the [**retrieve method**](/rest/api/searchservice/knowledge-retrieval/retrieve?view=rest-searchservice-2025-05-01-preview&preserve-view=true) that invokes a knowledge agent and parallel query processing. This article also explains the three components of the retrieval response:
21
21
22
22
+*extracted response for the LLM*
23
23
+*referenced results*
@@ -26,7 +26,7 @@ This article explains how to use the [**retrieve** method](/rest/api/searchservi
26
26
The retrieve request can include instructions for query processing that override the defaults set on the knowledge agent.
27
27
28
28
> [!NOTE]
29
-
> There's no model-generated "answer" in the response. Instead, the response provides grounding data used to generate an answer from an LLM. For an end-to-end example, see [Build an agent-to-agent retrieval solution ](search-agentic-retrieval-how-to-pipeline.md) or [Azure OpenAI Demo](https://github.com/Azure-Samples/azure-search-openai-demo).
29
+
> There's no model-generated "answer" in the response. Instead, the response passes content to an LLM that grounds its answer based on the content. For an end-to-end example that includes this step, see [Build an agent-to-agent retrieval solution ](search-agentic-retrieval-how-to-pipeline.md) or [Azure OpenAI Demo](https://github.com/Azure-Samples/azure-search-openai-demo).
30
30
31
31
## Prerequisites
32
32
@@ -49,10 +49,13 @@ All `searchable` fields in the search index are in-scope for query execution. If
49
49
The input for the retrieval route is chat conversation history in natural language, where the `messages` array contains the conversation.
50
50
51
51
```http
52
+
@search-url=<YOUR SEARCH SERVICE URL>
53
+
@accessToken=<YOUR PERSONAL ID>
54
+
52
55
# Send Grounding Request
53
56
POST https://{{search-url}}/agents/{{agent-name}}/retrieve?api-version=2025-05-01-preview
54
-
@accessToken=<YOUR PERSONAL ID>
55
57
Content-Type: application/json
58
+
Authorization: Bearer {{accessToken}}
56
59
57
60
{
58
61
"messages" : [
@@ -155,32 +158,32 @@ Here's an example of an activity array.
155
158
{
156
159
"type": "ModelQueryPlanning",
157
160
"id": 0,
158
-
"inputTokens": 1308,
159
-
"outputTokens": 141
161
+
"inputTokens": 1270,
162
+
"outputTokens": 221
160
163
},
161
164
{
162
165
"type": "AzureSearchQuery",
163
166
"id": 1,
164
167
"targetIndex": "myindex",
165
168
"query": {
166
-
"search": "hello world programming",
169
+
"search": "impact of prior authorization process on out-of-pocket costs",
167
170
"filter": null
168
171
},
169
172
"queryTime": "2025-04-25T16:40:08.811Z",
170
-
"count": 2,
171
-
"elapsedMs": 867
173
+
"count": 27,
174
+
"elapsedMs": 623
172
175
},
173
176
{
174
177
"type": "AzureSearchQuery",
175
178
"id": 2,
176
179
"targetIndex": "myindex",
177
180
"query": {
178
-
"search": "hello world meaning",
181
+
"search": "copayment expectations for in-network services",
179
182
"filter": null
180
183
},
181
184
"queryTime": "2025-04-25T16:40:08.955Z",
182
-
"count": 2,
183
-
"elapsedMs": 136
185
+
"count": 22,
186
+
"elapsedMs": 556
184
187
}
185
188
],
186
189
```
@@ -201,7 +204,7 @@ Here's an example of the references array.
0 commit comments