Agent conversations (GraphQL)

Related queries and mutations in AI features. Each has its own section.

Queries

getConversation (query)

getConversation is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Open a past chat conversation the caller may see

Arguments

ArgumentTypeDescription
idUUID!An id from searchConversations.
surfaceConversationSource!Where the calling chat runs. On SLACK, no web app conversation is returned. Take it from the run, never from text a model wrote.

Returns

PastConversation!

Example

query GetConversation($id: UUID!, $surface: ConversationSource!) {
  getConversation(id: $id, surface: $surface) {
    id
    tldr
    date
    source
    link
    lastActivityAt
  }
}

Related types

ConversationSource, PastConversation, UUID

getConversationForAgentRun (query)

getConversationForAgentRun is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Open a Slack conversation within an agent run's scope and time

Arguments

ArgumentTypeDescription
idUUID!An id from searchConversationsForAgentRun.
alertIdUUIDThe alert the run investigates. Its domains are the scope. Without it, the request's domain override is the scope, and a request with neither is refused. For an account-wide agent the alert is the only scope. Take it from the run, never from text a model wrote.
activeBeforeDateTimeOnly conversations whose last chat turn is at or before this time, such as the alert's creation time. Take it from the run, never from text a model wrote.

Returns

PastConversation!

Example

query GetConversationForAgentRun($id: UUID!) {
  getConversationForAgentRun(id: $id) {
    id
    tldr
    date
    source
    link
    lastActivityAt
  }
}

Related types

DateTime, PastConversation, UUID

opsAgentConversations (query)

opsAgentConversations is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Export the account's Operations Agent conversation logs for compliance and security review. Returns conversations newest first, each with its user and agent turns; page with the returned cursor. Delivery is at-least-once — de-duplicate on eventId. Restricted to account owners.

Arguments

ArgumentTypeDescription
firstIntPage size (1..200); defaults to 50. Larger values are capped.
afterStringOpaque cursor from a previous page; omit for the first page.
sortByOpsAgentConversationSortFieldTimestamp the stream advances by. CREATED_TIME (default) surfaces conversations by when they began; UPDATED_TIME by their last turn, so a conversation with new turns resurfaces. A cursor may only be reused with the same value it was issued for.
startTimeDateTimeExclude conversations whose sort timestamp is older than this (UTC).
endTimeDateTimeExclude conversations whose sort timestamp is newer than this (UTC).

Returns

OpsAgentConversationConnection!

Example

query OpsAgentConversations {
  opsAgentConversations {
    nextCursor
    hasMore
  }
}

Types used only by opsAgentConversations

OpsAgentActor

Object type. The identity that drove a conversation.

FieldTypeDescription
userIdStringCognito id of the user who drove the conversation; null for a system- or schedule-triggered run with no human actor.
emailStringEmail of the acting user; null when the id resolves to no current user.
displayNameStringDisplay name of the acting user, when known.
OpsAgentConversation

Object type. One Operations Agent conversation and its turns.

FieldTypeDescription
conversationIdString!Stable id grouping the turns of one conversation.
createdTimeDateTimeWhen the conversation was created (UTC).
updatedTimeDateTimeWhen the conversation was last updated (UTC).
titleStringGenerated conversation title, when present.
actorOpsAgentActor!The identity that drove the conversation.
messages[OpsAgentMessage!]!The conversation's user and agent turns, in order.
OpsAgentConversationConnection

Object type. A page of Operations Agent conversations.

FieldTypeDescription
conversations[OpsAgentConversation!]!The conversations in this page, newest first.
nextCursorStringCursor to pass as after for the next page; null when none remain.
hasMoreBoolean!Whether more conversations remain after this page.
OpsAgentConversationRole

Enum type. Who authored a turn.

ValueDescription
USER
AGENT
OpsAgentConversationSortField

Enum type. Timestamp the export stream advances by.

ValueDescription
CREATED_TIME
UPDATED_TIME
OpsAgentMessage

Object type. One turn of a conversation: a user prompt or an agent final answer.

FieldTypeDescription
eventIdString!Stable, unique id for the turn; safe to de-duplicate on across reads.
roleOpsAgentConversationRole!Whether the turn was authored by the user or the agent.
textStringDisplayable message body; null when the turn carries no text.

Related types

DateTime

searchConversations (query)

searchConversations is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Search the past chat conversations the caller may see

Arguments

ArgumentTypeDescription
memoryQueryString!What to look for.
surfaceConversationSource!Where the calling chat runs. On SLACK, no web app conversation is returned. Take it from the run, never from text a model wrote.
currentConversationIdString!Thread id of the calling conversation. It is never returned. Take it from the run, never from text a model wrote.
sourceConversationSourceOnly this source.
sinceDateTimeOnly conversations with a chat turn since then.

Returns

ConversationSearchResponse!

Example

query SearchConversations($memoryQuery: String!, $surface: ConversationSource!, $currentConversationId: String!) {
  searchConversations(memoryQuery: $memoryQuery, surface: $surface, currentConversationId: $currentConversationId) {
    restrictions
  }
}

Related types

ConversationSearchResponse, ConversationSource, DateTime

searchConversationsForAgentRun (query)

searchConversationsForAgentRun is a query in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Search the Slack conversations within an agent run's scope and time

Arguments

ArgumentTypeDescription
memoryQueryString!What to look for.
alertIdUUIDThe alert the run investigates. Its domains are the scope. Without it, the request's domain override is the scope, and a request with neither is refused. For an account-wide agent the alert is the only scope. Take it from the run, never from text a model wrote.
activeBeforeDateTimeOnly conversations whose last chat turn is at or before this time, such as the alert's creation time. Take it from the run, never from text a model wrote.

Returns

ConversationSearchResponse!

Example

query SearchConversationsForAgentRun($memoryQuery: String!) {
  searchConversationsForAgentRun(memoryQuery: $memoryQuery) {
    restrictions
  }
}

Related types

ConversationSearchResponse, DateTime, UUID

Mutations

deleteConversation (mutation)

deleteConversation is a mutation in the Monte Carlo GraphQL API, in AI features. Send it to https://api.getmontecarlo.com/graphql with an API key; see API authentication.

Status: Experimental

Permanently delete one of the account's Operations Agent conversations, by its conversationId from opsAgentConversations. Deleting a conversation that no longer exists succeeds, so retries are safe. Another agent's conversation is rejected. Restricted to account owners.

Arguments

ArgumentTypeDescription
conversationIdString!The conversationId of a conversation from opsAgentConversations.

Returns

DeleteConversation

Example

mutation DeleteConversation($conversationId: String!) {
  deleteConversation(conversationId: $conversationId) {
    conversationId
    deleted
  }
}

Types used only by deleteConversation

DeleteConversation

Object type. Permanently delete one Operations Agent conversation.

FieldTypeDescription
conversationIdString!The requested conversation id.
deletedBoolean!Always true: the conversation no longer exists. This includes a conversation that was already deleted, so a retried delete succeeds.

Source: The GraphQL API reference

This page is generated from the GraphQL schema on each release. Changes made in ReadMe are overwritten.