Skip to content

Commit 43e0a15

Browse files
Merge pull request #6894 from HeidiSteen/release-aug-2
Knowledge agent updates
2 parents fa333e6 + 2940650 commit 43e0a15

File tree

3 files changed

+96
-4
lines changed

3 files changed

+96
-4
lines changed

articles/search/search-agentic-retrieval-how-to-create.md

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,18 +241,73 @@ PUT {{search-url}}/agents/{{agent-name}}?api-version=2025-08-01-preview
241241

242242
<!-- --- -->
243243

244-
## Confirm knowledge agent operations
244+
## Query the knowledge agent
245245

246246
Call the **retrieve** action on the knowledge agent object to confirm the model connection and return a response. Use the [2025-08-01-preview](/rest/api/searchservice/operation-groups?view=rest-searchservice-2025-08-01-preview&preserve-view=true) data plane REST API or an Azure SDK preview package that provides equivalent functionality for this task.
247247

248-
Replace "What are my vision benefits?" with a query string that's valid for your search index.
248+
Replace "where does the ocean look green?" with a query string that's valid for your search index.
249249

250250
```http
251251
# Send grounding request
252252
POST {{search-url}}/agents/{{agent-name}}/retrieve?api-version=2025-08-01-preview
253253
Content-Type: application/json
254254
Authorization: Bearer {{accessToken}}
255255
256+
{
257+
"messages" : [
258+
{ "role" : "assistant",
259+
"content" : [
260+
{ "type" : "text", "text" : "Use the earth at night index to answer the question. If you can't find relevant content, say you don't know." }
261+
]
262+
},
263+
{
264+
"role" : "user",
265+
"content" : [
266+
{
267+
"text" : "where does the ocean look green?",
268+
"type" : "text"
269+
}
270+
]
271+
}
272+
],
273+
"knowledgeSourceParams": [
274+
{
275+
"filterAddOn": null,
276+
"knowledgeSourceName": "earth-at-night-blob-ks",
277+
"kind": "searchIndex"
278+
}
279+
]
280+
}
281+
```
282+
283+
[messages](/rest/api/searchservice/knowledge-retrieval/retrieve?view=rest-searchservice-2025-08-01-preview#knowledgeagentmessage&preserve-view=true) is required, but you can run this example using just "user" role that provides the query.
284+
285+
[`knowledgeSourceParams`](/rest/api/searchservice/knowledge-retrieval/retrieve?view=rest-searchservice-2025-08-01-preview#searchindexknowledgesourceparams&preserve-view=true) is optional. Specify a knowledge source if the agent is configured for multiple sources and you want to focus the retrieve action on just one of them.
286+
287+
A knowledge source specification on the retrieve action describes the target search index on the search service. So even if the knowledge source "kind" is Azure blob, the valid value here is `searchIndex`. In this first public preview release, `knowledgeSourceParams.kind` is always `searchIndex`.
288+
289+
The response to the previous query might look like this:
290+
291+
```http
292+
"response": [
293+
{
294+
"content": [
295+
{
296+
"type": "text",
297+
"text": "The ocean appears green off the coast of Antarctica due to phytoplankton flourishing in the water, particularly in Granite Harbor near Antarctica’s Ross Sea, where they can grow in large quantities during spring, summer, and even autumn under the right conditions [ref_id:0]. Additionally, off the coast of Namibia, the ocean can also look green due to blooms of phytoplankton and yellow-green patches of sulfur precipitating from bacteria in oxygen-depleted waters [ref_id:1]. In the Strait of Georgia, Canada, the waters turned bright green due to a massive bloom of coccolithophores, a type of phytoplankton [ref_id:5]. Furthermore, a milky green and blue bloom was observed off the coast of Patagonia, Argentina, where nutrient-rich waters from different currents converge [ref_id:6]. Lastly, a large bloom of cyanobacteria was captured in the Baltic Sea, which can also give the water a green appearance [ref_id:9]."
298+
}
299+
]
300+
}
301+
],
302+
```
303+
304+
305+
<!-- ```http
306+
# Send grounding request
307+
POST {{search-url}}/agents/{{agent-name}}/retrieve?api-version=2025-08-01-preview
308+
Content-Type: application/json
309+
Authorization: Bearer {{accessToken}}
310+
256311
{
257312
"messages" : [
258313
{
@@ -278,7 +333,7 @@ POST {{search-url}}/agents/{{agent-name}}/retrieve?api-version=2025-08-01-previe
278333
}
279334
]
280335
}
281-
```
336+
``` -->
282337

283338
For more information about the **retrieve** API and the shape of the response, see [Retrieve data using a knowledge agent in Azure AI Search](search-agentic-retrieval-how-to-retrieve.md).
284339

articles/search/search-knowledge-source-how-to-blob.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,12 @@ We recommend using the Azure portal to validate output creation.
211211
212212
## Assign to a knowledge agent
213213
214-
If you're satisfied with the index, continue to the next step: specifying the knowledge source in a [knowledge agent](search-agentic-retrieval-how-to-create.md).
214+
If you're satisfied with the index, continue to the next step: specify the knowledge source in a [knowledge agent](search-agentic-retrieval-how-to-create.md).
215215
216216
Within the knowledge agent, there are more properties to set on the knowledge source that are specific to query operations.
217217
218+
After the knowledge agent is configured, use the retrieve action to query the knowledge source.
219+
218220
## Delete a knowledge source
219221
220222
If you no longer need the knowledge source, or if you need to rebuild it on the search service, use this request to delete the current object.

articles/search/search-knowledge-source-overview.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Make sure you have at least one knowledge source before creating a knowledge age
2222

2323
## Key points about a knowledge source
2424

25+
+ Creation path: first create knowledge source, then create knowledge agents. Deletion path: update or delete knowledge agents, delete knowledge sources last.
26+
2527
+ A knowledge source, its index, and the knowledge agent must all exist on the same search service.
2628

2729
+ Each knowledge source points to exactly one index, and that index must [meet the criteria for agentic retrieval](search-agentic-retrieval-how-to-index.md).
@@ -80,3 +82,36 @@ To achieve the fastest possible response times, follow these best practices:
8082
+ Retain `includeReferences` set to true (default setting) for details about each individually scored result.
8183

8284
+ Set `includeReferenceSourceData` to false if you don't need the verbatim content from the index. Omitting this information simplifies the response and makes it more readable.
85+
86+
## Delete a knowledge source
87+
88+
Before you can delete a knowledge source, you must delete or update any knowledge agent that references it. The associated index is a standalone object in Azure AI Search and doesn't need to be deleted or updated in tandem with the knowledge source, but no references to the knowledge source can exist if you want to delete it.
89+
90+
If you try to delete a knowledge source that's in use, the action fails and a list of affected knowledge agents is returned.
91+
92+
1. Get the knowledge agent definition to confirm knowledge source references.
93+
94+
```http
95+
### Get the knowledge agent
96+
GET {{search-endpoint}}/agents/hotels-index-ka?api-version=2025-08-01-preview
97+
api-key: {{api-key}}
98+
Content-Type: application/json
99+
```
100+
101+
1. Either update the knowledge agent by removing the knowledge source, or delete the knowledge agent. This example shows deletion.
102+
103+
```http
104+
### Delete knowledge agent
105+
DELETE {{search-endpoint}}/agents/hotels-index-ka?api-version=2025-08-01-preview
106+
api-key: {{api-key}}
107+
Content-Type: application/json
108+
```
109+
110+
1. Delete the knowledge source.
111+
112+
```http
113+
### Delete a knowledge source definition
114+
GET {{search-endpoint}}/knowledgeSources/hotels-index-ks?api-version=2025-08-01-preview
115+
api-key: {{api-key}}
116+
Content-Type: application/json
117+
```

0 commit comments

Comments
 (0)