AI agent configuration (GraphQL)

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

Queries

getAgentContext (query)

getAgentContext 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

Resolve the persisted customer context an agent should honor, composed across the requested agent types and domains. Requested domains are narrowed to the caller's ai-agents/access grant; account-level context is served to any principal authorized to query the account, which is a deliberate product decision and differs from getAiAgentConfig's gate on the same rows.

Arguments

ArgumentTypeDescription
agentTypes[String!]Declaring agent's types; GENERAL context is always included whether or not it is listed. Unrecognized values are ignored and echoed.
domainIds[String!]Metadata domains to compose with the account default. Values the caller has no grant for, that are malformed, or that exceed the server cap are dropped and echoed.
includeAttributionBooleanAdd "(Last updated by <name> on <YYYY-MM-DD>)" to each section, naming who last saved it: a person's name, a teammate, Bayes, Monte Carlo, or a former user, never an email address. Sections with no recorded editor get no line. Bracketed lines shaped like it are removed from the notes. Default: false.

Returns

AgentContext!

Example

query GetAgentContext {
  getAgentContext {
    context
    agentTypes
    domainIds
    ignoredAgentTypes
    ignoredDomainIds
    truncatedLabels
    omittedLabels
  }
}

Types used only by getAgentContext

AgentAssetMemories

Object type. The asset memories an agent loads with its saved context.

FieldTypeDescription
items[AgentMemory!]!Asset memories of the requested MCONs, filtered by the requested domains and agent types (GENERAL always), by created time.
ignoredMcons[String!]!Requested MCONs dropped as malformed or over the server cap.
AgentContext

Object type. A composed persisted context and memories, plus what the request could not honor.

The agent renders context and loads memories / assetMemories. It
does not need to know how many scopes or agent types produced them. The echoes
and label lists are reporting: the echoes say what was dropped, and the label
lists say what did not fit, so "this scope has no context" stays
distinguishable from "this scope was cut".

These field names are a cross-repo wire contract. graphene auto-camelCases
them. ai-agent's _warn_on_agent_context_echoes reads
ignoredAgentTypes / ignoredDomainIds / truncatedLabels /
omittedLabels verbatim. The stage-3 loader reads memories,
assetMemories, ignoredMcons, items and the AgentMemory item
fields level, domainUuid, assetMcon, agentType, memoryText,
authorName and createdTime verbatim. Renaming one looks safe here, because
no monolith code reads them, but it silently empties the client's data forever
and disables the only drift signal this feature has. GetAgentContextTest is
the pin; the mirror convention is the same one on AiAgentType.

FieldTypeDescription
contextString!The composed context, or "" when the account has configured nothing. Each requested agent type and domain with persisted text becomes its own labeled section; a single-scope request comes back unlabeled. With includeAttribution, each section with a recorded editor also carries one line, "(Last updated by <name> on <YYYY-MM-DD>)", naming who last saved it.
agentTypes[String!]!Agent types honored, GENERAL first — it is always included.
domainIds[String!]!Domains the request was resolved against. A domain listed here with no section is one the caller holds no grant for, or one with nothing configured — this list narrows scope, it never grants it.
ignoredAgentTypes[String!]!Requested agent types this deployment does not recognize.
ignoredDomainIds[String!]!Requested domain ids dropped as malformed or over the server cap.
truncatedLabels[String!]!Sections cut to fit the server budget.
omittedLabels[String!]!Sections dropped entirely because they could not fit meaningfully.
memories[AgentMemory!](experimental) Domain memories people asked the agents to remember, for the requested domains and agent types (GENERAL always), by created time. Requested domains are narrowed to the caller's ai-agents/memories/access grant.
assetMemoriesAgentAssetMemories(experimental) Asset memories of the given assets, filtered by the requested domains and agent types (GENERAL always), by created time. Requested domains are narrowed to the caller's ai-agents/memories/access grant.

Related types

AgentMemory

getAiAgentConfig (query)

getAiAgentConfig 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

Get AI agent configuration for the account, or for a single domain when domainUuid is supplied

Arguments

ArgumentTypeDescription
agentTypeAiAgentType!Type of AI agent to retrieve configuration for
domainUuidUUIDReturn the configuration saved for this domain (exact scope — no fallback to the account default, so callers can distinguish a domain-configured value from an inherited one). Omit for the account-level configuration.

Returns

AiAgent

Example

query GetAiAgentConfig($agentType: AiAgentType!) {
  getAiAgentConfig(agentType: $agentType) {
    createdTime
    updatedTime
    agentType
    contextPrompt
    scope
    domainUuid
  }
}

Related types

AiAgent, AiAgentType, UUID

getAiAgentConfigs (query)

getAiAgentConfigs 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

Get saved AI agent configurations for several agent types across the account and several domains in one request. Returns one entry per saved (agent type, scope) pair; a pair with nothing saved is omitted. Scopes are exact, as in getAiAgentConfig: a domain entry never falls back to the account default.

Arguments

ArgumentTypeDescription
agentTypes[AiAgentType!]Agent types to read. Omit or pass null for every type.
domainUuids[UUID!]Domains to read, at most 50. The caller must have access to every one, or the whole query is refused.
includeAccountBooleantrue (default) or null: also return the account-level configurations. false: return domain configurations only. Default: true.

Returns

[AiAgent!]!

Example

query GetAiAgentConfigs {
  getAiAgentConfigs {
    createdTime
    updatedTime
    agentType
    contextPrompt
    scope
    domainUuid
  }
}

Related types

AiAgent, AiAgentType, UUID

getAuthorizationPrompt (query)

getAuthorizationPrompt 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

Build a system prompt grounded in the caller's account authorization state (roles, authorization groups, and the target user's resolved permissions). Requires read access to users, roles, and authorization groups.

Arguments

ArgumentTypeDescription
forUserUUID!UUID of the user whose authorization context the prompt should reflect. Must belong to the caller's account.

Returns

String

Example

query GetAuthorizationPrompt($forUser: UUID!) {
  getAuthorizationPrompt(forUser: $forUser)
}

Related types

UUID

Mutations

configureAiAgentPrompt (mutation)

configureAiAgentPrompt 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

Configure the context prompt for an AI agent

Arguments

ArgumentTypeDescription
agentTypeAiAgentType!Type of AI agent to configure
contextPromptStringCustom context prompt for the agent. Pass null to clear.
domainUuidUUIDDomain to scope the prompt to. When set, configures per-domain context that is composed additively with the account default for runs against that domain; passing a null or empty prompt deletes the domain row so only the account default remains. When omitted, configures the account-level default.

Returns

ConfigureAiAgentPrompt

Example

mutation ConfigureAiAgentPrompt($agentType: AiAgentType!) {
  configureAiAgentPrompt(agentType: $agentType) {
    success
  }
}

Types used only by configureAiAgentPrompt

ConfigureAiAgentPrompt

Object type. Configure or update the context prompt for an AI agent type

FieldTypeDescription
aiAgentAiAgentThe configured AI agent; null when a domain-scoped prompt was cleared
successBoolean!Whether the operation succeeded

Related types

AiAgent, AiAgentType, UUID

Source: The GraphQL API reference

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