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.
| Type | Meaning |
|---|---|
CortexRuntimeClientOptions | Origin, host token callback, optional scope/HTTP/client and deadlines |
TextSubmitV1 | Closed text input, published Agent, optional conversation and stable request |
RuntimeSession | Server-derived principal/user/tenant/space and delivery deadline |
RuntimeRunHandle | Immutable pinned selectors/definition hash; no authority by possession |
RuntimeRun | Separate execution/memory/graph states and context/failure metadata |
RuntimeObservation | Run, retained sequenced parts/cursor and exact approvals |
RuntimeTranscriptPage | Canonical messages, completion and continuation cursor |
RuntimeEmbeddingProfile | Model/dimensions/normalization/chunking/index identity |
RuntimeMemoryReadiness | Captured cutoffs and contiguous stage watermarks/holes |
RuntimeAssetReference / RuntimeAssetVersion | Immutable selector / authorized hash/MIME/size/lineage |
RuntimeAssetPreview | Temporary Blob URL and explicit revoke() |
ContentSubmitV1 / RuntimeContentJobV1 | Closed content intent / retained job/version outcome |
RuntimeMediaSubmit / RuntimeMediaJob | Retained generation intent / saved operation and cost/cancel state |
CortexRemoteState / CortexRemoteMetadata | Bounded 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;
}
| Field | Meaning and defaults |
|---|---|
syncToGraph | Explicit 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;
}
| Field | Meaning and defaults |
|---|---|
deadlineMs | Relative 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[];
}
| Field | Meaning and defaults |
|---|---|
graphJobs | Original 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;
}
| Field | Meaning and defaults |
|---|---|
enrichWithGraph | Use graph for enrichment (default: true if graph configured) |
maxEnrichmentDepth | Maximum depth for graph traversal enrichment |
includeConversation | Include 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>;
}
| Field | Meaning and defaults |
|---|---|
onRecallStart | Called when recall phase starts (context retrieval). Recall happens before the LLM generates a response. |
onRecallComplete | Called when recall phase completes. Contains retrieved context and timing information. |
onRememberStart | Called when remember phase starts (memory storage). Remember happens after the LLM generates a response. |
onRememberComplete | Called when remember phase completes (all layers done). Contains created record IDs and timing information. |
onLayerUpdate | Called 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.