Skip to main content

Types and interfaces

Import browser-safe runtime types from @cortexmemory/sdk/runtime and AI SDK transport types from @cortexmemory/vercel-ai-provider/remote. Node graph types use @cortexmemory/sdk/runtime/graph.

TypeMeaning
CortexRuntimeClientOptionsOrigin, host token callback, optional scope/HTTP/client and deadlines
TextSubmitV1Closed text input, published Agent, optional conversation and stable request
RuntimeSessionServer-derived principal/user/tenant/space and delivery deadline
RuntimeRunHandleImmutable pinned selectors/definition hash; no authority by possession
RuntimeRunSeparate execution/memory/graph states and context/failure metadata
RuntimeObservationRun, retained sequenced parts/cursor and exact approvals
RuntimeTranscriptPageCanonical messages, completion and continuation cursor
RuntimeEmbeddingProfileModel/dimensions/normalization/chunking/index identity
RuntimeMemoryReadinessCaptured cutoffs and contiguous stage watermarks/holes
RuntimeAssetReference / RuntimeAssetVersionImmutable selector / authorized hash/MIME/size/lineage
RuntimeAssetPreviewTemporary Blob URL and explicit revoke()
ContentSubmitV1 / RuntimeContentJobV1Closed content intent / retained job/version outcome
RuntimeMediaSubmit / RuntimeMediaJobRetained generation intent / saved operation and cost/cancel state
CortexRemoteState / CortexRemoteMetadataBounded reconnect projection / AI SDK server-state metadata

Runtime response statuses are queued, waiting approval, running, complete, failed or cancelled. Memory/graph statuses are pending, complete, failed or not requested. Media state distinguishes submission_unknown from acknowledged processing; content state likewise exposes unknown.

Use installed package declarations for complete field/overload types. Root SDK types belong to explicit domain/admin APIs and do not manufacture verified runtime identity. See runtime reference, remote reference and error handling.

Shared domain options​

tenantId selects the domain within the authenticated scope. When both explicit and authenticated tenant values are present, disagreement is rejected; an omitted tenant is not a request to scan every tenant. participantId tracks provenance. syncToGraph requests graph work according to the configured policy; it is not authorization to write arbitrary graph nodes.

DomainPartial records a bounded operation that stopped before its selected work completed. Inspect its confirmed, unknown, remaining and unstarted physical IDs, counts and outcomes before further mutation. Selection changes, ambiguous scope and version conflicts must be resolved; retrying a new request can duplicate work.

GraphSyncOption​

export interface GraphSyncOption {
syncToGraph?: boolean;
}
FieldMeaning and defaults
syncToGraphExplicit false disables native capture and delivery; true requires an adapter.

GraphCaptureMetadata​

export interface GraphCaptureMetadata {graphJobs?:import("../graph/types").GraphJobReceipt[];graphDisposition?:"queued"|"delivered";}

DomainReadOptions​

export interface DomainReadOptions extends GraphSyncOption {
tenantId?: string;
signal?: AbortSignal;
deadlineMs?: number;
}
FieldMeaning and defaults
deadlineMsRelative finite page/mutation wait bound in milliseconds.

Also inherits GraphSyncOption. See shared contracts.

DomainPartial​

export interface DomainPartial {
outcomes: DomainItemOutcome[];
confirmedCount: number;
possibleCount: number;
confirmedPhysicalIds: string[];
unknownPhysicalIds: string[];
remainingPhysicalIds: string[];
unstartedPhysicalIds: string[];
originalIntents?: unknown[];
}

DomainItemOutcome​

export interface DomainItemOutcome {
physicalId: string;
disposition: "knownCommitted" | "knownRolledBack" | "outcomeUnknown" | "alreadyAbsent" | "unstarted";
graphIdentity?: DomainGraphIdentity;
graphJobs?: import("../graph/types").GraphJobReceipt[];
}
FieldMeaning and defaults
graphJobsOriginal immutable job receipts after a known primary commit; retry delivery only.

DomainGraphIdentity​

export interface DomainGraphIdentity {
table: "memories" | "facts" | "conversations";
kind: "Memory" | "Fact" | "Conversation";
sourceDocumentId: string;
tenantScope: {kind: "tenantless"} | {kind: "tenant"; tenantId: string};
memorySpaceId: string;
logicalId: string;
targetId: string;
generation: string;
referenceRevision: number;
ownershipRevision: number;
bindings: Array<{role: string; slot: string; kind: string; targetId?: string; capturedOwnershipRevision?: number; capturedTenantId?: string; capturedMemorySpaceId?: string}>;
}

ArchiveFactIntent​

export interface ArchiveFactIntent {
memorySpaceId: string;
tenantId?: string;
physicalId: string;
factId: string;
expectedSourceFingerprint: string;
operationId: string;
requestDigest: string;
validUntil: number;
tags: string[];
}

MemoryArchiveIntent​

export interface MemoryArchiveIntent {
memorySpaceId: string;
memoryId: string;
tenantId?: string;
memoryPhysicalId: string;
memoryFingerprint: string;
facts: ArchiveFactIntent[];
}

ConversationRef​

export interface ConversationRef {
conversationId: string;
messageIds: string[];
}

ImmutableRef​

export interface ImmutableRef {
type: string;
id: string;
version?: number;
}

MutableRef​

export interface MutableRef {
namespace: string;
key: string;
snapshotValue: unknown;
snapshotAt: number;
}

FactsRef​

export interface FactsRef {
factId: string;
version?: number;
}

SourceType​

export type SourceType =
| "conversation"
| "system"
| "tool"
| "a2a"
| "fact-extraction";

ContentType​

export type ContentType = "raw" | "summarized" | "fact";

RecallOptions​

export interface RecallOptions extends GraphSyncOption {
enrichWithGraph?: boolean;
maxEnrichmentDepth?: number;
includeConversation?: boolean;
}
FieldMeaning and defaults
enrichWithGraphUse graph for enrichment (default: true if graph configured)
maxEnrichmentDepthMaximum depth for graph traversal enrichment
includeConversationInclude full conversation history

Also inherits GraphSyncOption. See shared contracts.

OrchestrationObserver​

export interface OrchestrationObserver {
onRecallStart?: (orchestrationId: string) => void | Promise<void>;
onRecallComplete?: (summary: RecallSummary) => void | Promise<void>;
onRememberStart?: (orchestrationId: string) => void | Promise<void>;
onRememberComplete?: (summary: OrchestrationSummary) => void | Promise<void>;
onLayerUpdate?: (event: LayerEvent) => void | Promise<void>;
}
FieldMeaning and defaults
onRecallStartCalled when recall phase starts (context retrieval). Recall happens before the LLM generates a response.
onRecallCompleteCalled when recall phase completes. Contains retrieved context and timing information.
onRememberStartCalled when remember phase starts (memory storage). Remember happens after the LLM generates a response.
onRememberCompleteCalled when remember phase completes (all layers done). Contains created record IDs and timing information.
onLayerUpdateCalled when a layer's status changes during either phase. The event.phase field indicates which phase the update is for.

Namespace contracts​

The parameter and result definitions live beside the methods that use them:

  • Memory Operations: RememberParams, RememberOptions, RememberResult, SearchMemoryOptions, SearchMemoriesOptions.
  • Facts Operations: StoreFactParams, StoreFactOptions, DeduplicationStrategy, DeduplicationConfig, StoreWithDedupResult.
  • Conversation Operations: CreateConversationInput, AddMessageInput, Message, Conversation, GetHistoryOptions.
  • Context Operations: CreateContextParams, UpdateContextParams, Context, ContextChain, ContextWithConversation.
  • Immutable Store Api: ImmutableEntry, ImmutableRecord, ImmutableVersionExpanded, ListImmutableFilter, SearchImmutableInput.
  • Mutable Store Api: SetMutableInput, MutableRecord, ListMutableFilter, CountMutableFilter, PurgeNamespaceOptions.
  • User Operations: UserProfile, UserVersion, ListUsersFilter, ListUsersResult, UserFilters.
  • Sessions Operations: CreateSessionParams, Session, SessionFilters, EndAllOptions, EndSessionsResult.
  • Memory Space Operations: RegisterMemorySpaceParams, MemorySpace, ListMemorySpacesFilter, ListMemorySpacesResult, UpdateMemorySpaceOptions.
  • Agent Management: AgentRegistration, RegisteredAgent, AgentFilters, AgentStats, UnregisterAgentOptions.
  • Artifacts Operations: ArtifactKind, StreamingState, CreateArtifactOptions, Artifact, UpdateArtifactOptions.
  • Attachments Operations: AttachParams, Attachment, AttachmentType, AttachmentDimensions, ListAttachmentsFilter.
  • Governance Policies Api: GovernancePolicy, ComplianceTemplate, PolicyScope, PolicyResult, EnforcementOptions.
  • A2A Communication: A2ASendParams, A2AMessage, A2ARequestParams, A2AResponse, A2ABroadcastParams.
  • Auth Context Api: AuthContextParams, AuthContext, AuthMethod.