GoodMemGoodMem
ReferenceClient SDKs

TypeScript SDK

Installation

npm install @pairsystems/goodmem

Client

import { Goodmem } from "@pairsystems/goodmem";

const client = new Goodmem({
  baseUrl: "http://localhost:8080",
  apiKey: process.env.GOODMEM_API_KEY,
});

The TypeScript SDK exposes generated namespace clients on client.<namespace>.

NamespaceAccessorDescription
Embeddersclient.embeddersEmbedder management
Rerankersclient.rerankersReranker management
LLMsclient.llmsLLM management
Spacesclient.spacesMemory space management
Memoriesclient.memoriesMemory CRUD, retrieval, and batch operations
OCRclient.ocrDocument text extraction
Systemclient.systemServer info and initialization
Instanceclient.instanceSingleton instance identity and ownership
Usersclient.usersUser lookup
Service Identitiesclient.service_identitiesProduction service identity lifecycle
User Enrollmentsclient.user_enrollmentsOne-time human-user enrollment completion
Adminclient.adminServer lifecycle operations
Access Policyclient.access_policyDirect grants and scoped role assignments
API Keysclient.apikeysAPI key lifecycle management
Pingclient.pingEndpoint health probes

Methods

NamespaceMethodSignatureReturns
embedderscreateclient.embedders.create(request: EmbeddersCreateRequest, requestOptions?: ProviderApiKeyOptions): Promise&lt;EmbedderResponseShape&gt;Promise&lt;EmbedderResponseShape&gt;
embeddersdeleteclient.embedders.delete(id: string, requestOptions?: RequestOptions): Promise&lt;void&gt;Promise&lt;void&gt;
embeddersgetclient.embedders.get(id: string, options?: EmbeddersGetOptions, requestOptions?: RequestOptions): Promise&lt;EmbedderResponseShape&gt;Promise&lt;EmbedderResponseShape&gt;
embedderslistclient.embedders.list(options?: EmbeddersListOptions, requestOptions?: RequestOptions): Promise&lt;Array&lt;EmbedderResponseShape&gt;&gt;Promise&lt;Array&lt;EmbedderResponseShape&gt;&gt;
embeddersupdateclient.embedders.update(id: string, request: UpdateEmbedderRequest, requestOptions?: RequestOptions): Promise&lt;EmbedderResponseShape&gt;Promise&lt;EmbedderResponseShape&gt;
rerankerscreateclient.rerankers.create(request: RerankersCreateRequest, requestOptions?: ProviderApiKeyOptions): Promise&lt;RerankerResponseShape&gt;Promise&lt;RerankerResponseShape&gt;
rerankersdeleteclient.rerankers.delete(id: string, requestOptions?: RequestOptions): Promise&lt;void&gt;Promise&lt;void&gt;
rerankersgetclient.rerankers.get(id: string, options?: RerankersGetOptions, requestOptions?: RequestOptions): Promise&lt;RerankerResponseShape&gt;Promise&lt;RerankerResponseShape&gt;
rerankerslistclient.rerankers.list(options?: RerankersListOptions, requestOptions?: RequestOptions): Promise&lt;Array&lt;RerankerResponseShape&gt;&gt;Promise&lt;Array&lt;RerankerResponseShape&gt;&gt;
rerankersupdateclient.rerankers.update(id: string, request: UpdateRerankerRequest, requestOptions?: RequestOptions): Promise&lt;RerankerResponseShape&gt;Promise&lt;RerankerResponseShape&gt;
llmscreateclient.llms.create(request: LlmsCreateRequest, requestOptions?: ProviderApiKeyOptions): Promise&lt;CreateLLMResponseShape&gt;Promise&lt;CreateLLMResponseShape&gt;
llmsdeleteclient.llms.delete(id: string, requestOptions?: RequestOptions): Promise&lt;void&gt;Promise&lt;void&gt;
llmsgetclient.llms.get(id: string, options?: LlmsGetOptions, requestOptions?: RequestOptions): Promise&lt;LLMResponseShape&gt;Promise&lt;LLMResponseShape&gt;
llmslistclient.llms.list(options?: LlmsListOptions, requestOptions?: RequestOptions): Promise&lt;Array&lt;LLMResponseShape&gt;&gt;Promise&lt;Array&lt;LLMResponseShape&gt;&gt;
llmsupdateclient.llms.update(id: string, request: LLMUpdateRequest, requestOptions?: RequestOptions): Promise&lt;LLMResponseShape&gt;Promise&lt;LLMResponseShape&gt;
spacescreateclient.spaces.create(request: SpaceCreationRequest, requestOptions?: RequestOptions): Promise&lt;SpaceResponseShape&gt;Promise&lt;SpaceResponseShape&gt;
spacesdeleteclient.spaces.delete(id: string, requestOptions?: RequestOptions): Promise&lt;void&gt;Promise&lt;void&gt;
spacesgetclient.spaces.get(id: string, requestOptions?: RequestOptions): Promise&lt;SpaceResponseShape&gt;Promise&lt;SpaceResponseShape&gt;
spaceslistclient.spaces.list(options?: SpacesListOptions, requestOptions?: RequestOptions): Promise&lt;Page&lt;SpaceResponseShape&gt;&gt;Promise&lt;Page&lt;SpaceResponseShape&gt;&gt;
spacestransferOwnershipclient.spaces.transferOwnership(id: string, request: TransferOwnershipRequest, requestOptions?: RequestOptions): Promise&lt;TransferSpaceOwnershipResponseShape&gt;Promise&lt;TransferSpaceOwnershipResponseShape&gt;
spacesupdateclient.spaces.update(id: string, request: UpdateSpaceRequest, requestOptions?: RequestOptions): Promise&lt;SpaceResponseShape&gt;Promise&lt;SpaceResponseShape&gt;
memoriesbatchCreateclient.memories.batchCreate(request: JsonBatchMemoryCreationRequest, requestOptions?: RequestOptions): Promise&lt;BatchMemoryResponseShape&gt;Promise&lt;BatchMemoryResponseShape&gt;
memoriesbatchDeleteclient.memories.batchDelete(request: BatchMemoryDeletionRequest, requestOptions?: RequestOptions): Promise&lt;BatchMemoryResponseShape&gt;Promise&lt;BatchMemoryResponseShape&gt;
memoriesbatchGetclient.memories.batchGet(request: BatchMemoryRetrievalRequest, requestOptions?: RequestOptions): Promise&lt;BatchMemoryResponseShape&gt;Promise&lt;BatchMemoryResponseShape&gt;
memoriescontentclient.memories.content(id: string, requestOptions?: RequestOptions): Promise&lt;Uint8Array&gt;Promise&lt;Uint8Array&gt;
memoriescreateclient.memories.create(request: JsonMemoryCreationRequest, requestOptions?: RequestOptions): Promise&lt;MemoryResponseShape&gt;Promise&lt;MemoryResponseShape&gt;
memoriesdeleteclient.memories.delete(id: string, requestOptions?: RequestOptions): Promise&lt;void&gt;Promise&lt;void&gt;
memoriesgetclient.memories.get(id: string, options?: MemoriesGetOptions, requestOptions?: RequestOptions): Promise&lt;MemoryResponseShape&gt;Promise&lt;MemoryResponseShape&gt;
memorieslistclient.memories.list(spaceId: string, options?: MemoriesListOptions, requestOptions?: RequestOptions): Promise&lt;Page&lt;MemoryResponseShape&gt;&gt;Promise&lt;Page&lt;MemoryResponseShape&gt;&gt;
memoriespagesclient.memories.pages(id: string, options?: MemoriesPagesOptions, requestOptions?: RequestOptions): Promise&lt;Page&lt;MemoryPageImageResponseShape&gt;&gt;Promise&lt;Page&lt;MemoryPageImageResponseShape&gt;&gt;
memoriespagesImageclient.memories.pagesImage(id: string, pageIndex: number, options?: MemoriesPagesImageOptions, requestOptions?: RequestOptions): Promise&lt;Uint8Array&gt;Promise&lt;Uint8Array&gt;
memoriesretrieveclient.memories.retrieve(request: MemoriesRetrieveParams, requestOptions?: RequestOptions): AsyncIterable&lt;RetrieveMemoryEventResponseShape&gt;AsyncIterable&lt;RetrieveMemoryEventResponseShape&gt;
ocrdocumentclient.ocr.document(request: OcrDocumentRequest, requestOptions?: RequestOptions): Promise&lt;OcrDocumentResponseShape&gt;Promise&lt;OcrDocumentResponseShape&gt;
systeminfoclient.system.info(requestOptions?: RequestOptions): Promise&lt;SystemInfoResponseShape&gt;Promise&lt;SystemInfoResponseShape&gt;
systeminitclient.system.init(requestOptions?: RequestOptions): Promise&lt;SystemInitResponseShape&gt;Promise&lt;SystemInitResponseShape&gt;
instancegetclient.instance.get(requestOptions?: RequestOptions): Promise&lt;GoodMemInstanceResponseShape&gt;Promise&lt;GoodMemInstanceResponseShape&gt;
userscreateclient.users.create(request: CreateUserRequest, requestOptions?: RequestOptions): Promise&lt;UserResponseShape&gt;Promise&lt;UserResponseShape&gt;
userscreateEnrollmentclient.users.createEnrollment(userId: string, request: CreateUserEnrollmentRequest, requestOptions?: RequestOptions): Promise&lt;CreateUserEnrollmentResponseShape&gt;Promise&lt;CreateUserEnrollmentResponseShape&gt;
usersdeleteclient.users.delete(id: string, requestOptions?: RequestOptions): Promise&lt;void&gt;Promise&lt;void&gt;
usersgetclient.users.get(options?: UsersGetOptions, requestOptions?: RequestOptions): Promise&lt;UserResponseShape&gt;Promise&lt;UserResponseShape&gt;
usersgetByUsernameclient.users.getByUsername(username: string, options?: UsersGetByUsernameOptions, requestOptions?: RequestOptions): Promise&lt;UserResponseShape&gt;Promise&lt;UserResponseShape&gt;
usersgetEnrollmentclient.users.getEnrollment(userId: string, enrollmentId: string, requestOptions?: RequestOptions): Promise&lt;UserEnrollmentResponseShape&gt;Promise&lt;UserEnrollmentResponseShape&gt;
userslistclient.users.list(options?: UsersListOptions, requestOptions?: RequestOptions): Promise&lt;Page&lt;UserResponseShape&gt;&gt;Promise&lt;Page&lt;UserResponseShape&gt;&gt;
userslistEnrollmentsclient.users.listEnrollments(userId: string, options?: UsersListEnrollmentsOptions, requestOptions?: RequestOptions): Promise&lt;Page&lt;UserEnrollmentResponseShape&gt;&gt;Promise&lt;Page&lt;UserEnrollmentResponseShape&gt;&gt;
usersmeclient.users.me(requestOptions?: RequestOptions): Promise&lt;UserResponseShape&gt;Promise&lt;UserResponseShape&gt;
usersrevokeEnrollmentclient.users.revokeEnrollment(userId: string, enrollmentId: string, requestOptions?: RequestOptions): Promise&lt;void&gt;Promise&lt;void&gt;
usersupdateclient.users.update(id: string, request: UpdateUserRequest, requestOptions?: RequestOptions): Promise&lt;UserResponseShape&gt;Promise&lt;UserResponseShape&gt;
service_identitiescreateclient.service_identities.create(request: CreateServiceIdentityRequest, requestOptions?: RequestOptions): Promise&lt;ServiceIdentityResponseShape&gt;Promise&lt;ServiceIdentityResponseShape&gt;
service_identitiesdeleteclient.service_identities.delete(id: string, requestOptions?: RequestOptions): Promise&lt;void&gt;Promise&lt;void&gt;
service_identitiesgetclient.service_identities.get(id: string, options?: ServiceIdentitiesGetOptions, requestOptions?: RequestOptions): Promise&lt;ServiceIdentityResponseShape&gt;Promise&lt;ServiceIdentityResponseShape&gt;
service_identitieslistclient.service_identities.list(options?: ServiceIdentitiesListOptions, requestOptions?: RequestOptions): Promise&lt;Page&lt;ServiceIdentityResponseShape&gt;&gt;Promise&lt;Page&lt;ServiceIdentityResponseShape&gt;&gt;
service_identitiestransferOwnershipclient.service_identities.transferOwnership(id: string, request: TransferOwnershipRequest, requestOptions?: RequestOptions): Promise&lt;TransferServiceIdentityOwnershipResponseShape&gt;Promise&lt;TransferServiceIdentityOwnershipResponseShape&gt;
service_identitiesupdateclient.service_identities.update(id: string, request: UpdateServiceIdentityRequest, requestOptions?: RequestOptions): Promise&lt;ServiceIdentityResponseShape&gt;Promise&lt;ServiceIdentityResponseShape&gt;
user_enrollmentscompleteclient.user_enrollments.complete(request: CompleteUserEnrollmentRequest, requestOptions?: RequestOptions): Promise&lt;CompleteUserEnrollmentResponseShape&gt;Promise&lt;CompleteUserEnrollmentResponseShape&gt;
adminbackgroundJobsPurgeclient.admin.backgroundJobsPurge(request: AdminPurgeJobsRequest, requestOptions?: RequestOptions): Promise&lt;AdminPurgeJobsResponseShape&gt;Promise&lt;AdminPurgeJobsResponseShape&gt;
admindrainclient.admin.drain(request: AdminDrainRequest, requestOptions?: RequestOptions): Promise&lt;AdminDrainResponseShape&gt;Promise&lt;AdminDrainResponseShape&gt;
adminlicenseReloadclient.admin.licenseReload(requestOptions?: RequestOptions): Promise&lt;AdminReloadLicenseResponseShape&gt;Promise&lt;AdminReloadLicenseResponseShape&gt;
adminretrieveMemoryLogPoliciesCreateclient.admin.retrieveMemoryLogPoliciesCreate(request: CreateRetrieveMemoryLogPolicyRequest, requestOptions?: RequestOptions): Promise&lt;RetrieveMemoryLogPolicyResponseShape&gt;Promise&lt;RetrieveMemoryLogPolicyResponseShape&gt;
adminretrieveMemoryLogPoliciesDeleteclient.admin.retrieveMemoryLogPoliciesDelete(id: string, request: DeleteRetrieveMemoryLogPolicyRequest, requestOptions?: RequestOptions): Promise&lt;RetrieveMemoryLogPolicyResponseShape&gt;Promise&lt;RetrieveMemoryLogPolicyResponseShape&gt;
adminretrieveMemoryLogPoliciesGetclient.admin.retrieveMemoryLogPoliciesGet(id: string, options?: AdminRetrieveMemoryLogPoliciesGetOptions, requestOptions?: RequestOptions): Promise&lt;RetrieveMemoryLogPolicyResponseShape&gt;Promise&lt;RetrieveMemoryLogPolicyResponseShape&gt;
adminretrieveMemoryLogPoliciesListclient.admin.retrieveMemoryLogPoliciesList(options?: AdminRetrieveMemoryLogPoliciesListOptions, requestOptions?: RequestOptions): Promise&lt;Page&lt;RetrieveMemoryLogPolicyResponseShape&gt;&gt;Promise&lt;Page&lt;RetrieveMemoryLogPolicyResponseShape&gt;&gt;
admintransferInstanceOwnershipclient.admin.transferInstanceOwnership(request: TransferOwnershipRequest, requestOptions?: RequestOptions): Promise&lt;TransferInstanceOwnershipResponseShape&gt;Promise&lt;TransferInstanceOwnershipResponseShape&gt;
access_policycheckclient.access_policy.check(request: CheckAuthorizationsRequest, requestOptions?: RequestOptions): Promise&lt;CheckAuthorizationsResponseShape&gt;Promise&lt;CheckAuthorizationsResponseShape&gt;
access_policygrantsCreateclient.access_policy.grantsCreate(request: CreateAuthorizationGrantRequest, requestOptions?: RequestOptions): Promise&lt;AuthorizationGrantResponseShape&gt;Promise&lt;AuthorizationGrantResponseShape&gt;
access_policygrantsDeleteclient.access_policy.grantsDelete(id: string, requestOptions?: RequestOptions): Promise&lt;AuthorizationGrantResponseShape&gt;Promise&lt;AuthorizationGrantResponseShape&gt;
access_policygrantsGetclient.access_policy.grantsGet(id: string, options?: AccessPolicyGrantsGetOptions, requestOptions?: RequestOptions): Promise&lt;AuthorizationGrantResponseShape&gt;Promise&lt;AuthorizationGrantResponseShape&gt;
access_policygrantsListclient.access_policy.grantsList(options?: AccessPolicyGrantsListOptions, requestOptions?: RequestOptions): Promise&lt;Page&lt;AuthorizationGrantResponseShape&gt;&gt;Promise&lt;Page&lt;AuthorizationGrantResponseShape&gt;&gt;
access_policyroleAssignmentsCreateclient.access_policy.roleAssignmentsCreate(request: AssignRoleRequest, requestOptions?: RequestOptions): Promise&lt;RoleAssignmentResponseShape&gt;Promise&lt;RoleAssignmentResponseShape&gt;
access_policyroleAssignmentsDeleteclient.access_policy.roleAssignmentsDelete(id: string, requestOptions?: RequestOptions): Promise&lt;RoleAssignmentResponseShape&gt;Promise&lt;RoleAssignmentResponseShape&gt;
access_policyroleAssignmentsGetclient.access_policy.roleAssignmentsGet(id: string, options?: AccessPolicyRoleAssignmentsGetOptions, requestOptions?: RequestOptions): Promise&lt;RoleAssignmentResponseShape&gt;Promise&lt;RoleAssignmentResponseShape&gt;
access_policyroleAssignmentsListclient.access_policy.roleAssignmentsList(options?: AccessPolicyRoleAssignmentsListOptions, requestOptions?: RequestOptions): Promise&lt;Page&lt;RoleAssignmentResponseShape&gt;&gt;Promise&lt;Page&lt;RoleAssignmentResponseShape&gt;&gt;
apikeyscreateclient.apikeys.create(request: CreateApiKeyRequest, requestOptions?: RequestOptions): Promise&lt;CreateApiKeyResponseShape&gt;Promise&lt;CreateApiKeyResponseShape&gt;
apikeysdeleteclient.apikeys.delete(id: string, requestOptions?: RequestOptions): Promise&lt;void&gt;Promise&lt;void&gt;
apikeysgetclient.apikeys.get(id: string, requestOptions?: RequestOptions): Promise&lt;ApiKeyResponseShape&gt;Promise&lt;ApiKeyResponseShape&gt;
apikeyslistclient.apikeys.list(options?: ApikeysListOptions, requestOptions?: RequestOptions): Promise&lt;Page&lt;ApiKeyResponseShape&gt;&gt;Promise&lt;Page&lt;ApiKeyResponseShape&gt;&gt;
apikeysupdateclient.apikeys.update(id: string, request: UpdateApiKeyRequest, requestOptions?: RequestOptions): Promise&lt;ApiKeyResponseShape&gt;Promise&lt;ApiKeyResponseShape&gt;
pingonceclient.ping.once(request: PingOnceRequest, requestOptions?: RequestOptions): Promise&lt;PingResultResponseShape&gt;Promise&lt;PingResultResponseShape&gt;
pingstreamclient.ping.stream(request: PingStreamParams, requestOptions?: RequestOptions): AsyncIterable&lt;PingEventResponseShape&gt;AsyncIterable&lt;PingEventResponseShape&gt;

Errors

All HTTP failures raise APIError subclasses. Transport failures raise NetworkError; malformed JSON or NDJSON responses raise ParseError.

ErrorMeaning
GoodMemErrorBase class for SDK errors.
NetworkErrorTransport failures, including mid-stream read failures.
ParseErrorJSON and NDJSON response parse failures.
APIErrorGeneric HTTP error; exposes statusCode, body, and response.
BadRequestErrorHTTP 400.
AuthenticationErrorHTTP 401.
PermissionDeniedErrorHTTP 403.
NotFoundErrorHTTP 404.
ConflictErrorHTTP 409.
UnprocessableEntityErrorHTTP 422.
RateLimitErrorHTTP 429; exposes retryAfter when the header is present.
InternalServerErrorHTTP 5xx.
try {
  await client.memories.get("missing-memory-id");
} catch (error) {
  if (error instanceof NotFoundError) {
    console.log("Memory not found");
  }
}

Data Models

Enum Values

ApiKeyAuthorityMode

INHERIT_SUBJECT, SCOPED

CredentialKind

CREDENTIAL_KIND_UNSPECIFIED, CREDENTIAL_KIND_API_KEY, CREDENTIAL_KIND_GCP_ADC

DashScopeApiDialect

UNSPECIFIED, EMBEDDING_NATIVE_TEXT, EMBEDDING_NATIVE_CONTENTS, LLM_NATIVE_TEXT, LLM_NATIVE_MULTIMODAL, RERANK_NATIVE_NESTED, OPENAI_COMPATIBLE, RERANK_COMPATIBLE_FLAT

LengthMeasurement

CHARACTER_COUNT, TOKEN_COUNT, CUSTOM

Modality

TEXT, IMAGE, AUDIO, VIDEO

Operation

CREATE_USER, READ_USER, UPDATE_USER, DELETE_USER, LIST_USER, MANAGE_USER_ENROLLMENT, CREATE_SERVICE_IDENTITY, READ_SERVICE_IDENTITY, UPDATE_SERVICE_IDENTITY, DELETE_SERVICE_IDENTITY, LIST_SERVICE_IDENTITY, CREATE_SPACE, READ_SPACE, UPDATE_SPACE, DELETE_SPACE, LIST_SPACE, CREATE_API_KEY, READ_API_KEY, UPDATE_API_KEY, DELETE_API_KEY, LIST_API_KEY, CREATE_EMBEDDER, READ_EMBEDDER, UPDATE_EMBEDDER, DELETE_EMBEDDER, LIST_EMBEDDER, PING_EMBEDDER, EXECUTE_EMBEDDER, READ_EMBEDDER_CREDENTIALS, CREATE_RERANKER, READ_RERANKER, UPDATE_RERANKER, DELETE_RERANKER, LIST_RERANKER, PING_RERANKER, EXECUTE_RERANKER, READ_RERANKER_CREDENTIALS, CREATE_LLM, READ_LLM, UPDATE_LLM, DELETE_LLM, LIST_LLM, PING_LLM, EXECUTE_LLM, READ_LLM_CREDENTIALS, PROXY_INFERENCE_TARGET, OCR_DOCUMENT, CREATE_MEMORY, READ_MEMORY, DELETE_MEMORY, LIST_MEMORY, CREATE_EXTENSION, READ_EXTENSION, UPDATE_EXTENSION, DELETE_EXTENSION, LIST_EXTENSION, DOWNLOAD_EXTENSION, READ_INSTANCE, TRANSFER_INSTANCE_OWNERSHIP, TRANSFER_RESOURCE_OWNERSHIP, RELOAD_LICENSE, DRAIN_SERVER, PURGE_BACKGROUND_JOBS, CREATE_RETRIEVE_MEMORY_LOG_POLICY, READ_RETRIEVE_MEMORY_LOG_POLICY, LIST_RETRIEVE_MEMORY_LOG_POLICY, DELETE_RETRIEVE_MEMORY_LOG_POLICY, MANAGE_ACCESS

ProviderType

OPENAI, VLLM, TEI, LLAMA_CPP, VOYAGE, COHERE, JINA, DASHSCOPE, GEMINI

ResourceKind

INSTANCE, USER, SERVICE_IDENTITY, SPACE, API_KEY, EMBEDDER, RERANKER, LLM, MEMORY, EXTENSION, RETRIEVE_MEMORY_LOG_POLICY

Selector

ANY, OWN, EXACT, DIRECT_MEMBERS_OF

SeparatorKeepStrategy

KEEP_NONE, KEEP_START, KEEP_END

SortOrder

ASCENDING, DESCENDING, SORT_ORDER_UNSPECIFIED

Interfaces

AccessPolicyRule

One operation, selector, and optional assigned resource.

FieldTypeRequiredDescription
operationOperationyesProtected operation.
selectorSelectoryesResource-selection semantics.
assignedResourceAccessPolicyTarget | nullnoRequired exactly for EXACT and DIRECT_MEMBERS_OF selectors.

AccessPolicyTarget

A typed access-policy target. resourceId is omitted for INSTANCE and required otherwise.

FieldTypeRequiredDescription
kindResourceKindyesConcrete target kind.
resourceIdstring | nullnoConcrete resource UUID; omitted for the singleton INSTANCE target.

ApiKeyAuth

Configuration for classic API-key authentication.

FieldTypeRequiredDescription
inlineSecretstring | nullnoSecret stored directly in GoodMem (mutually exclusive with secretRef)
secretRefSecretReference | nullnoReference to an external secret manager entry (mutually exclusive with inlineSecret)
headerNamestring | nullnoDesired HTTP header to carry the credential (defaults to Authorization)
prefixstring | nullnoOptional prefix prepended to the secret (e.g., "Bearer ")

ApiKeyResponse

API key metadata without sensitive information.

FieldTypeRequiredDescription
apiKeyIdstringyesUnique identifier for the API key.
subjectPrincipalIdstringyesPrincipal authenticated by this API key.
ownerPrincipalIdstringyesPrincipal that administratively owns this API key.
authorityModeApiKeyAuthorityModeyesImmutable authority derivation mode.
ceilingArray&lt;AccessPolicyRule&gt; | nullnoComplete immutable issuance ceiling; omitted only when ceilingOmitted is true.
ceilingOmittedbooleanyesTrue only when a BASIC list projection intentionally omitted the immutable ceiling.
keyPrefixstringyesFirst few characters of the key for display/identification purposes.
status"ACTIVE" | "INACTIVE"yesCompatibility usability status. ACTIVE means USABLE; INACTIVE combines NOT_YET_VALID, EXPIRED, and REVOKED.
lifecycleState"NOT_YET_VALID" | "USABLE" | "EXPIRED" | "REVOKED"yesPrecise lifecycle state at the response evaluation instant.
labelsRecord&lt;string, string&gt;yesUser-defined labels for organization and filtering.
expiresAtnumber | nullnoExpiration timestamp in milliseconds since epoch. If not provided, the key does not expire.
validFromnumberyesInclusive activation time in milliseconds since epoch.
revokedAtnumber | nullnoPermanent revocation time in milliseconds since epoch.
revokedByIdstring | nullnoExact audit actor UUID that revoked this key.
lastUsedAtnumber | nullnoLast time this API key was used, in milliseconds since epoch.
createdAtnumberyesWhen the API key was created, in milliseconds since epoch.
updatedAtnumberyesWhen the API key was last updated, in milliseconds since epoch.
createdByIdstringyesExact principal or API-key actor that created this API key.
updatedByIdstringyesExact principal or API-key actor that last updated this API key.

ChunkingConfiguration

Configuration for text chunking strategy used when processing content. Exactly one of none, recursive, or sentence must be provided.

FieldTypeRequiredDescription
noneNoChunkingConfiguration | nullnoNo chunking strategy - preserve original content as single unit
recursiveRecursiveChunkingConfiguration | nullnoRecursive hierarchical chunking strategy with configurable separators
sentenceSentenceChunkingConfiguration | nullnoSentence-based chunking strategy with language detection

EndpointAuthentication

Structured credential payload describing how GoodMem should authenticate with an upstream provider.

FieldTypeRequiredDescription
kindCredentialKindyesSelected credential strategy
apiKeyApiKeyAuth | nullnoConfiguration when kind is CREDENTIAL_KIND_API_KEY
gcpAdcGcpAdcAuth | nullnoConfiguration when kind is CREDENTIAL_KIND_GCP_ADC
labelsRecord&lt;string, string&gt; | nullnoOptional annotations to aid operators (e.g., "owner=vertex")

GcpAdcAuth

Configuration for Google Application Default Credentials (ADC).

FieldTypeRequiredDescription
scopesArray&lt;string&gt; | nullnoAdditional OAuth scopes. Empty list falls back to the default cloud-platform scope.
quotaProjectIdstring | nullnoOptional quota project used for billing

GoodMemInstance

The singleton GoodMem instance and its ownership audit metadata.

FieldTypeRequiredDescription
instanceIdstringyesDurable UUID of the singleton GoodMem instance.
ownerIdstringyesCurrent human owner principal UUID.
createdAtnumberyesInitialization timestamp in milliseconds since the Unix epoch.
updatedAtnumberyesMost recent ownership-transfer timestamp in milliseconds since the Unix epoch.
createdByIdstringyesPrincipal or API-key actor UUID that initialized the instance.
updatedByIdstringyesPrincipal or API-key actor UUID that last transferred ownership.

GoodMemStatus

Warning or non-fatal status with granular codes (operation continues)

FieldTypeRequiredDescription
code"GOODMEM_STATUS_CODE_UNSPECIFIED" | "INVALID_ARGUMENT" | "NOT_FOUND" | "PERMISSION_DENIED" | "FAILED_PRECONDITION" | "EMBEDDER_FAILED" | "EMBEDDER_UNAVAILABLE" | "EMBEDDER_TIMEOUT" | "VECTOR_SEARCH_FAILED" | "VECTOR_SEARCH_PARTIAL" | "VECTOR_SEARCH_TIMEOUT" | "SPACE_INACCESSIBLE" | "SPACE_NOT_FOUND" | "SPACE_NO_EMBEDDERS" | "CHUNK_NOT_FOUND" | "MEMORY_LOAD_FAILED" | "MEMORY_CONTENT_UNAVAILABLE" | "RERANKING_FAILED" | "SUMMARIZATION_FAILED" | "SUMMARIZATION_TIMEOUT" | "RATE_LIMITED" | "RESOURCE_EXHAUSTED" | "CONFIGURATION_ERROR" | "LLM_CAPABILITY_INFERRED" | "FEATURE_DISABLED"yesStatus code for the warning or informational message
messagestringyesHuman-readable status message
detailsRecord&lt;string, string&gt; | nullnoAdditional contextual details

MemoryCreationRequest

Request body for creating a new Memory. A Memory represents content stored in a space.

FieldTypeRequiredDescription
memoryIdstring | nullnoOptional client-provided UUID for the memory. If omitted, the server generates one. Returns ALREADY_EXISTS if the ID is already in use.
spaceIdstringyesID of the space where this memory will be stored
originalContentstring | nullnoOriginal content as plain text (use either this or originalContentB64)
originalContentB64string | nullnoOriginal content as base64-encoded binary data (use either this or originalContent)
originalContentRefstring | nullnoReference to external content location
contentTypestringyesMIME type of the content
metadataRecord&lt;string, unknown&gt; | nullnoAdditional metadata for the memory. A top-level textual title is an optional document-title hint for embedding providers that support one; blank or non-string titles are ignored. Later metadata edits do not automatically re-embed existing chunks.
chunkingConfigChunkingConfiguration | nullnoChunking strategy for this memory (if not provided, uses space default)
extractPageImagesboolean | nullnoOptional hint to extract page images for eligible document types (for example, PDFs)
fileFieldstring | nullnoOptional multipart file field name to bind binary content; required when multiple files are uploaded in a batch multipart request.

NoChunkingConfiguration

No chunking strategy - preserves original content as a single unit

No fields.

RecursiveChunkingConfiguration

Recursive hierarchical chunking strategy with configurable separators and overlap

FieldTypeRequiredDescription
chunkSizenumberyesMaximum size of a chunk (should be ≤ context window)
chunkOverlapnumberyesSliding overlap between chunks
separatorsArray&lt;string&gt; | nullnoHierarchical separator list (order = preference)
keepStrategySeparatorKeepStrategyyesHow to handle separators after splitting. KEEP_NONE is deprecated and behaves as KEEP_END.
separatorIsRegexboolean | nullnoWhether separators are regex patterns
lengthMeasurementLengthMeasurementyesHow to measure chunk length

SecretReference

FieldTypeRequiredDescription
uristringyesURI identifying where the secret can be resolved (e.g., vault://, env://)
hintsRecord&lt;string, string&gt; | nullnoOptional metadata to help resolvers decode the secret (e.g., {"encoding":"base64"})

SentenceChunkingConfiguration

Sentence-based chunking strategy with language detection support

FieldTypeRequiredDescription
maxChunkSizenumberyesMaximum size of a chunk
minChunkSizenumberyesMinimum size before creating a new chunk
enableLanguageDetectionboolean | nullnoWhether to detect language for better segmentation
lengthMeasurementLengthMeasurementyesHow to measure chunk length

SystemInitRequest

Request for initializing the system. No parameters required.

No fields.

TransferOwnershipRequest

Names the principal that will become the resource owner.

FieldTypeRequiredDescription
newOwnerIdstringyesExisting principal UUID that will become the new owner.

Response Shapes

Response shape types model values returned by the SDK after forward-compatible unknown enum strings are coerced to null.

AccessPolicyRuleResponseShape

FieldTypeRequiredDescription
operationOperation | nullyesProtected operation.
selectorSelector | nullyesResource-selection semantics.
assignedResourceAccessPolicyTargetResponseShape | nullnoRequired exactly for EXACT and DIRECT_MEMBERS_OF selectors.

AccessPolicyTargetResponseShape

FieldTypeRequiredDescription
kindResourceKind | nullyesConcrete target kind.
resourceIdstring | nullnoConcrete resource UUID; omitted for the singleton INSTANCE target.

ApiKeyAuthResponseShape

Type constraint: ApiKeyAuthResponseShape = RequireExactlyOne&lt;ApiKeyAuthResponseShapeBase, "inlineSecret" \| "secretRef"&gt;

FieldTypeRequiredDescription
inlineSecretstring | nullnoSecret stored directly in GoodMem (mutually exclusive with secretRef)
secretRefSecretReferenceResponseShape | nullnoReference to an external secret manager entry (mutually exclusive with inlineSecret)
headerNamestring | nullnoDesired HTTP header to carry the credential (defaults to Authorization)
prefixstring | nullnoOptional prefix prepended to the secret (e.g., "Bearer ")

ApiKeyResponseShape

FieldTypeRequiredDescription
apiKeyIdstringyesUnique identifier for the API key.
subjectPrincipalIdstringyesPrincipal authenticated by this API key.
ownerPrincipalIdstringyesPrincipal that administratively owns this API key.
authorityModeApiKeyAuthorityMode | nullyesImmutable authority derivation mode.
ceilingArray&lt;AccessPolicyRuleResponseShape&gt; | nullnoComplete immutable issuance ceiling; omitted only when ceilingOmitted is true.
ceilingOmittedbooleanyesTrue only when a BASIC list projection intentionally omitted the immutable ceiling.
keyPrefixstringyesFirst few characters of the key for display/identification purposes.
status"ACTIVE" | "INACTIVE" | nullyesCompatibility usability status. ACTIVE means USABLE; INACTIVE combines NOT_YET_VALID, EXPIRED, and REVOKED.
lifecycleState"NOT_YET_VALID" | "USABLE" | "EXPIRED" | "REVOKED" | nullyesPrecise lifecycle state at the response evaluation instant.
labelsRecord&lt;string, string&gt;yesUser-defined labels for organization and filtering.
expiresAtnumber | nullnoExpiration timestamp in milliseconds since epoch. If not provided, the key does not expire.
validFromnumberyesInclusive activation time in milliseconds since epoch.
revokedAtnumber | nullnoPermanent revocation time in milliseconds since epoch.
revokedByIdstring | nullnoExact audit actor UUID that revoked this key.
lastUsedAtnumber | nullnoLast time this API key was used, in milliseconds since epoch.
createdAtnumberyesWhen the API key was created, in milliseconds since epoch.
updatedAtnumberyesWhen the API key was last updated, in milliseconds since epoch.
createdByIdstringyesExact principal or API-key actor that created this API key.
updatedByIdstringyesExact principal or API-key actor that last updated this API key.

ChunkingConfigurationResponseShape

Type constraint: ChunkingConfigurationResponseShape = RequireExactlyOne&lt;ChunkingConfigurationResponseShapeBase, "none" \| "recursive" \| "sentence"&gt;

FieldTypeRequiredDescription
noneNoChunkingConfigurationResponseShape | nullnoNo chunking strategy - preserve original content as single unit
recursiveRecursiveChunkingConfigurationResponseShape | nullnoRecursive hierarchical chunking strategy with configurable separators
sentenceSentenceChunkingConfigurationResponseShape | nullnoSentence-based chunking strategy with language detection

EndpointAuthenticationResponseShape

Type constraint: discriminated union on kind with response-shaped credential payloads; kind: null is allowed for unknown server enum values.

FieldTypeRequiredDescription
kindCredentialKind | nullyesSelected credential strategy
apiKeyApiKeyAuthResponseShape | nullnoConfiguration when kind is CREDENTIAL_KIND_API_KEY
gcpAdcGcpAdcAuthResponseShape | nullnoConfiguration when kind is CREDENTIAL_KIND_GCP_ADC
labelsRecord&lt;string, string&gt; | nullnoOptional annotations to aid operators (e.g., "owner=vertex")

GcpAdcAuthResponseShape

FieldTypeRequiredDescription
scopesArray&lt;string&gt; | nullnoAdditional OAuth scopes. Empty list falls back to the default cloud-platform scope.
quotaProjectIdstring | nullnoOptional quota project used for billing

GoodMemInstanceResponseShape

FieldTypeRequiredDescription
instanceIdstringyesDurable UUID of the singleton GoodMem instance.
ownerIdstringyesCurrent human owner principal UUID.
createdAtnumberyesInitialization timestamp in milliseconds since the Unix epoch.
updatedAtnumberyesMost recent ownership-transfer timestamp in milliseconds since the Unix epoch.
createdByIdstringyesPrincipal or API-key actor UUID that initialized the instance.
updatedByIdstringyesPrincipal or API-key actor UUID that last transferred ownership.

GoodMemStatusResponseShape

FieldTypeRequiredDescription
code"GOODMEM_STATUS_CODE_UNSPECIFIED" | "INVALID_ARGUMENT" | "NOT_FOUND" | "PERMISSION_DENIED" | "FAILED_PRECONDITION" | "EMBEDDER_FAILED" | "EMBEDDER_UNAVAILABLE" | "EMBEDDER_TIMEOUT" | "VECTOR_SEARCH_FAILED" | "VECTOR_SEARCH_PARTIAL" | "VECTOR_SEARCH_TIMEOUT" | "SPACE_INACCESSIBLE" | "SPACE_NOT_FOUND" | "SPACE_NO_EMBEDDERS" | "CHUNK_NOT_FOUND" | "MEMORY_LOAD_FAILED" | "MEMORY_CONTENT_UNAVAILABLE" | "RERANKING_FAILED" | "SUMMARIZATION_FAILED" | "SUMMARIZATION_TIMEOUT" | "RATE_LIMITED" | "RESOURCE_EXHAUSTED" | "CONFIGURATION_ERROR" | "LLM_CAPABILITY_INFERRED" | "FEATURE_DISABLED" | nullyesStatus code for the warning or informational message
messagestringyesHuman-readable status message
detailsRecord&lt;string, string&gt; | nullnoAdditional contextual details

NoChunkingConfigurationResponseShape

No fields.

RecursiveChunkingConfigurationResponseShape

FieldTypeRequiredDescription
chunkSizenumberyesMaximum size of a chunk (should be ≤ context window)
chunkOverlapnumberyesSliding overlap between chunks
separatorsArray&lt;string&gt; | nullnoHierarchical separator list (order = preference)
keepStrategySeparatorKeepStrategy | nullyesHow to handle separators after splitting. KEEP_NONE is deprecated and behaves as KEEP_END.
separatorIsRegexboolean | nullnoWhether separators are regex patterns
lengthMeasurementLengthMeasurement | nullyesHow to measure chunk length

SecretReferenceResponseShape

FieldTypeRequiredDescription
uristringyesURI identifying where the secret can be resolved (e.g., vault://, env://)
hintsRecord&lt;string, string&gt; | nullnoOptional metadata to help resolvers decode the secret (e.g., {"encoding":"base64"})

SentenceChunkingConfigurationResponseShape

FieldTypeRequiredDescription
maxChunkSizenumberyesMaximum size of a chunk
minChunkSizenumberyesMinimum size before creating a new chunk
enableLanguageDetectionboolean | nullnoWhether to detect language for better segmentation
lengthMeasurementLengthMeasurement | nullyesHow to measure chunk length