Agent memory (GraphQL)

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

Queries

getAgentMemorySuggestions (query)

getAgentMemorySuggestions 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

List a domain's memory suggestions, oldest first. Only a Monte Carlo agent limited to the domain may call it.

Arguments

ArgumentTypeDescription
domainUuidUUID!
statusAgentMemorySuggestionStatusPENDING (the default) leaves out suggestions older than 7 days. Default: "PENDING".

Returns

[AgentMemorySuggestion!]!

Example

query GetAgentMemorySuggestions($domainUuid: UUID!) {
  getAgentMemorySuggestions(domainUuid: $domainUuid) {
    id
    domainUuid
    level
    assetMcon
    agentType
    suggestionText
    source
    suggestionEvidence
    evidenceTool
    runAgentId
    runThreadId
    runTraceId
    status
    statusReason
    createdTime
  }
}

Related types

AgentMemorySuggestion, AgentMemorySuggestionStatus, UUID

getDomainAgentMemories (query)

getDomainAgentMemories 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

List the memories of a domain and of its assets

Arguments

ArgumentTypeDescription
domainUuidUUID!
mcons[String!]Limit the asset memories to these MCONs. Domain memories always return.

Returns

[AgentMemory!]!

Example

query GetDomainAgentMemories($domainUuid: UUID!) {
  getDomainAgentMemories(domainUuid: $domainUuid) {
    id
    level
    domainUuid
    assetMcon
    agentType
    memoryText
    createdBy
    authorName
    createdTime
    creationSource
    creationClient
    assetMissing
  }
}

Related types

AgentMemory, UUID

getMemoryCurationItems (query)

getMemoryCurationItems 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

A memory curation's items in post order, all or by number. Name the curation by its id, or by the agent thread its post went out from. A person with memory access to the curation's domain, or an agent limited to it, may call it. Fails with MEMORY_CURATION_INVALID when both or neither id is given, and MEMORY_CURATION_ITEM_NOT_FOUND for an unknown curation, thread or number.

Arguments

ArgumentTypeDescription
curationIdUUIDThe curation. Give this or agentThreadId.
agentThreadIdStringThe agent thread the curation's post went out from. Give this or curationId.
numbers[Int!]Item numbers to read. Omit for every item, conflicts included.

Returns

[MemoryCurationItem!]!

Example

query GetMemoryCurationItems {
  getMemoryCurationItems {
    id
    curationId
    itemNumber
    kind
    agentType
    level
    assetMcon
    itemText
    itemReason
    status
    resolvedTime
    suggestionIds
    createdTime
  }
}

Related types

MemoryCurationItem, UUID

getRecentMemoryCurationItems (query)

getRecentMemoryCurationItems 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

Items of the domain's curations posted in the last 10 days, in any status and conflicts included, newest post first. A curation that was never posted is left out. Only a Monte Carlo agent limited to the domain may call it.

Arguments

ArgumentTypeDescription
domainUuidUUID!

Returns

[MemoryCurationItem!]!

Example

query GetRecentMemoryCurationItems($domainUuid: UUID!) {
  getRecentMemoryCurationItems(domainUuid: $domainUuid) {
    id
    curationId
    itemNumber
    kind
    agentType
    level
    assetMcon
    itemText
    itemReason
    status
    resolvedTime
    suggestionIds
    createdTime
  }
}

Related types

MemoryCurationItem, UUID

getRejectedMemoryCurationItems (query)

getRejectedMemoryCurationItems 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

Items people rejected in the domain's curations of the last 90 days, newest first. Only a Monte Carlo agent limited to the domain may call it.

Arguments

ArgumentTypeDescription
domainUuidUUID!

Returns

[MemoryCurationItem!]!

Example

query GetRejectedMemoryCurationItems($domainUuid: UUID!) {
  getRejectedMemoryCurationItems(domainUuid: $domainUuid) {
    id
    curationId
    itemNumber
    kind
    agentType
    level
    assetMcon
    itemText
    itemReason
    status
    resolvedTime
    suggestionIds
    createdTime
  }
}

Related types

MemoryCurationItem, UUID

Mutations

applyMemoryCurationItems (mutation)

applyMemoryCurationItems 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

Save the picked items of a posted memory curation as the calling person, each in its own transaction, and reject the curation's other numbered items that are still proposed. A picked item that fails stays proposed, its failureReason says why, and the other items are still saved. Only a person with memory edit access to the curation's domain may call it. Fails with MEMORY_CURATION_INVALID when both or neither id is given, MEMORY_CURATION_ITEM_NOT_FOUND for an unknown or unposted curation, thread or number, MEMORY_CURATION_EXPIRED for a curation more than 7 days old, and MEMORY_CURATION_INVALID_ITEM for no number, a number or edit given twice, an edit for an item not picked or for a removal, or edit text that is empty or too long. An unexpected error can leave the items before it saved.

Arguments

ArgumentTypeDescription
agentThreadIdStringThe agent thread the curation's post went out from. Give this or curationId.
curationIdUUIDThe curation. Give this or agentThreadId.
itemNumbers[Int!]!The numbers the person picked, each once. At least 1.
textEdits[MemoryCurationTextEdit!]The person's own text for some of the picked items, one per item.

Returns

ApplyMemoryCurationItems

Example

mutation ApplyMemoryCurationItems($itemNumbers: [Int!]!) {
  applyMemoryCurationItems(itemNumbers: $itemNumbers) {
    rejectedItemNumbers
  }
}

Types used only by applyMemoryCurationItems

ApplyMemoryCurationItems

Object type. Save the picked items of a posted memory curation as the calling person.

FieldTypeDescription
results[MemoryCurationItemResult!]!One result per picked item, in post order.
rejectedItemNumbers[Int!]!The items this call rejected: every other numbered item still proposed.
MemoryCurationApplyFailure

Enum type. Why a picked item was not applied. NOT_PROPOSED: it was already applied, rejected or expired. MEMORY_CHANGED: a memory it changes was edited or deleted since the curation. LIMIT_REACHED: the domain or asset has the most memories allowed. ASSET_NOT_IN_DOMAIN: its asset left the domain.

ValueDescription
NOT_PROPOSED
MEMORY_CHANGED
LIMIT_REACHED
ASSET_NOT_IN_DOMAIN
MemoryCurationItemResult

Object type.

FieldTypeDescription
itemNumberInt!
appliedBoolean!
failureReasonMemoryCurationApplyFailureWhy it was not applied. Null when applied.
memoryIds[UUID!]!The memory the item saved. Empty for a removal and for a failed item.
MemoryCurationTextEdit

Input object type.

FieldTypeDescription
itemNumberInt!
itemTextString!The person's own text for the item, saved in place of the proposed text. At most 300 characters. Not for a REMOVE item.

Related types

UUID

createAgentMemory (mutation)

createAgentMemory 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

Save a memory for the AI agents

Arguments

ArgumentTypeDescription
memoryAgentMemoryInput!

Returns

CreateAgentMemory

Example

mutation CreateAgentMemory($memory: AgentMemoryInput!) {
  createAgentMemory(memory: $memory) {
    memory {
      id
      level
      domainUuid
      assetMcon
      agentType
      memoryText
      createdBy
      authorName
      createdTime
      creationSource
      creationClient
      assetMissing
    }
  }
}

Types used only by createAgentMemory

AgentMemoryInput

Input object type.

FieldTypeDescription
levelAgentMemoryLevel!
domainUuidUUID!
assetMconStringMCON of the asset. Required at the asset level; omit it (not null) otherwise.
agentTypeAiAgentType!
memoryTextString!Saved as one line: line breaks and other non-printable characters become spaces, and repeated spaces collapse. At most 300 characters after that.
CreateAgentMemory

Object type. Save a memory for the agents of a domain, or for one asset in the domain.

FieldTypeDescription
memoryAgentMemory!

Related types

AgentMemory, AgentMemoryLevel, AiAgentType, UUID

createAgentMemorySuggestions (mutation)

createAgentMemorySuggestions 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

Save an agent run's memory suggestions for one domain, all or none. Needs memory edit permission on the domain. An agent identity must be limited to the domain. Fails with AGENT_MEMORY_SUGGESTION_LIMIT_REACHED past 200 waiting suggestions.

Arguments

ArgumentTypeDescription
domainUuidUUID!
runAgentMemorySuggestionRunInput!
suggestions[AgentMemorySuggestionInput!]!1 to 10 suggestions.

Returns

CreateAgentMemorySuggestions

Example

mutation CreateAgentMemorySuggestions($domainUuid: UUID!, $run: AgentMemorySuggestionRunInput!, $suggestions: [AgentMemorySuggestionInput!]!) {
  createAgentMemorySuggestions(domainUuid: $domainUuid, run: $run, suggestions: $suggestions) {
    suggestions {
      id
      domainUuid
      level
      assetMcon
      agentType
      suggestionText
      source
      suggestionEvidence
      evidenceTool
      runAgentId
      runThreadId
      runTraceId
      status
      statusReason
      createdTime
    }
  }
}

Types used only by createAgentMemorySuggestions

AgentMemorySuggestionInput

Input object type.

FieldTypeDescription
levelAgentMemoryLevel!DOMAIN or ASSET. ACCOUNT is refused.
assetMconStringMCON of an asset in the domain. Required at the asset level; omit otherwise.
agentTypeAiAgentType!
suggestionTextString!At most 300 characters.
sourceAgentMemorySuggestionSource!
suggestionEvidenceString!A short quote or fact from the run. At most 500 characters.
evidenceToolStringTool the evidence came from. At most 256 characters.
AgentMemorySuggestionRunInput

Input object type. The run that wrote the suggestions. Fill it from the run, not from model output.

FieldTypeDescription
agentIdString!Agent (graph) of the run. At most 256 characters.
threadIdStringThread of the run. At most 256 characters.
traceIdStringTrace of the run. At most 256 characters.
CreateAgentMemorySuggestions

Object type. Save a run's memory suggestions for one domain. All of them are saved, or none.

FieldTypeDescription
suggestions[AgentMemorySuggestion!]!

Related types

AgentMemoryLevel, AgentMemorySuggestion, AgentMemorySuggestionSource, AiAgentType, UUID

createMemoryCuration (mutation)

createMemoryCuration 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

Write tonight's memory curation for one domain. Only the run of the domain's memory curation task may call it, as an agent limited to the domain. Call it every night the run starts, with no items when nothing is worth posting, so the suggestions it does not use are skipped. A curation with fewer than 3 numbered items is not posted, and the suggestions its items cover wait for the next night. Fails with MEMORY_CURATION_NOT_RUNNING_TASK, MEMORY_CURATION_INVALID_ITEM, MEMORY_CURATION_SUGGESTION_NOT_WAITING or MEMORY_CURATION_EXISTS.

Arguments

ArgumentTypeDescription
domainUuidUUID!
items[MemoryCurationItemInput!]!At most 7. Items are numbered in this order; conflicts get no number.
scheduledTaskIdUUID!The curation task whose run makes the call.
skippedSuggestions[SkippedMemorySuggestionInput!]Suggestions the curation does not use, with the reason. Waiting suggestions from before the run that no item covers and this list leaves out are skipped too.

Returns

CreateMemoryCuration

Example

mutation CreateMemoryCuration($domainUuid: UUID!, $items: [MemoryCurationItemInput!]!, $scheduledTaskId: UUID!) {
  createMemoryCuration(domainUuid: $domainUuid, items: $items, scheduledTaskId: $scheduledTaskId) {
    curation {
      id
      domainUuid
      curationDate
      skippedSuggestionCount
    }
  }
}

Types used only by createMemoryCuration

CreateMemoryCuration

Object type. Write tonight's memory curation for a domain, from the run of its curation task.

FieldTypeDescription
curationMemoryCuration!
MemoryCuration

Object type.

FieldTypeDescription
idUUID!
domainUuidUUID!
curationDateDate!UTC date the curation is for.
skippedSuggestionCountInt!
items[MemoryCurationItem!]!
MemoryCurationItemInput

Input object type.

FieldTypeDescription
kindMemoryCurationItemKind!
agentTypeAiAgentType!The agents the item is for. USE_CASES is refused.
levelAgentMemoryLevel!DOMAIN or ASSET. ACCOUNT is refused.
assetMconStringMCON of an asset in the domain. Required at the asset level; omit otherwise.
itemTextStringThe memory to save, or the conflict. Omit for REMOVE. At most 300 characters.
itemReasonString!A short evidence line shown under the item in the post, such as "10 runs agree". At most 300 characters.
memoryIds[UUID!]Memories the item changes: none for NEW and CONTEXT_CONFLICT, 1 for EDIT and REMOVE, 1 or more for MERGE.
suggestionIds[UUID!]!The waiting suggestions the item covers. At least 1, except for a MERGE or REMOVE from the weekly sweep while the account has it.
SkippedMemorySuggestionInput

Input object type.

FieldTypeDescription
suggestionIdUUID!
suggestionSkipReasonString!Why the curation does not use it. At most 300.

Related types

AgentMemoryLevel, AiAgentType, Date, MemoryCurationItem, MemoryCurationItemKind, UUID

deleteAgentMemory (mutation)

deleteAgentMemory 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

Delete an AI agent memory

Arguments

ArgumentTypeDescription
memoryIdUUID!

Returns

DeleteAgentMemory

Example

mutation DeleteAgentMemory($memoryId: UUID!) {
  deleteAgentMemory(memoryId: $memoryId) {
    success
  }
}

Types used only by deleteAgentMemory

DeleteAgentMemory

Object type. Delete a memory permanently.

FieldTypeDescription
successBoolean!

Related types

UUID

replaceAgentMemory (mutation)

replaceAgentMemory 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

Replace an AI agent memory

Arguments

ArgumentTypeDescription
memoryIdUUID!Memory to replace.
memoryTextString!Saved as one line: line breaks and other non-printable characters become spaces, and repeated spaces collapse. At most 300 characters after that.

Returns

ReplaceAgentMemory

Example

mutation ReplaceAgentMemory($memoryId: UUID!, $memoryText: String!) {
  replaceAgentMemory(memoryId: $memoryId, memoryText: $memoryText) {
    memory {
      id
      level
      domainUuid
      assetMcon
      agentType
      memoryText
      createdBy
      authorName
      createdTime
      creationSource
      creationClient
      assetMissing
    }
  }
}

Types used only by replaceAgentMemory

ReplaceAgentMemory

Object type. Replace the text of a memory. The level, domain, asset and agent type stay.

The new memory records where this write came from.

FieldTypeDescription
memoryAgentMemory!The new memory. It has a new id.

Related types

AgentMemory, UUID

Source: The GraphQL API reference

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