Skip to content

GraphQL API

Generated file

This page is generated from the GraphQL SDL in hadron-server/src/api/graphql/schema/typeDefs.ts. To refresh it, run npm run docs:graphql from the root of this repo.

Convention: ID or URN

Across the GraphQL API, fields that take an entity reference (memoryId, agentId, appId, orgId, or id on an entity-keyed op) accept either the entity's database ID or its URN. URNs may be passed bare (e.g. acme:family-mealplan) or with the optional canonical hrn:<type>: prefix (e.g. hrn:memory:acme::family-mealplan); the legacy urn:<type>: prefix is also accepted on input. All shapes resolve to the same entity, with identical authorization and behavior. The closing line of every in-scope field's description — "Accepts the entity's ID or URN." — calls out which fields participate.

# These two queries are equivalent:
query { memory(id: "cm5x...kqp") { name } }
query { memory(id: "acme:family-mealplan") { name } }

GraphQL API Reference

Table of Contents * [Query](#query) * [Mutation](#mutation) * [Objects](#objects) * [AddMemoryMemberPayload](#addmemorymemberpayload) * [Agent](#agent) * [AgentAIConfig](#agentaiconfig) * [AgentImport](#agentimport) * [AgentMemoryItem](#agentmemoryitem) * [AgentOrgGrant](#agentorggrant) * [AgentSubscription](#agentsubscription) * [AiServiceConfig](#aiserviceconfig) * [App](#app) * [AppAIConfig](#appaiconfig) * [AppAgent](#appagent) * [AppCreated](#appcreated) * [AppKey](#appkey) * [AppKeyCreated](#appkeycreated) * [AppMember](#appmember) * [Asset](#asset) * [AssetDownloadUrl](#assetdownloadurl) * [AssetListResult](#assetlistresult) * [AssetPutHeader](#assetputheader) * [BeginAssetUploadResult](#beginassetuploadresult) * [Chat](#chat) * [ChatMessage](#chatmessage) * [ChatPromptResult](#chatpromptresult) * [ChatResponseResult](#chatresponseresult) * [ChatStartResult](#chatstartresult) * [CreateMemorySharePayload](#creatememorysharepayload) * [Edge](#edge) * [EditorLockResult](#editorlockresult) * [ExchangeConnection](#exchangeconnection) * [ExchangeFolder](#exchangefolder) * [ExchangeMessage](#exchangemessage) * [InstallAgentIntoAppPayload](#installagentintoapppayload) * [InstallationPolicy](#installationpolicy) * [JoinAppPayload](#joinapppayload) * [LeaveAppPayload](#leaveapppayload) * [Memory](#memory) * [MemoryMember](#memorymember) * [MemoryProvisioning](#memoryprovisioning) * [MemoryShare](#memoryshare) * [MemorySubscription](#memorysubscription) * [Node](#node) * [NodeSearchResult](#nodesearchresult) * [NodeVersion](#nodeversion) * [OrgMember](#orgmember) * [Organization](#organization) * [Passage](#passage) * [RemoveMemoryMemberPayload](#removememorymemberpayload) * [ResolvedAiConfig](#resolvedaiconfig) * [RevisionResult](#revisionresult) * [RevokeMemorySharePayload](#revokememorysharepayload) * [Session](#session) * [SummarizationRequest](#summarizationrequest) * [UninstallAgentFromAppPayload](#uninstallagentfromapppayload) * [UpdateMemoryMemberRolePayload](#updatememorymemberrolepayload) * [UpdateMemoryShareRolePayload](#updatememorysharerolepayload) * [UrnResolution](#urnresolution) * [UsageEvent](#usageevent) * [UsageSummaryEntry](#usagesummaryentry) * [User](#user) * [UserApiKey](#userapikey) * [UserApiKeyCreateResult](#userapikeycreateresult) * [UserInvitation](#userinvitation) * [Inputs](#inputs) * [BeginAssetUploadInput](#beginassetuploadinput) * [BeginAssetUploadV2Input](#beginassetuploadv2input) * [CompleteAssetUploadInput](#completeassetuploadinput) * [EdgeInput](#edgeinput) * [NodeEdgeInput](#nodeedgeinput) * [NodeInput](#nodeinput) * [SessionInput](#sessioninput) * [SetAgentAssetUploadEnabledInput](#setagentassetuploadenabledinput) * [UsageEventInput](#usageeventinput) * [Enums](#enums) * [AgentType](#agenttype) * [AgentVisibility](#agentvisibility) * [AiConfigOwnerType](#aiconfigownertype) * [AppMembershipRole](#appmembershiprole) * [AppMemoryKind](#appmemorykind) * [AppType](#apptype) * [AssetScanStatus](#assetscanstatus) * [ChatScope](#chatscope) * [CreateUserPermission](#createuserpermission) * [EmbeddingSource](#embeddingsource) * [IdentifyUserMethod](#identifyusermethod) * [MemoryClass](#memoryclass) * [MemoryMemberRole](#memorymemberrole) * [MemoryShareRole](#memorysharerole) * [MemoryVisibility](#memoryvisibility) * [Role](#role) * [SearchGranularity](#searchgranularity) * [SearchMode](#searchmode) * [SubscriptionType](#subscriptiontype) * [SyncStatus](#syncstatus) * [UploadIntent](#uploadintent) * [Scalars](#scalars) * [Boolean](#boolean) * [Float](#float) * [ID](#id) * [Int](#int) * [JSON](#json) * [String](#string)

Query

Field Argument Type Description
resolveUrn UrnResolution Resolve a fully-qualified, \`hrn::\`-prefixed Hadron URN (legacy \`urn:\` scheme also accepted) to the ids needed to reach its canonical page. Returns null when the URN is unresolvable (not found) OR the caller lacks access. Unlike the dedicated per-kind queries — which throw \`Forbidden\` on no-access — this query deliberately collapses both not-found and no-access to null, so a redirect resolver can 404 uniformly without disclosing which case it was. Per-kind access uses the SAME authorization rules as the dedicated queries (memory/org/agent: org membership; app: org ADMIN; node: memoryAccessFilter), only with the throw replaced by a null return. The \`hrn::\` prefix (legacy \`urn::\` also accepted) is the dispatch key — bare URNs without a type prefix are ambiguous across kinds (\`org::slug\` could be a memory or an agent) and resolve to null.
urn String!
node Node
loc String!
raw Boolean
nodeById Node
id ID!
raw Boolean
nodes [Node!]!
memory ID Scope to a single memory, addressed by ID or fully-qualified URN (007-entity-id-or-urn dispatch via resolveMemoryRef). Intersected with the caller's access filter — scoping to an inaccessible memory yields [], and an unknown ref throws NOT_FOUND. Added for the hadron-cli \`node ls --memory\` surface; mirrors the usageEvents(memoryId:) filter (#249).
nodeType String
tags [String!]
search String
prefix String
limit Int
offset Int
nodeSearch NodeSearchResult! Vector/hybrid-aware search over a memory. Keyword-only callers should keep using the legacy 'nodes' query — nodeSearch is the vector-aware entrypoint per spec 033 contract. mode defaults to vector (the vector-aware entrypoint design — the MCP h-find-nodes tool defaults to keyword for backward-compat, a deliberate divergence between the two surfaces). expand (graph neighbor depth 0..3, default 0) and granularity:chunk (passage retrieval, vector-mode only) are both fully live. Access control: same memory-read gate as the keyword nodes query — the raw-SQL similarity query is scoped to memories the caller can read, never cross-memory.
query String!
memoryUrn String
mode SearchMode
expand Int
granularity SearchGranularity
limit Int
subtree [Node!]!
prefix String!
nodeUsage [UsageEvent!]!
loc String!
limit Int
usageEvents [UsageEvent!]!
type String
memoryId ID
nodeId ID
limit Int
offset Int
nodeVersions [NodeVersion!]!
nodeId ID!
limit Int
memoryUsageSummary [UsageSummaryEntry!]! Aggregated usage counts per node and type for a memory. Accepts the entity's ID or URN.
memoryId ID!
sessions [Session!]!
type String
repo String
customerId String
limit Int
offset Int
session Session
id ID!
users [User!]!
searchUsers [User!]!
query String!
me User
organizations [Organization!]!
myOrganizations [Organization!]!
organization Organization Fetch an Organization by id (org member or platform ADMIN). Accepts the entity's ID or URN.
id ID!
invitation UserInvitation
slug String!
publicMemories [Memory!]!
memory Memory Fetch a single Memory (org member or platform ADMIN). Accepts the entity's ID or URN.
id ID!
orgSystemMemories [Memory!]! System memories belonging to an org (org member or platform ADMIN). Accepts the entity's ID or URN.
orgId ID!
myMemories [Memory!]!
includeAgentSystem Boolean
exchangeConnections [ExchangeConnection!]! Exchange connections for an org. Accepts the entity's ID or URN.
orgId ID!
exchangeMessages [ExchangeMessage!]!
connectionId ID!
top Int
filter String
exchangeFolders [ExchangeFolder!]!
connectionId ID!
apps [App!]! Apps in an organization (org ADMIN). Accepts the entity's ID or URN.
orgId ID!
app App Fetch an App. Accepts the entity's ID or URN.
id ID!
myApp App
myApps [App!]!
myAgentSubscriptions [AgentSubscription!]!
agentSubscriptions [AgentSubscription!]! 005-agent-subscription FR-022: list all AgentSubscriptions for an Agent. Authorized for ADMIN/OWNER of the Agent's owning org. Accepts the entity's ID or URN.
agentId ID!
appNodes [Node!]! All nodes accessible by an App (across all subscribed memories). Accepts the entity's ID or URN.
appId ID!
limit Int
appAIConfig AppAIConfig Decrypted AI config for an App (org ADMIN of the App's org). Accepts the entity's ID or URN.
appId ID!
appKeys [AppKey!]! List keys for an App (org ADMIN of the App's org). Accepts the entity's ID or URN.
appId ID!
myUserApiKeys [UserApiKey!]! 025-oauth-for-mcp FR-004: list the calling User's API keys (active + revoked, createdAt DESC). Powers Phase 3's portal revocation UI (SC-006). Rejected with UNAUTHENTICATED for AppKey-resolved callers (no user in context). PR-137 review delta D5 — Query not present in PR 137.
agentAIConfig AgentAIConfig Agent AI config (org ADMIN) — returns the decrypted API key so the portal backend can make LLM calls on behalf of the user. 036-ai-service-config: registry-backed (the Agent's config named 'default'). Prefer resolveAIConfig for new callers. Accepts the entity's ID or URN.
agentId ID!
aiServiceConfigs [AiServiceConfig!]! 036-ai-service-config: masked list of the AI configs owned by one entity. Never returns key material — only hasApiKey + apiKeyPreview. Auth: platform ADMIN/OWNER for HADRON_SERVER owners; org ADMIN of the owning org for ORGANIZATION / APP / AGENT owners. ownerId accepts the entity's ID or URN (HADRON_SERVER: ID only).
ownerType AiConfigOwnerType!
ownerId ID!
resolveAIConfig ResolvedAiConfig! 036-ai-service-config: resolve a config name for an execution context and return the DECRYPTED credentials (privileged; successor to agentAIConfig/appAIConfig). Walk: App -> Agent -> Org (of the App, else of the Agent) -> HadronServer; disabled configs are skipped. When name is omitted, 'default' is resolved. When an explicit name misses, resolution falls back to 'default'; if that also misses, errors with NoAiConfigAvailableError. Consumers (webhooks, scheduled tasks, the portal chatbot) reference configs by name only — pass the name plus the execution context, never credentials. Auth: org ADMIN of the effective context org, or platform ADMIN/OWNER (required when no app/agent context is given). appId/agentId accept the entity's ID or URN.
name String
appId ID
agentId ID
resolveAiServiceConfigs [AiServiceConfig!]! 036-ai-service-config: the MASKED set of configs RESOLVABLE in an execution context — every distinct config name a chat in this context could select. Populates a config picker in the chatbot UI. Same walk as resolveAIConfig (App -> Agent -> Org (of the App, else of the Agent) -> HadronServer), but returns ALL names instead of resolving one: configs are deduped by name with the innermost owner winning, so each entry is the row resolveAIConfig would return for that name. Only the Agent named here contributes — sibling Agents installed in the same App are not consulted. Disabled configs are skipped. Never returns key material (hasApiKey + apiKeyPreview only). Auth: scoped to one App's chat context. A non-admin caller MUST pass an appId, be a member of that App, and (when an agentId is given) the Agent must be installed in that App. Because the result is masked (no key material), App membership — not org admin — is the bar, unlike resolveAIConfig and the aiServiceConfigs management list. Platform ADMIN/OWNER are always allowed and may omit appId. appId/agentId accept the entity's ID or URN.
appId ID
agentId ID
myChats [Chat!]! Saved chats for the current user in their personal memory for an agent. Newest first. Accepts the entity's ID or URN.
agentId ID!
limit Int
offset Int
chatHistory [ChatMessage!]!
chatId String!
limit Int
agentAssets AssetListResult!
agentUrn String!
mimeType String
skip Int
count Int
includeDeleted Boolean
memoryAssets AssetListResult! v2 (spec 006) — memory-addressed listing. Returns assets for a specific memory; caller must have read access. The replacement for agentAssets in the v2 surface. Accepts the entity's ID or URN.
memoryId ID!
mimeType String
skip Int
count Int
includeDeleted Boolean
assetDownloadUrl AssetDownloadUrl!
assetId ID!
ttlSeconds Int

Mutation

Field Argument Type Description
upsertNode Node!
input NodeInput!
deleteNode Boolean!
loc String!
memoryId String!
restoreNodeVersion Node!
versionId ID!
moveNode Node!
from String!
to String!
memoryId String!
targetMemoryId String
replaceSubtree Int!
ownerRepo String!
memoryId String!
nodes [NodeInput!]!
edges [EdgeInput!]!
createEdge Edge!
sourceNodeId ID!
targetNodeId ID!
label String!
condition JSON
priority Int
data JSON
updateEdge Edge!
edgeId ID!
label String
condition JSON
priority Int
data JSON
deleteEdge Boolean!
edgeId ID!
beginAssetUpload BeginAssetUploadResult!
input BeginAssetUploadInput!
completeAssetUpload Asset!
input CompleteAssetUploadInput!
setAgentAssetUploadEnabled App!
input SetAgentAssetUploadEnabledInput!
softDeleteAsset Asset!
assetId ID!
restoreAsset Asset!
assetId ID!
beginAssetUploadV2 BeginAssetUploadResult!
input BeginAssetUploadV2Input!
startSession Session!
input SessionInput!
endSession Session!
id ID!
summary String
inputTokens Int
outputTokens Int
turnCount Int
errorCount Int
recordUsage Boolean!
event UsageEventInput!
regenerateAppKey AppCreated! App key management — revoke all active keys for an App and mint a fresh one. (See createAppKey / revokeAppKey / deleteApp below.) Accepts the entity's ID or URN.
id ID!
updateMyProfile User!
name String
handle String
email String
updateUserRoles User!
userId ID!
roles [Role!]!
createOrganization Organization!
name String!
urn String!
updateOrganization Organization! Update an Organization. Accepts the entity's ID or URN.
id ID!
name String
urn String
isVisible Boolean
deleteOrganization Boolean! Soft-delete an Organization. Accepts the entity's ID or URN.
id ID!
linkGithubApp Organization! Link a GitHub App installation to an organization (org ADMIN or platform ADMIN). Accepts the entity's ID or URN.
orgId ID!
installationId Int!
updateOrgGithubApp Organization! Set GitHub App credentials for an organization (encrypted at rest). Accepts the entity's ID or URN.
orgId ID!
appId String!
privateKey String!
unlinkGithubApp Organization! Remove all GitHub App config from an organization. Accepts the entity's ID or URN.
orgId ID!
createUserInvitation UserInvitation! User invitations (org ADMIN or platform ADMIN). Accepts the entity's ID or URN.
orgId ID!
memberRole Role!
name String
email String
githubUsername String
maxActivations Int
expiresInDays Int
inviteUser UserInvitation!
name String
email String
githubUsername String
maxActivations Int
expiresInDays Int
acceptInvitation Boolean!
slug String!
addOrgMember OrgMember! Accepts the entity's ID or URN (orgId).
orgId ID!
userId ID!
role Role!
updateOrgMember OrgMember! Accepts the entity's ID or URN (orgId).
orgId ID!
userId ID!
role Role!
removeOrgMember Boolean! Accepts the entity's ID or URN (orgId).
orgId ID!
userId ID!
createMemory Memory! Create a memory in an organization. Accepts the entity's ID or URN for orgId. Defaults to knowledge-class with ORGANIZATION visibility. Pass memoryClass: group + visibility: GROUP for a group-class memory (023-app-shape US4; the caller is auto-added as the first owner), or memoryClass: personal | private for an owner-only memory the caller owns (spec 034 — free-standing, no app/agent; the caller must be a member of the org container). system- and app-class memories are NOT created here — they auto-provision via Agent.systemMemoryId / the App install path.
orgId ID!
name String!
shortDescription String
description String
tags [String!]
license String
category0 String
category1 String
category2 String
iconUrl String
heroUrl String
homeUrl String
source String
readBranch String
writeBranch String
visibility MemoryVisibility
memoryClass MemoryClass 'knowledge' (default), 'group', or the owner-only 'personal' / 'private' (spec 034). 'system' and 'app' are rejected — they auto-provision via different code paths.
updateMemory Memory! Update a Memory. Accepts the entity's ID or URN. Spec 033 FR-026: enabling \`vectorIndexEnabled\` on an \`isEncrypted\` memory requires \`acknowledgeVectorInversionRisk: true\` in the same call. Without the flag, an \`EncryptedVectorIndexNotAcknowledgedError\` is thrown carrying the full four-point disclosure on \`error.disclosure\` (single source of truth in \`FR_026_DISCLOSURE\` — see \`src/lib/entityRef/errors.ts\`). On a non-encrypted memory the flag is a no-op.
id ID!
name String
urn String
organizationId ID
shortDescription String
description String
tags [String!]
license String
category0 String
category1 String
category2 String
iconUrl String
heroUrl String
homeUrl String
source String
readBranch String
writeBranch String
visibility MemoryVisibility
vectorIndexEnabled Boolean
embeddingSource EmbeddingSource
acknowledgeVectorInversionRisk Boolean
chunkTokens Int
chunkOverlap Int
forceFixedSize Boolean
deleteMemory Boolean! Soft-delete a Memory. Accepts the entity's ID or URN.
id ID!
cloneMemory Memory! Clone a Memory into a new Memory (same org) named \`name\`. Accepts the source's ID or URN. Copies the Memory row plus all live Nodes, Edges, and PendingEdges; references to the source memory's URN inside node content/abstract (canonical and legacy spellings) are rewritten to the clone's URN. Vector-index config carries over and the clone's nodes are stamped for re-embedding. NOT copied: version history, subscriptions, shares, group members (the caller is bootstrapped as a group clone's first owner), sessions, licenses, log entries, assets, and git-sync config (the clone starts DB-only). Authorization mirrors deleteMemory: personal/private → owner only; knowledge/group → org ADMIN. system/app-class sources and encrypted memories are rejected.
id ID!
name String!
setMemorySourceToken Memory! Set encrypted source token for non-GitHub-App repos. Accepts the entity's ID or URN.
id ID!
token String!
expiresAt String
createAgent Agent! Create an Agent in an organization. Accepts the entity's ID or URN.
orgId ID!
name String!
description String
systemPrompt String
systemMemoryId String
visibility AgentVisibility
type AgentType
surfaces [String!]
updateAgent Agent! Update an Agent. Accepts the entity's ID or URN.
id ID!
name String
urn String
description String
systemPrompt String
systemMemoryId String
visibility AgentVisibility
type AgentType
surfaces [String!]
deleteAgent Boolean! Soft-delete an Agent. Accepts the entity's ID or URN.
id ID!
addMemoryToAgent Agent! Attach a Memory to an Agent. Accepts the entity's ID or URN.
agentId ID!
memoryId ID!
role String
updateAgentMemoryRole Agent! Update an Agent's role on an attached Memory. Accepts the entity's ID or URN.
agentId ID!
memoryId ID!
role String!
removeMemoryFromAgent Agent! Detach a Memory from an Agent. Accepts the entity's ID or URN.
agentId ID!
memoryId ID!
createMemorySubscription MemorySubscription! Create a cross-org Memory subscription. Accepts the entity's ID or URN.
memoryId ID!
orgId ID!
role Role!
updateMemorySubscription MemorySubscription! Update a cross-org Memory subscription. Accepts the entity's ID or URN.
memoryId ID!
orgId ID!
role Role!
deleteMemorySubscription Boolean! Delete a cross-org Memory subscription. Accepts the entity's ID or URN.
memoryId ID!
orgId ID!
syncMemory Memory! Trigger an on-demand sync for one memory (org ADMIN or CONTRIBUTOR). Accepts the entity's ID or URN.
id ID!
pushMemoryToGit Boolean! Push all nodes in a memory to its configured git repo. Accepts the entity's ID or URN.
id ID!
addToMyMemories Boolean! Add a public memory to the current user's personal workspace. Accepts the entity's ID or URN.
memoryId ID!
deleteExchangeConnection Boolean!
id ID!
testExchangeConnection Boolean!
id ID!
exchangeReply Boolean!
connectionId ID!
messageId ID!
body String!
exchangeMoveMessage Boolean!
connectionId ID!
messageId ID!
folderId String!
startChat ChatStartResult! Start a chat session (creates chat nodes, loads conversation, returns compiled prompt). When called by a JWT user, the chat is created in that user's personal memory for the agent (provisioned lazily if needed). Accepts the entity's ID or URN.
agentId ID!
userId String
conversationName String
scope ChatScope
isTestRun Boolean
sendChatMessage ChatPromptResult!
chatId String!
userMessage String!
processChatResponse ChatResponseResult!
chatId String!
toolResponse JSON!
saveChatSummary Boolean!
chatId String!
summary String!
updateChatTitle Boolean!
chatId String!
title String!
deleteChat Boolean!
chatId String!
updateAgentAIConfig Agent! Update an Agent's AI provider config. Key is encrypted at rest. 036-ai-service-config: upserts the Agent's registry config named 'default'. Prefer createAiServiceConfig/updateAiServiceConfig for new callers. Accepts the entity's ID or URN.
agentId ID!
provider String!
model String!
apiKey String
clearAgentAIConfig Agent! Clear an Agent's AI provider config. 036-ai-service-config: deletes the Agent's registry config named 'default'. Accepts the entity's ID or URN.
agentId ID!
createAiServiceConfig AiServiceConfig! 036-ai-service-config: create a named AI config on an owner entity. apiKey semantics: omitted = stored without a key (unusable for execution until one is set); non-empty = encrypted at rest with a masked preview. Name must be 1-64 lower-case [a-z0-9_-], unique per owner. provider must be a known provider; params are validated per provider. Auth: as aiServiceConfigs. ownerId accepts ID or URN (HADRON_SERVER: ID only).
ownerType AiConfigOwnerType!
ownerId ID!
name String!
provider String!
model String!
apiKey String
params JSON
enabled Boolean
updateAiServiceConfig AiServiceConfig! 036-ai-service-config: update a named AI config. All fields optional. apiKey semantics: omitted = keep the stored key; empty string = clear it; non-empty = replace (encrypted, preview recomputed). Auth: admin rights on the owning entity (as aiServiceConfigs).
id ID!
name String
provider String
model String
apiKey String
params JSON
enabled Boolean
deleteAiServiceConfig Boolean! 036-ai-service-config: delete a named AI config (hard delete; the resolution walk simply no longer finds it). Auth: admin rights on the owning entity (as aiServiceConfigs).
id ID!
createRevision RevisionResult! Snapshot an Agent's system memory as a new revision. Accepts the entity's ID or URN.
agentId ID!
description String
publishRevision RevisionResult! Publish a revision and pin the Agent to it. Accepts the entity's ID or URN.
agentId ID!
revisionLoc String!
versionLabel String
restoreRevision RevisionResult! Restore an Agent's system memory from a revision (auto-saves first). Accepts the entity's ID or URN.
agentId ID!
revisionLoc String!
acquireEditorLock EditorLockResult! Acquire (or renew) the editor lock for an Agent's system memory. Accepts the entity's ID or URN.
agentId ID!
releaseEditorLock Boolean! Release the editor lock for an Agent's system memory. Accepts the entity's ID or URN.
agentId ID!
joinWaitingList Boolean!
email String!
requestedFeatures String
sendContactMessage Boolean!
name String!
email String!
message String!
createApp App! Install an Agent into an organization, creating an App that deploys it. Auto-provisions an AgentOrgGrant for (orgId, agentId) on first install, and adds the caller as an AppMember with role 'owner'. Required AgentImports cascade automatically; optional imports cascade only when their id appears in installOptional. 009-install-agent-flow: the cross-org install restriction (FR-009) is enforced at the portal — the Install affordance is hidden for Agents not owned by the calling org. The server still auto-provisions grants on first install (preserved from 008); a hard server-side cross-org gate is reserved for the marketplace spec. Accepts the entity's ID or URN.
orgId ID!
agentId ID! The Agent this App deploys. Required as of 009-install-agent-flow: every App must reference an Agent. The server itself accepts any Agent the caller can resolve and auto-provisions an AgentOrgGrant (008 behavior preserved); the portal's install flow restricts the affordance to Agents owned by the caller org. A hard server-side cross-org gate is reserved for the marketplace spec.
name String!
urn String
appType AppType
role AppMembershipRole
description String
systemPrompt String
agentTools [String!]
aiProvider String
aiModel String
aiApiKey String
expiresAt String
surfaces [String!]
trainingMode Boolean
installOptional [ID!] 008-agent-installation: optional dep Agent ids to cascade-install. Required imports of the parent Agent always cascade; optional imports install only when their id appears here. Pass [] (or omit) to skip all optional deps. v1 accepts ID or URN.
createUserPermission CreateUserPermission
identifyUserMethod IdentifyUserMethod
sessionTimeoutSeconds Int
anonymousTtlDays Int
updateApp App! Update an App. Accepts the entity's ID or URN.
id ID!
name String
urn String
appType AppType
role AppMembershipRole
description String
systemPrompt String
agentTools [String!]
aiProvider String
aiModel String
aiApiKey String
expiresAt String
surfaces [String!]
trainingMode Boolean
createUserPermission CreateUserPermission
identifyUserMethod IdentifyUserMethod
sessionTimeoutSeconds Int
anonymousTtlDays Int
deleteApp Boolean! Soft-delete an App. Accepts the entity's ID or URN.
id ID!
installAgentIntoApp InstallAgentIntoAppPayload! Install an Agent into an App (023-app-shape US1). Creates an AppAgent row joining the two. An App can have multiple Agents installed; one credential addresses all of them. Rejects with code DUPLICATE_APP_AGENT when the Agent is already installed in the App. Accepts the entity's ID or URN for both appId and agentId. Optional trainingMode flag updates the per-App training flag (applies to every installed Agent — training mode is per-App, not per-Agent, per spec 023 FR-001).
appId ID!
agentId ID!
trainingMode Boolean
uninstallAgentFromApp UninstallAgentFromAppPayload! Uninstall an Agent from an App. Deletes the AppAgent row. The Agent's per-(App, Agent, *) memories are NOT cascade-deleted (spec 023 FR-005); they persist as orphans and become reachable again if the same Agent is later reinstalled. Idempotent — succeeds whether or not the AppAgent row exists. Accepts the entity's ID or URN.
appId ID!
agentId ID!
addAgentToApp ⚠️ App! DEPRECATED: use installAgentIntoApp. Carried for source-compat with pre-023 portal callers. Accepts the entity's ID or URN.

⚠️ DEPRECATED

Use installAgentIntoApp (spec 023-app-shape US1). Returns Payload type with the AppAgent row.
appId ID!
agentId ID!
trainingMode Boolean
removeAgentFromApp ⚠️ App! DEPRECATED: use uninstallAgentFromApp. Carried for source-compat with pre-023 portal callers. Accepts the entity's ID or URN.

⚠️ DEPRECATED

Use uninstallAgentFromApp (spec 023-app-shape US1).
appId ID!
agentId ID!
ensureAppMember AppMember! Idempotent UPSERT of an AppMember row. Per spec 008-agent-installation FR-004 / FR-016. The role MUST be a value present in the parent Agent's installationPolicy.memberRoles. Creating a new member is rejected if the App's current member count meets or exceeds the Agent's installationPolicy.maxMembers. Updating an existing member's role does NOT trigger the maxMembers check. Accepts the entity's ID or URN.
appId ID!
userId ID!
role String!
removeAppMember Boolean! Delete an AppMember row. Idempotent (no-op when the row doesn't exist). Personal-class memory at (appId, userId) is retained as an orphan per FR-015 — re-attaches automatically if the user later rejoins the same App. Accepts the entity's ID or URN.
appId ID!
userId ID!
joinApp JoinAppPayload! 023-app-shape US2 — user-level install. The currently-logged-in user joins the App as an AppMember. NO OrgMember check (spec 023 FR-009) so this works for B2C / consumer / therapy use cases where the end-user is not in the App's operator org. Role defaults to the first value in the Agent's installationPolicy.memberRoles (the conventional "guest" or "owner" slot). Idempotent — if the user is already an AppMember of the App, the existing row is returned. Error codes (GraphQLError extensions.code, Error.name style): - UNAUTHENTICATED — no logged-in user in context. - AppNotFoundError — the App does not exist or is soft-deleted. - AppUninstalledError — the App is in the spec-021 soft-uninstall lifecycle phase. - OrphanAppError — the App has no installed Agents (so there's no Agent.installationPolicy to consult). - NoMemberRolesError — the primary Agent's installation_policy.memberRoles is empty, so joinApp can't pick a default role. - MaxMembersExceededError — the Agent's maxMembers limit is hit. - InvalidRoleError — the picked default role isn't accepted by the Agent's policy (rare; would indicate a policy update race). Accepts the entity's ID or URN.
appId ID!
leaveApp LeaveAppPayload! 023-app-shape US2 — user-level uninstall. The currently-logged-in user leaves an App. Idempotent (no-op when not a member). The user's personal-class Memory at (appId, userId) is NOT cascade-deleted per spec 008 FR-015 — it re-attaches if the user later re-joins. Accepts the entity's ID or URN.
appId ID!
createMemoryShare CreateMemorySharePayload! 023-app-shape US3 — asymmetric cross-user grant on a personal-class Memory. The principal (memory.userId) grants a grantee read or write access. Used for the per-pairing pattern (Alice's paired-with-Mentor-A memory is distinct from her paired-with-Mentor-B memory; each gets its own MemoryShare). Upsert semantics: re-calling with a different role on an existing (memoryId, granteeId) pair updates the role rather than throwing. For v1 the caller MUST be the principal themselves (memory.userId === ctx.userId). The Agent-mediated path (App backend acting on the principal's behalf via MCP) is supported by the access-control predicate but not by this GraphQL surface — see the deferred policy discussion linked from joinApp.ts. Error codes (extensions.code, Error.name style): - UNAUTHENTICATED — no logged-in user in context. - FORBIDDEN — caller is not the Memory's principal. The caller-authority guard runs first and deliberately does not differentiate between "memory doesn't exist", "memory is not personal-class", and "caller isn't the principal" — all three return FORBIDDEN so memory metadata isn't leaked to non-principals. - MemoryShareGranteeMissingError — granteeId doesn't resolve to an existing User. Only reachable when the caller passes the principal guard. - InvalidMemoryClassForShareError / MemoryNotFoundForShareError — defined on the controller for completeness; functionally unreachable via this GraphQL mutation in v1 because the caller-authority guard short-circuits to FORBIDDEN first.
memoryId ID!
granteeId ID!
role MemoryShareRole!
revokeMemoryShare RevokeMemorySharePayload! 023-app-shape US3 — revoke a MemoryShare. Per FR-022, revocation takes effect on the next read (there's no "deactivated" state; just a row delete). Idempotent. Caller-authority rule matches createMemoryShare.
memoryId ID!
granteeId ID!
updateMemoryShareRole UpdateMemoryShareRolePayload! 023-app-shape US3 — change the role on an existing MemoryShare. Throws MemoryShareNotFoundError if the (memoryId, granteeId) row doesn't exist — use createMemoryShare to upsert. Caller-authority rule matches createMemoryShare.
memoryId ID!
granteeId ID!
role MemoryShareRole!
addMemoryMember AddMemoryMemberPayload! 023-app-shape US4 — add a team member to a group-class Memory. Idempotent on the (memoryId, userId) PK: re-calling with a different role upserts the role. The caller MUST be an owner of the Memory (role = owner). The bootstrap case is handled by createMemory itself, which adds the creator as the first owner of a newly-created group memory. Error codes (extensions.code, Error.name style): - UNAUTHENTICATED — no logged-in user in context. - FORBIDDEN — caller is not an owner of the memory. (Uniform for missing-memory / wrong-class / not-an-owner cases, by the same don't-leak-metadata rule as MemoryShare mutations.) - InvalidMemoryClassForMemberError — memory is not group-class (only reachable from non-GraphQL callers in v1 — the caller-authority guard short-circuits to FORBIDDEN first). - MemoryMemberUserMissingError — the userId doesn't resolve. - LastOwnerProtectedError (FR-038) — reachable via the idempotent upsert path when the call would demote an existing sole owner to reader/writer.
memoryId ID!
userId ID!
role MemoryMemberRole!
updateMemoryMemberRole UpdateMemoryMemberRolePayload! 023-app-shape US4 — change the role on an existing team member. Throws MemoryMemberNotFoundError when the row doesn't exist; use addMemoryMember to upsert. Throws LastOwnerProtectedError (FR-038) when demoting the sole remaining owner. Caller-authority rule matches addMemoryMember. Error codes (extensions.code, Error.name style): - UNAUTHENTICATED — no logged-in user in context. - FORBIDDEN — caller is not an owner of a live group memory. - MemoryNotFoundForMemberError — memory absent or soft-deleted (only reachable from non-GraphQL callers in v1 — the guard short-circuits to FORBIDDEN first). - InvalidMemoryClassForMemberError — memory is not group-class (same; guard short-circuits to FORBIDDEN first). - MemoryMemberNotFoundError — no row at (memoryId, userId). - LastOwnerProtectedError (FR-038) — would demote the sole owner.
memoryId ID!
userId ID!
role MemoryMemberRole!
removeMemoryMember RemoveMemoryMemberPayload! 023-app-shape US4 — remove a team member. Idempotent. Removing the LAST owner is rejected with LastOwnerProtectedError (FR-038) — group memories must always have ≥1 owner; the path to fully empty one is to delete the Memory. Removing the last non-owner does NOT delete the Memory (FR-031); the row persists with its remaining owner(s). Caller-authority: either an owner of the Memory, or the member being removed (self-removal).
memoryId ID!
userId ID!
publishAgentImport AgentImport! Publish a dependency edge from a parent Agent to an imported Agent (008-agent-installation FR-005). v1 supports 1-level imports only: the imported Agent must not itself be a parent of any other import. Authorization: ADMIN/OWNER of the parent Agent's owning org. The parent's owning org MUST hold an active AgentOrgGrant for the imported Agent — bundling requires the same kind of license that installation does. Accepts the entity's ID or URN for both Agent ids.
parentAgentId ID!
importedAgentId ID!
position Int!
required Boolean
removeAgentImport Boolean! Delete a dependency edge between two Agents. Idempotent (no-op when the row doesn't exist). Apps that already installed the imported Agent are unaffected; removing the import only stops *future* parent installs from cascading the dep. Accepts the entity's ID or URN.
parentAgentId ID!
importedAgentId ID!
createAppKey AppKeyCreated! Mint a new AppKey for an App. Accepts the entity's ID or URN.
appId ID!
label String
revokeAppKey Boolean!
id ID!
createUserApiKey UserApiKeyCreateResult! 025-oauth-for-mcp FR-004: mint a new user-scoped API key for the calling User. Returns the raw key exactly once (the server stores only the SHA-256 hash). Rejected with UNAUTHENTICATED for AppKey- resolved callers (no user in context). Per Clarifications, label is optional (portal defaults to a placeholder when omitted).
label String
revokeUserApiKey UserApiKey! 025-oauth-for-mcp FR-004: revoke a user-scoped API key owned by the calling User. Returns the updated UserApiKey so the portal can render the new revokedAt without a refetch (PR-137 review delta D3 — was Boolean). Idempotent for already-revoked keys; rejected with FORBIDDEN if the key belongs to another user; NOT_FOUND if id does not exist; UNAUTHENTICATED for AppKey- resolved callers.
id ID!
revokeAgentSubscription AgentSubscription! 005-agent-subscription FR-023 + FR-028 + FR-029: revoke a user's AgentSubscription. Authorized for ADMIN/OWNER of the Agent's owning org. Side effect: empty personal Memory of (user, agent) is hard- deleted; non-empty is retained with userMemoryOfAgentId preserved. Accepts the entity's ID or URN (agentId).
userId ID!
agentId ID!
createAppUser User!
externalId String!
handle String
name String
email String
startAgentSession Session!
agentId ID!
externalUserId String
sessionTimeoutSeconds Int
dataKey String
endAgentSession Boolean!
sessionId ID!
linkMemoryToUser Memory! Link an anonymous memory to a real user (converts session memory ownership). Providing dataKey encrypts the memory in place atomically with the link. Accepts the entity's ID or URN.
memoryId ID!
externalUserId String!
dataKey String
encryptMemory Memory! Convert an existing plaintext memory to an encrypted one. The caller provides the data key; all existing node content/data is re-written as ciphertext in a single transaction. Accepts the entity's ID or URN.
memoryId ID!
dataKey String!

Objects

AddMemoryMemberPayload

Field Argument Type Description
memoryMember MemoryMember!

Agent

Field Argument Type Description
id ID!
organizationId String!
urn String!
name String!
description String
systemPrompt String
systemMemoryId String
visibility AgentVisibility!
type AgentType!
surfaces [String!]!
aiProvider String
aiModel String
hasAiApiKey Boolean!
aiApiKeyPreview String
properties JSON
memoryItems [AgentMemoryItem!]!
memoryProvisioning MemoryProvisioning!
installationPolicy InstallationPolicy!
imports [AgentImport!]!
importedBy [AgentImport!]!
apps [App!]! Apps that have this Agent installed (via the AppAgent join). After spec 023-app-shape, an App can install multiple Agents; this list contains every App where THIS Agent is one of the installed ones. Resolvable to ADMIN/OWNER of the Agent's owning org; non-admins see an empty list.
appAgents [AppAgent!]! 023-app-shape: the AppAgent join rows where this Agent is installed. Use App.appAgents to get the join rows from the App side. Resolvable to ADMIN/OWNER of the Agent's owning org.
appCount Int!
orgGrants [AgentOrgGrant!]! Org grants for this Agent. Resolvable to ADMIN/OWNER of the Agent's owning org only.
createdAt String!

AgentAIConfig

Field Argument Type Description
provider String!
apiKey String!
model String!

AgentImport

Field Argument Type Description
parentAgentId ID!
importedAgentId ID!
parentAgent Agent!
importedAgent Agent!
position Int!
required Boolean!
createdAt String!

AgentMemoryItem

Field Argument Type Description
id ID!
memory Memory!
role String!
createdAt String!

AgentOrgGrant

Field Argument Type Description
orgId ID!
agentId ID!
organization Organization!
agent Agent!
activatedAt String
expiresAt String
revokedAt String
revokedBy ID
isActive Boolean!
createdAt String!

AgentSubscription

Field Argument Type Description
userId ID!
agentId ID!
user User
agent Agent
activatedAt String
expiresAt String
revokedAt String
revokedBy ID
isActive Boolean!
createdAt String!

AiServiceConfig

036-ai-service-config: a named AI service configuration (masked management view — never carries key material beyond the preview). Owned by exactly one of HadronServer / Organization / App / Agent. Resolution walks App -> Agent -> Org (of the App) -> HadronServer and returns the first ENABLED config with the requested name. Well-known fallback name: 'default' (conventional extras: 'fast', 'frontier'). Name is unique per owner.

Field Argument Type Description
id ID!
name String!
ownerType AiConfigOwnerType!
ownerId ID! ID of the owning HadronServer / Organization / App / Agent.
provider String! Provider identifier; v1 known: 'anthropic' | 'openai' | 'glm' | 'bedrock'.
model String! Model identifier, passed verbatim to the provider.
hasApiKey Boolean!
apiKeyPreview String Ellipsis + last 4 characters of the stored key; null when no key.
params JSON Provider-specific knobs (maxTokens, thinking, effort, baseUrl, ...).
enabled Boolean! Disabled configs are skipped by resolution (the walk continues outward).
createdAt String!
updatedAt String

App

Field Argument Type Description
id ID!
name String!
urn String!
organizationId String!
organization Organization
agentId ID
agent Agent
installedAgentUrn String Spec 021 US1: the R2 canonical install URN combining the App's identity with its installed Agent's author-org and slug. Format is hrn:agent::::::. Two orgs installing same-slug agents from different authors produce distinct URNs that differ at the author-org segment, enabling audit-log entries to identify each install unambiguously without a PK disambiguator. Returns null when the App has no agent attached (orphan apps from the 008 cutover; new apps require an agentId per 009).
trainingMode Boolean!
surfaces [String!]!
members [AppMember!]!
memberCount Int!
appType AppType!
role AppMembershipRole!
description String
systemPrompt String
agentTools [String!]!
aiProvider String
aiModel String
hasAiApiKey Boolean!
expiresAt String
createUserPermission CreateUserPermission!
identifyUserMethod IdentifyUserMethod!
sessionTimeoutSeconds Int!
anonymousTtlDays Int!
appAgents [AppAgent!]! 023-app-shape US1: Agents installed in this App, via the AppAgent N:M join. Multiple Agents can be installed; one App credential routes to all of them via the URN supplied in the request.
agents [Agent!]! 023-app-shape: convenience that returns every installed Agent (equivalent to App.appAgents.map(aa => aa.agent)). Previously was a soft-deprecated single-element synthesis; now returns the FULL multi-Agent set per spec 023 US1.
keys [AppKey!]!
createdAt String!
updatedAt String

AppAIConfig

Field Argument Type Description
provider String!
apiKey String!
model String!

AppAgent

023-app-shape US1: the App↔Agent N:M join. Reintroduced after spec 008 collapsed it; per FR-003 it carries NO role column (system memory is read-only to every App) and per FR-001 it carries NO trainingMode column (training mode is per-App, on App.trainingMode).

Field Argument Type Description
app App!
agent Agent!
createdAt String!
createdBy String
updatedAt String
updatedBy String

AppCreated

Field Argument Type Description
app App!
rawKey String!

AppKey

Field Argument Type Description
id ID!
appId String!
keyPreview String!
label String
createdAt String!
lastUsedAt String
revokedAt String

AppKeyCreated

Field Argument Type Description
key AppKey!
rawKey String!

AppMember

Field Argument Type Description
appId ID!
userId ID!
app App!
user User!
role String!
isOrgExternal Boolean! 023-app-shape US2: true when this User is an AppMember of the App but NOT an OrgMember of the App's owning Organization. Derived at query time from the absence of an OrgMember row (per spec 023 FR-011 — no appOnly column is added to the AppMember table). Unlocks the B2C / therapy / consumer use cases where end-users use an App without joining the operator's org.
createdAt String!
updatedAt String

Asset

Field Argument Type Description
id ID!
memoryId ID!
filename String!
mimeType String!
sizeBytes Int!
scanStatus AssetScanStatus!
description String
uploadedAt String!
uploadedBy ID!
deletedAt String
urn String! The asset's URN: :assets:.

AssetDownloadUrl

Field Argument Type Description
url String!
expiresAt String!
filename String!
mimeType String!
sizeBytes Int!

AssetListResult

Field Argument Type Description
assets [Asset!]!
total Int!
hasMore Boolean!

AssetPutHeader

Field Argument Type Description
name String!
value String!

BeginAssetUploadResult

Field Argument Type Description
uploadId ID!
putUrl String!
putHeaders [AssetPutHeader!]!
expiresAt String!
storageKey String!
maxSizeBytes Int!
allowedMimeType String!

Chat

Field Argument Type Description
id ID!
loc String!
title String!
conversationName String
stageName String
messageCount Int!
createdAt String!
lastMessageAt String
scope ChatScope!
createdBy ID

ChatMessage

Field Argument Type Description
role String!
content String!
seq Int
createdAt String!

ChatPromptResult

Field Argument Type Description
systemMessage String!
tools JSON
messageHistory JSON!
summarizationNeeded SummarizationRequest

ChatResponseResult

Field Argument Type Description
displayMessage String!
stageTransitioned Boolean!
newStageName String
conversationHandoff String
chatEnded Boolean!
onTrack Boolean!
offTrackReason String

ChatStartResult

Field Argument Type Description
chatId String!
systemMessage String!
tools JSON
conversationName String
stageName String

CreateMemorySharePayload

Field Argument Type Description
memoryShare MemoryShare!

Edge

Field Argument Type Description
id ID!
source Node!
target Node!
label String!
condition JSON
priority Int!
data JSON

EditorLockResult

Field Argument Type Description
locked Boolean!
lockedBy String
expiresAt String

ExchangeConnection

Field Argument Type Description
id ID!
organizationId String!
userId String!
mailboxEmail String!
displayName String
syncEnabled Boolean!
syncStatus SyncStatus!
lastSyncAt String
lastError String
createdAt String!
updatedAt String!

ExchangeFolder

Field Argument Type Description
id ID!
displayName String!
totalItemCount Int
unreadItemCount Int

ExchangeMessage

Field Argument Type Description
id ID!
subject String
from String
receivedDateTime String
isRead Boolean
bodyPreview String
body String
hasAttachments Boolean

InstallAgentIntoAppPayload

Return shape for the installAgentIntoApp mutation. Wraps the new AppAgent row so callers can read its audit fields without re-querying.

Field Argument Type Description
appAgent AppAgent!

InstallationPolicy

Field Argument Type Description
maxMembers String! Integer-as-string OR the sentinel 'unlimited'. GraphQL does not have an Int|String union; clients parse: parseInt(maxMembers) succeeds for integer values; 'unlimited' is the sentinel.
memberRoles [String!]!

JoinAppPayload

Return shape for the joinApp mutation (023-app-shape US2). The AppMember row is included so callers can read its derived isOrgExternal flag without a re-query.

Field Argument Type Description
appMember AppMember!

LeaveAppPayload

Return shape for the leaveApp mutation (023-app-shape US2). The user's personal-class Memory at (appId, userId) is NOT cascade-deleted (spec 008 FR-015 orphan retention); it re-attaches if the user later re-joins the same App.

Field Argument Type Description
appId ID!
userId ID!

Memory

Field Argument Type Description
id ID!
organizationId String!
organization Organization
urn String!
name String!
shortDescription String
description String
tags [String!]!
license String
category0 String
category1 String
category2 String
iconUrl String
heroUrl String
homeUrl String
source String
readBranch String
writeBranch String
visibility MemoryVisibility
class MemoryClass!
acceptsUploads Boolean!
userId ID
isEncrypted Boolean!
vectorIndexEnabled Boolean!
embeddingSource EmbeddingSource!
chunkTokens Int Spec 033 US2 — chunk-window size in tokens (~4 chars/token). Null = platform default (512). Applies when embeddingSource includes content chunks.
chunkOverlap Int Spec 033 US2 — overlap between consecutive chunks in tokens. Null = platform default (64). Must be < chunkTokens.
forceFixedSize Boolean! Spec 033 US2 — force the fixed-size chunking strategy, bypassing the structure-aware default. Useful when the content's heading structure is unreliable (e.g. transcripts, machine-generated reports).
vectorIndexEncryptedAckAt String Spec 033 FR-026 — timestamp at which the memory owner accepted the encrypted-memory vector-inversion disclosure. Set when the caller passes acknowledgeVectorInversionRisk: true on updateMemory for an isEncrypted: true memory enabling vectorIndexEnabled for the first time. The portal surfaces this readback so the user can confirm when they accepted the tradeoff (the disclosure text is the FR_026_DISCLOSURE constant in src/lib/entityRef/errors.ts). Survives a revoke + re-enable cycle (never cleared). Null for unencrypted memories and for encrypted memories where the index was never enabled.
userMemoryOfAgentId String
anonymousExpiresAt String
appId ID
app App
agent Agent
syncStatus SyncStatus!
syncError String
pendingEdgeCount Int!
lastSyncedAt String
createdAt String!
updatedAt String!
subscriptions [MemorySubscription!]!
shares [MemoryShare!]! 023-app-shape US3: cross-user grants on this memory. Non-empty only when class = personal (FR-018). Includes grantee + role for each row. Visible only to the principal (memory.userId) and to ADMIN/OWNER of the memory's owning org.
members [MemoryMember!]! 023-app-shape US4: team membership rows on this memory. Non-empty only when class = group (FR-027). Visible to any current member (any role) and to ADMIN/OWNER of the memory's owning org.

MemoryMember

023-app-shape US4: symmetric team-membership row for group-class memory. The "Company Brain" model — multiple users collaboratively read/write a shared memory, governance by role, no single owner on the Memory itself.

Field Argument Type Description
memory Memory!
user User!
role MemoryMemberRole!
createdAt String!
createdBy String
updatedAt String
updatedBy String

MemoryProvisioning

Field Argument Type Description
appMemory AppMemoryKind!

MemoryShare

023-app-shape US3: asymmetric cross-user grant on a personal-class Memory. The principal (memory.userId) grants a grantee read/write access. Used for per-pairing isolation patterns (e.g., Alice's personal Memory paired-with-Mentor-A is distinct from her paired-with-Mentor-B Memory, each with its own MemoryShare).

Field Argument Type Description
memory Memory!
grantee User! The User who was granted access.
grantor User! The principal of the Memory (Memory.userId). Per spec 023 FR-019 this is always the principal, even when an App backend made the API call on the principal's behalf — that actor is recorded in createdBy instead.
role MemoryShareRole!
createdAt String!
createdBy String The API actor who created the row. Distinct from grantor when an App backend creates the share on the principal's behalf.
updatedAt String
updatedBy String

MemorySubscription

Field Argument Type Description
id ID!
memory Memory!
organization Organization!
role Role!
activated Boolean!
createdAt String!

Node

Field Argument Type Description
id ID!
memoryId String!
nodeType String!
loc String!
isLink Boolean!
name String!
alias String
description String
abstract String Paragraph-length summary of this node. Opt-in on h-read-node via the contentScope parameter. h-find-nodes preview surfacing ships in spec 031 US2 — not yet live. Never surfaced in h-list-nodes. Cap is 2000 characters; longer values are rejected with NodeAbstractTooLongError. Empty + whitespace-only values normalize to null. Spec 031.
abstractOriginHash String Spec 032 — fingerprint of the content value at the time abstract was authored. SHA-256 of plaintext content, truncated to 8 hex chars. Compared at read time against computeContentHash(node.content) to detect staleness; when the two values differ AND abstractOriginHash is non-null, the abstract may not reflect current content. System-managed; never settable via NodeInput.
embeddingPendingAt String Spec 033 FR-006/FR-007 — set when this node needs (re-)embedding; cleared on success. The single work signal the embedding worker drains. Operational state (never versioned on NodeVersion). The portal renders this as a subtle "embedding…" badge so a user who just edited isn't confused that their change "didn't take" in search yet. System-managed.
embeddingFailedAt String Spec 033 FR-009 — set when an embed attempt failed (record, not a work signal). Transient failures keep embeddingPendingAt set for retry; permanent failures clear it. The portal renders this as a red badge with the embeddingError message inline so users with an empty index can distinguish "nothing matched" from "every embed failed". System-managed.
embeddingError String Spec 033 — last embed error message (diagnosability; also surfaced by h-validate). Common values: encrypted-no-plaintext (#206), embedding-endpoint-unreachable, dimension-mismatch. Null when no failure has been recorded since the most recent success or revoke. System-managed.
embeddingAttempts Int! Spec 033 — attempt counter for backoff / give-up. Resets to 0 on success or revoke. Surfaced for ops diagnostics (a node stuck at a high attempt count likely needs operator attention). System-managed.
content String
tokens Int
tags [String!]!
properties JSON
data JSON
seq Int
ownerRepo String
isRunnable Boolean
llmModel String
aiAgent String
createdAt String!
updatedAt String!
memory Memory
outgoingEdges [Edge!]!
incomingEdges [Edge!]!

NodeSearchResult

Envelope for nodeSearch — carries the ranked nodes plus structured flags surfacing degraded / no-index outcomes that the MCP path emits inline. Spec 033.

reason: set when the query could not run as requested (e.g. 'no_vector_index' on a non-indexed memory with mode:vector); nodes is empty in that case. degraded: set when the query ran but at reduced fidelity (e.g. 'no_vector_index' on a hybrid query that fell back to keyword-only); nodes still carries usable hits.

Field Argument Type Description
nodes [Node!]!
passages [Passage!]! Spec 033 US2 — populated when the query specified granularity:chunk on a content-chunk-bearing memory. Each entry is a passage (chunk text + character offsets + chunk index + parent node URN), ranked by best similarity. Empty list when granularity:node (default) — the ranked nodes are in \`nodes\`.
reason String
degraded String

NodeVersion

Field Argument Type Description
id ID!
nodeId String!
loc String!
name String!
alias String
description String
content String
tags [String!]!
editedBy String
createdAt String!

OrgMember

Field Argument Type Description
id ID!
user User!
role Role!
canInvite Boolean!
createdAt String!

Organization

Field Argument Type Description
id ID!
name String!
urn String!
isVisible Boolean
githubInstallationId Int
githubAppId String
hasGithubAppPrivateKey Boolean!
members [OrgMember!]!
memories [Memory!]!
agents [Agent!]!
apps [App!]!
subscriptions [MemorySubscription!]!
exchangeConnections [ExchangeConnection!]!
agentOrgGrants [AgentOrgGrant!]!
createdAt String!
updatedAt String!

Passage

Spec 033 US2 — one matching chunk from a content-chunk vector index. Carries the locator metadata a RAG consumer needs for context-stuffing: span text, character offset within the parent node, chunk index, and the parent node's URN.

Field Argument Type Description
parentNodeId ID!
parentNodeUrn String!
chunkIndex Int!
charStart Int!
charEnd Int!
text String!
score Float!

RemoveMemoryMemberPayload

Field Argument Type Description
memoryId ID!
userId ID!

ResolvedAiConfig

036-ai-service-config: privileged resolution result. Carries the DECRYPTED key — only returned by resolveAIConfig (org ADMIN of the effective context org, or platform ADMIN/OWNER); successor to agentAIConfig / appAIConfig.

Field Argument Type Description
configId ID!
name String!
ownerType AiConfigOwnerType! Which level matched: APP | AGENT | ORGANIZATION | HADRON_SERVER.
provider String!
model String!
apiKey String! Decrypted key. For provider 'bedrock' this is the JSON-encoded accessKeyId/secretAccessKey/region triple the portal stores.
params JSON

RevisionResult

Field Argument Type Description
revisionLoc String!
label String!
published Boolean!
createdAt String!

RevokeMemorySharePayload

Field Argument Type Description
memoryId ID!
granteeId ID!

Session

Field Argument Type Description
id ID!
type String!
appId String
userId String
agentId String
memoryId String
expiresAt String
repo String
branch String
prNumber Int
customerId String
language String
plan String
llmModel String
inputTokens Int
outputTokens Int
turnCount Int
errorCount Int
parentSessionId String
prevSessionId String
summary String
outcome Float
outcomeRef String
outcomeMeta JSON
startedAt String!
endedAt String
autoExpiredAt String
events [UsageEvent!]!

SummarizationRequest

Field Argument Type Description
messageCount Int!
prompt String!

UninstallAgentFromAppPayload

Return shape for the uninstallAgentFromApp mutation. The Agent's per-(App, Agent, *) memories are NOT cascade-deleted (spec 023 FR-005); they persist as orphans on the now-removed AppAgent edge.

Field Argument Type Description
appId ID!
agentId ID!

UpdateMemoryMemberRolePayload

Field Argument Type Description
memoryMember MemoryMember!

UpdateMemoryShareRolePayload

Field Argument Type Description
memoryShare MemoryShare!

UrnResolution

Result of resolving a Hadron URN to the ids a client needs to navigate to the resource's canonical page. Powers the portal's /app/u/ redirect route (hadron-portal#262).

`kind` is the URN's type segment: memory | node | agent | org | app. `id` is the resolved entity's primary id. `memoryId` is set only for nodes (their owning memory), `organizationId` only for apps (their owning org) — both are the extra ids those resources' canonical routes require.

Field Argument Type Description
kind String!
id ID!
memoryId ID
organizationId ID

UsageEvent

Field Argument Type Description
id ID!
type String!
nodeLoc String
actionArgs JSON
appId String
sessionId String
model String
tokensIn Int
tokensOut Int
createdAt String!

UsageSummaryEntry

Field Argument Type Description
nodeLoc String!
type String!
count Int!

User

Field Argument Type Description
id ID!
handle String
githubId Int
githubUsername String
identityProvider String
externalId String
externalAppId String
linkedAt String
name String
email String
avatarUrl String
roles [Role!]!
maxReferrals Int
appMemberships [AppMember!]!

UserApiKey

Field Argument Type Description
id ID!
keyPreview String!
label String
createdAt String!
lastUsedAt String
revokedAt String
issuedVia String

UserApiKeyCreateResult

Field Argument Type Description
userApiKey UserApiKey!
rawKey String!

UserInvitation

Field Argument Type Description
id ID!
slug String!
senderUserId String
sender User
organizationId String
organization Organization
memberRole Role!
name String
email String
githubUsername String
maxActivations Int
expiresAt String
acceptedAt String
createdAt String!
activationCount Int!

Inputs

BeginAssetUploadInput

Field Type Description
agentUrn String! Accepts the entity's ID or URN.
filename String!
mimeType String!
sizeBytes Int!
description String
uploadIntent UploadIntent!
uploadRequestId String

BeginAssetUploadV2Input

Field Type Description
memoryId ID! Memory reference. Accepts the entity's ID (CUID / 32-char hex) or its URN (per spec 007 ID-or-URN dispatch). URN inputs MUST be fully qualified (org:memory) per spec 022 — relative-form URNs are rejected as GraphQL errors with extensions.code "URN_NOT_QUALIFIED".
filename String!
mimeType String!
sizeBytes Int!
description String
uploadIntent UploadIntent!
uploadRequestId String

CompleteAssetUploadInput

Field Type Description
uploadId ID!

EdgeInput

Field Type Description
sourceLoc String!
targetLoc String!
label String!

NodeEdgeInput

Field Type Description
targetId String! Reference to the target node. Accepts a node ID, a full URN (hrn:node:::), a memory-prefixed loc (:), or a short loc resolved within the source node's memory.
label String

NodeInput

Field Type Description
id String
memoryId String! Memory reference. Accepts the entity's ID (CUID / 32-char hex) or its URN (per spec 007 ID-or-URN dispatch). URN inputs MUST be fully qualified (org:memory) per spec 022 — relative-form URNs are rejected as GraphQL errors with extensions.code "URN_NOT_QUALIFIED".
nodeType String
loc String!
name String!
alias String
description String
abstract String Paragraph-length summary of this node — see Node.abstract for the surfacing contract (h-read-node opt-in via contentScope; h-find-nodes preview ships in US2). Optional. Omit to preserve; null to clear; string to replace. Empty + whitespace-only normalize to null. Cap is 2000 characters.
content String
seq Int
tags [String!]
properties JSON
data JSON
ownerRepo String
llmModel String
aiAgent String
edges [NodeEdgeInput!]
createOnly Boolean

SessionInput

Field Type Description
id String!
type String
repo String
branch String
prNumber Int
customerId String
language String
llmModel String
parentSessionId String
prevSessionId String

SetAgentAssetUploadEnabledInput

Field Type Description
agentUrn String! Agent reference. Accepts the entity's ID (CUID / 32-char hex) or its URN (per spec 007 ID-or-URN dispatch). URN inputs MUST be fully qualified (org:agent) per spec 022 — relative-form URNs are rejected as GraphQL errors with extensions.code "URN_NOT_QUALIFIED".
enabled Boolean!

UsageEventInput

Field Type Description
type String!
nodeLoc String
actionArgs JSON
sessionId String
model String
tokensIn Int
tokensOut Int

Enums

AgentType

Value Description
ASSISTANT
CHATBOT

AgentVisibility

035-visibility-enum-cleanup: agents have their own visibility enum, decoupled from MemoryVisibility. PERSONAL is the creator-only draft state.

Value Description
PUBLIC
ORGANIZATION
PERSONAL

AiConfigOwnerType

036-ai-service-config: which entity owns an AiServiceConfig. Exactly one owner per config (DB-enforced).

Value Description
HADRON_SERVER
ORGANIZATION
APP
AGENT

AppMembershipRole

Value Description
OWNER
ADMIN
CONTRIBUTOR
READER

AppMemoryKind

Value Description
shared
user
none

AppType

Value Description
WORKSTATION
CHATBOT
AGENT
AUTOMATION
CLOUD
IOT

AssetScanStatus

Value Description
PENDING
CLEAN
BLOCKED

ChatScope

Value Description
private
shared

CreateUserPermission

Value Description
DENY
EXPLICIT
IMPLICIT

EmbeddingSource

Value Description
abstract
contentChunks
both

IdentifyUserMethod

Value Description
USER_ID
SECRET

MemoryClass

Value Description
system
app
knowledge
personal
group 023-app-shape US4: team-shared memory with symmetric membership. Governed by a list of MemoryMember rows (each with reader/writer/ owner role) — no single owner field on Memory. Closes the Company Brain gap that wasn't covered by the four legacy classes.
private Single-owner, owner-only memory — no MemoryShare path (not shareable), no ADMIN/OWNER bypass. Spec 034 (hadron-server #242) made it user-creatable via createMemory: free-standing (no app/agent) or app-scoped. May opt into encrypt-at-rest (the private CLASS marks it; visibility is NULL), but the encryption implementation itself is a deferred follow-up — do NOT rely on at-rest encryption for secret material yet.

MemoryMemberRole

023-app-shape US4: role on a MemoryMember row. Symmetric team membership for group-class memory. - reader: read access. - writer: read + write (the member can add/edit/delete nodes within the memory). - owner: read + write + management — add/remove other members, change roles, delete the Memory itself. Subject to the last-owner protection rule (FR-038): the platform refuses to remove or demote the sole remaining owner; the path to fully empty a group memory is to delete it.

Value Description
reader
writer
owner

MemoryShareRole

023-app-shape US3: role on a MemoryShare row. Asymmetric grant for personal-class memory. - reader: read access only. - writer: read + write (the grantee can add/edit/delete nodes within the memory).

Value Description
reader
writer

MemoryVisibility

035-visibility-enum-cleanup: meaningful only for knowledge (PUBLIC/ORGANIZATION) and group (GROUP); null otherwise. PERSONAL/PRIVATE were dropped — privacy is the personal/private memory CLASS now.

Value Description
PUBLIC
ORGANIZATION
GROUP 023-app-shape US4: team-shared visibility. Bound bidirectionally to MemoryClass.group by the chk_memory_group_visibility CHECK constraint — a memory has class=group iff visibility=GROUP.

Role

Value Description
OWNER
ADMIN
CONTRIBUTOR
READER

SearchGranularity

Result granularity for nodeSearch. Spec 033.

  • node: one entry per matching node (US1 default).
  • chunk: passage-level entries with offsets into the parent node's content (US2; chunk hits collapse to node-level when granularity is node).
Value Description
node
chunk

SearchMode

Search dispatch for nodeSearch. Spec 033.

  • keyword: substring match across name/loc/description/tags (the legacy nodes-query semantic, exposed as a nodeSearch mode for parity).
  • vector: semantic search via the memory's vector index. Requires vectorIndexEnabled on the memory.
  • hybrid: reciprocal-rank fusion of keyword + vector (k=60).
Value Description
keyword
vector
hybrid

SubscriptionType

Value Description
READ_ONLY
READ_WRITE

SyncStatus

Value Description
PENDING
SYNCING
OK
ERROR

UploadIntent

Value Description
USER
AGENT_REQUEST

Scalars

Boolean

The Boolean scalar type represents true or false.

Float

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

ID

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Int

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

JSON

String

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.