AI · GraphQL query

aiQuerySearch query

Asks the AI assistant a natural-language question that it answers by searching the security graph, for example "which endpoints have not reported in a week". The question and the reply are appended to the thread. Returns an error when the AI service is not available; check aiStatus.

Response

Returns an AiThreadEntry!

Arguments

Name Description
threadId - AiThreadId! The thread ID.
message - String! Natural language input to base the query generation on.
timeRange - DateTimeRangeInput The time range to filter objects in the query. If not provided, the default is the last 30 days.
locationFilter - LocationFilterInput Limits the search results to objects matching the location search input.
aiModel - AiModelInput Optionally specify AI model to utilize.

Example

Query

query aiQuerySearch(
  $threadId: AiThreadId!,
  $message: String!,
  $timeRange: DateTimeRangeInput,
  $locationFilter: LocationFilterInput,
  $aiModel: AiModelInput
) {
  aiQuerySearch(
    threadId: $threadId,
    message: $message,
    timeRange: $timeRange,
    locationFilter: $locationFilter,
    aiModel: $aiModel
  ) {
    timestamp
    isFromUser
    message
  }
}

Variables

{
  "threadId": AiThreadId,
  "message": "xyz789",
  "timeRange": DateTimeRangeInput,
  "locationFilter": LocationFilterInput,
  "aiModel": AiModelInput
}

Response

{
  "data": {
    "aiQuerySearch": {
      "timestamp": "2021-10-07T18:23:25.829Z",
      "isFromUser": true,
      "message": "abc123"
    }
  }
}

Related operations

  • aiGenerateGraphQLQuery query: Asks the AI assistant to write a Wartiva GraphQL query from a natural-language request, for the object type the thread was created with (see…
  • aiGenerateSearchQuery query: Asks the AI assistant to turn a natural-language request into a graph search query, such as "Windows endpoints with an unencrypted disk", that can…
  • aiQueryObject query: Asks the AI assistant a natural-language question about the specific graph object the thread was created for (see aiThreadCreate with an object id).
  • aiThreadMessage query: Sends a message to an AI chat thread and returns the assistant's reply.