Skip to content

Commit 1f389d1

Browse files
authored
feat(specs): add agentic analytics support to insights spec (#6876)
1 parent 645d1b2 commit 1f389d1

5 files changed

Lines changed: 67 additions & 7 deletions

File tree

‎specs/insights/common/schemas/EventAttributes.yml‎

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,30 @@ timestamp:
5151

5252
queryID:
5353
type: string
54-
pattern: '[0-9a-f]{32}'
55-
minLength: 32
56-
maxLength: 32
57-
description: |
54+
pattern: '^([0-9a-f]{32}|message_[!-~]+)$'
55+
maxLength: 128
56+
description: >
5857
Unique identifier for a search query.
5958
59+
6060
The query ID is required for events related to search or browse requests.
61-
If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response.
62-
example: 3e48cd0616e466948dd85abf5c3fbbe2
61+
62+
If you add `clickAnalytics: true` as a search request parameter, the
63+
query ID is included in the API response.
64+
65+
For agentic analytics events, the query ID may be prefixed with
66+
`message_` followed by any printable string.
67+
examples:
68+
- 3e48cd0616e466948dd85abf5c3fbbe2
69+
- message_my-custom-query-id
70+
71+
agentID:
72+
type: string
73+
minLength: 1
74+
description: >
75+
Unique identifier for an agent session.
76+
Used to correlate instantsearch events with a specific agent interaction.
77+
example: agent-session-123
6378

6479
objectIDs:
6580
type: array

‎specs/insights/common/schemas/EventsItems.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ oneOf:
1111
- $ref: './ConvertedFilters.yml'
1212
- $ref: './ViewedObjectIDs.yml'
1313
- $ref: './ViewedFilters.yml'
14+
- $ref: './Instantsearch.yml'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
type: object
2+
properties:
3+
eventName:
4+
$ref: './EventAttributes.yml#/eventName'
5+
eventType:
6+
$ref: './InstantsearchEvent.yml'
7+
userToken:
8+
$ref: './EventAttributes.yml#/userToken'
9+
authenticatedUserToken:
10+
$ref: './EventAttributes.yml#/authenticatedUserToken'
11+
timestamp:
12+
$ref: './EventAttributes.yml#/timestamp'
13+
agentID:
14+
$ref: './EventAttributes.yml#/agentID'
15+
required:
16+
- eventName
17+
- eventType
18+
- userToken
19+
x-discriminator-fields:
20+
- eventType
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
type: string
2+
enum:
3+
- instantsearch

‎specs/insights/paths/pushEvents.yml‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,27 @@ post:
185185
userToken: anonymous-user-1
186186
authenticatedUserToken: user-1
187187
filters: ['category:books']
188+
InstantsearchMinimum:
189+
summary: Minimum instantsearch event
190+
description: >
191+
Minimum valid instantsearch event for agentic analytics
192+
telemetry.
193+
value:
194+
events:
195+
- eventName: Instantsearch Telemetry
196+
eventType: instantsearch
197+
userToken: anonymous-user-1
198+
InstantsearchWithAgentID:
199+
summary: Instantsearch event with agentID
200+
description: >
201+
Instantsearch event with agentID to correlate events within
202+
a single agent session.
203+
value:
204+
events:
205+
- eventName: Instantsearch Telemetry
206+
eventType: instantsearch
207+
userToken: anonymous-user-1
208+
agentID: agent-session-123
188209

189210
responses:
190211
'200':
@@ -313,7 +334,7 @@ post:
313334
summary: Wrong event type
314335
value:
315336
status: 422
316-
message: EventType must be one of "click", "conversion" or "view"
337+
message: EventType must be one of "click", "conversion", "view" or "instantsearch"
317338
IndexRequired:
318339
summary: Missing index attribute
319340
value:

0 commit comments

Comments
 (0)