Skip to content

Commit 555fcd1

Browse files
committed
More updates and crosslinks
1 parent bd23a4a commit 555fcd1

File tree

3 files changed

+53
-51
lines changed

3 files changed

+53
-51
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,6 @@ Synonym maps are defined as a top-level resource on a search index and assigned
323323

324324
+ [Agentic retrieval in Azure AI Search](search-agentic-retrieval-concept.md)
325325

326+
+ [Agentic RAG: build a reasoning retrieval engine with Azure AI Search](https://www.youtube.com/watch?v=PeTmOidqHM8)
327+
326328
+ [Azure OpenAI Demo featuring agentic retrieval](https://github.com/Azure-Samples/azure-search-openai-demo)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,6 @@ Look at output tokens in the [activity array](search-agentic-retrieval-how-to-re
263263

264264
+ [Agentic retrieval in Azure AI Search](search-agentic-retrieval-concept.md)
265265

266+
+ [Agentic RAG: build a reasoning retrieval engine with Azure AI Search](https://www.youtube.com/watch?v=PeTmOidqHM8)
267+
266268
+ [Azure OpenAI Demo featuring agentic retrieval](https://github.com/Azure-Samples/azure-search-openai-demo)

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

Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -62,29 +62,25 @@ POST https://{{search-url}}/agents/{{agent-name}}/retrieve?api-version=2025-05-0
6262
{
6363
"role" : "assistant",
6464
"content" : [
65-
{ "type" : "text", "text" : "You are a helpful assistant for Contoso Human Resources. You have access to a search index containing guidelines about health care coverage for Washington state. If you can't find the answer in the search, say you don't know." }
65+
{ "type" : "text", "text" : "You can answer questions about the Earth at night.
66+
Sources have a JSON format with a ref_id that must be cited in the answer.
67+
If you do not have the answer, respond with "I don't know"." }
6668
]
6769
},
6870
{
6971
"role" : "user",
7072
"content" : [
71-
{ "type" : "text", "text" : "What are my options for health care coverage" }
72-
]
73-
},
74-
{
75-
"role" : "user",
76-
"content" : [
77-
{ "type" : "text", "text" : "Which one has vision benefits" }
73+
{ "type" : "text", "text" : "Why is the Phoenix nighttime street grid is so sharply visible from space, whereas large stretches of the interstate between midwestern cities remain comparatively dim?" }
7874
]
7975
}
8076
],
8177
"targetIndexParams" : [
8278
{
8379
"indexName" : "{{index-name}}",
84-
"filterAddOn" : "State eq 'WA'",
80+
"filterAddOn" : "page_number eq 105'",
8581
"IncludeReferenceSourceData": true,
8682
"rerankerThreshold" : 2.5,
87-
"maxDocsForReranker": 250
83+
"maxDocsForReranker": 50
8884
}
8985
]
9086
}
@@ -102,7 +98,7 @@ POST https://{{search-url}}/agents/{{agent-name}}/retrieve?api-version=2025-05-0
10298

10399
+ `filterAddOn` lets you set an [OData filter expression](search-filters.md) for keyword or hybrid search.
104100

105-
+ `IncludeReferenceSourceData` is initially set in the knowledge agent definition. You can override that setting in the retrieve action to return grounding data in the [references section](#review-the-references-array) of the response.
101+
+ `IncludeReferenceSourceData` tells the retrieval engine to return the source content in the response. This value is initially set in the knowledge agent definition. You can override that setting in the retrieve action to return original source content in the [references section](#review-the-references-array) of the response.
106102

107103
+ `rerankerThreshold` and `maxDocsForReranker` are also initially set in the knowledge agent definition as defaults. You can override them in the retrieve action to configure [semantic reranker](semantic-how-to-configure.md), setting minimum thresholds and the maximum number of inputs sent to the reranker.
108104

@@ -125,18 +121,21 @@ The body of the response is also structured in the chat message style format. Cu
125121
"content": [
126122
{
127123
"type": "text",
128-
"text": "[{\"ref_id\":0,\"title\":\"Vision benefits\",\"terms\":\"exams, frames, contacts\",\"content\":\"<content chunk>\"}]"
124+
"text": "[{\"ref_id\":0,\"title\":\"Urban Structure\",\"terms\":\"Location of Phoenix, Grid of City Blocks, Phoenix Metropolitan Area at Night\",\"content\":\"<content chunk redacted>\"}]"
129125
}
130126
]
131127
}
132128
]
133129
```
134130

135-
`content` is a JSON array. It's a single string composed of the most relevant documents (or chunks) found in the search index, given the query and chat history inputs. This array is your grounding data that a conversational language model uses to formulate a response to the user's question.
131+
**Key points**:
132+
133+
+ `content` is a JSON array. It's a single string composed of the most relevant documents (or chunks) found in the search index, given the query and chat history inputs. This array is your grounding data that a conversational language model uses to formulate a response to the user's question.
136134

137-
The `maxOutputSize` property on the knowledge agent determines the length of the string. We recommend 5,000 tokens.
135+
+ text is the only valid value for type, and the text consists of the reference ID of the chunk (used for citation purposes), and any fields specified in the semantic configuration of the target index. In this example, you should assume the semantic configuration in the target index has a "title" field, a "terms" field, and a "content" filed.
138136

139-
Fields in the content `text` response string include the ref_id and semantic configuration fields: `title`, `terms`, `content`.
137+
> [!NOTE]
138+
> The `maxOutputSize` property on the [knowledge agent](search-agentic-retrieval-how-to-create.md) determines the length of the string. We recommend 5,000 tokens.
140139
141140
## Review the activity array
142141

@@ -154,36 +153,53 @@ Output includes:
154153
Here's an example of an activity array.
155154

156155
```json
157-
"activity": [
156+
"activity": [
158157
{
159158
"type": "ModelQueryPlanning",
160159
"id": 0,
161-
"inputTokens": 1270,
162-
"outputTokens": 221
160+
"inputTokens": 1261,
161+
"outputTokens": 270
163162
},
164163
{
165164
"type": "AzureSearchQuery",
166165
"id": 1,
167-
"targetIndex": "myindex",
166+
"targetIndex": "earth_at_night",
168167
"query": {
169-
"search": "impact of prior authorization process on out-of-pocket costs",
168+
"search": "suburban belts December brightening urban cores comparison",
170169
"filter": null
171170
},
172-
"queryTime": "2025-04-25T16:40:08.811Z",
173-
"count": 27,
174-
"elapsedMs": 623
171+
"queryTime": "2025-05-30T21:23:25.944Z",
172+
"count": 0,
173+
"elapsedMs": 600
175174
},
176175
{
177176
"type": "AzureSearchQuery",
178177
"id": 2,
179-
"targetIndex": "myindex",
178+
"targetIndex": "earth_at_night",
180179
"query": {
181-
"search": "copayment expectations for in-network services",
180+
"search": "Phoenix nighttime street grid visibility from space",
182181
"filter": null
183182
},
184-
"queryTime": "2025-04-25T16:40:08.955Z",
185-
"count": 22,
186-
"elapsedMs": 556
183+
"queryTime": "2025-05-30T21:23:26.128Z",
184+
"count": 2,
185+
"elapsedMs": 161
186+
},
187+
{
188+
"type": "AzureSearchQuery",
189+
"id": 3,
190+
"targetIndex": "earth_at_night",
191+
"query": {
192+
"search": "interstate visibility from space midwestern cities",
193+
"filter": null
194+
},
195+
"queryTime": "2025-05-30T21:23:26.277Z",
196+
"count": 0,
197+
"elapsedMs": 147
198+
},
199+
{
200+
"type": "AzureSearchSemanticRanker",
201+
"id": 4,
202+
"inputTokens": 2622
187203
}
188204
],
189205
```
@@ -204,39 +220,21 @@ Here's an example of the references array.
204220
"references": [
205221
{
206222
"type": "AzureSearchDoc",
207-
"id": "1",
223+
"id": "0",
208224
"activitySource": 2,
209-
"docKey": "2",
210-
"sourceData": {
211-
"id": "2",
212-
"parent": {
213-
"title": null,
214-
"content": "good by cruel world"
215-
}
216-
}
225+
"docKey": "earth_at_night_508_page_104_verbalized",
226+
"sourceData": null
217227
},
218228
{
219229
"type": "AzureSearchDoc",
220230
"id": "1",
221231
"activitySource": 2,
222-
"docKey": "4",
223-
"sourceData": {
224-
"id": "4",
225-
"parent": {
226-
"title": "zzzzzzz",
227-
"content": "zzzzzzz"
228-
}
229-
}
232+
"docKey": "earth_at_night_508_page_105_verbalized",
233+
"sourceData": null
230234
}
231235
]
232236
```
233237

234-
<!-- Create H2s for the main patterns. -->
235-
<!-- This section is in progress. It needs a code sample for the simple case showing how to pipeline ground data to chat completions and responses -->
236-
## Use data for grounding
237-
238-
The `includeReferenceSourceData` parameter tells the search engine to provide grounding data to the knowledge agent.
239-
240238
## Related content
241239

242240
+ [Agentic retrieval in Azure AI Search](search-agentic-retrieval-concept.md)

0 commit comments

Comments
 (0)