GoodMemGoodMem

Admin

Server lifecycle operations.

Methods on this page are called through client.admin.

client.admin.backgroundJobsPurge

client.admin.backgroundJobsPurge(request: AdminPurgeJobsRequest, requestOptions?: RequestOptions): Promise<AdminPurgeJobsResponseShape>

Deletes terminal background jobs older than a retention cutoff.

HTTP: POST /v1/admin/background-jobs:purge

Parameters

ParameterTypeDescription
requestAdminPurgeJobsRequestRequest body.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;AdminPurgeJobsResponseShape&gt;

Example

const purge = await client.admin.backgroundJobsPurge({
  olderThan: "2026-01-01T00:00:00Z",
  dryRun: true,
});
console.log(purge.jobsPurged);

client.admin.drain

client.admin.drain(request: AdminDrainRequest, requestOptions?: RequestOptions): Promise<AdminDrainResponseShape>

Initiates drain mode and optionally waits for the server to quiesce.

HTTP: POST /v1/admin:drain

Parameters

ParameterTypeDescription
requestAdminDrainRequestRequest body.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;AdminDrainResponseShape&gt;

Example

const drain = await client.admin.drain({
  reason: "maintenance",
  waitForQuiesce: false,
});
console.log(drain.state);

client.admin.licenseReload

client.admin.licenseReload(requestOptions?: RequestOptions): Promise<AdminReloadLicenseResponseShape>

Triggers the server to reload its license file from the configured directory and returns metadata about the currently active license.

HTTP: POST /v1/admin/license:reload

Parameters

ParameterTypeDescription
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;AdminReloadLicenseResponseShape&gt;

Example

const license = await client.admin.licenseReload();
console.log(license.status);

client.admin.retrieveMemoryLogPoliciesCreate

client.admin.retrieveMemoryLogPoliciesCreate(request: CreateRetrieveMemoryLogPolicyRequest, requestOptions?: RequestOptions): Promise<RetrieveMemoryLogPolicyResponseShape>

Creates an immutable administrative policy that can automatically enable durable RetrieveMemory request logging.

HTTP: POST /v1/admin/retrieve-memory-log-policies

Parameters

ParameterTypeDescription
requestCreateRetrieveMemoryLogPolicyRequestRequest body.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;RetrieveMemoryLogPolicyResponseShape&gt;

Example

const policy = await client.admin.retrieveMemoryLogPoliciesCreate({
  displayName: "Log all retrieve requests",
  condition: { matchAll: true },
  labels: { env: "docs" },
});

client.admin.retrieveMemoryLogPoliciesDelete

client.admin.retrieveMemoryLogPoliciesDelete(id: string, request: DeleteRetrieveMemoryLogPolicyRequest, requestOptions?: RequestOptions): Promise<RetrieveMemoryLogPolicyResponseShape>

Idempotently tombstones an immutable RetrieveMemory log policy.

HTTP: DELETE /v1/admin/retrieve-memory-log-policies/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringThe UUID of the policy to delete
requestDeleteRetrieveMemoryLogPolicyRequestRequest body.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;RetrieveMemoryLogPolicyResponseShape&gt;

Example

await client.admin.retrieveMemoryLogPoliciesDelete("your-policy-id", {
  reason: "No longer needed",
});

client.admin.retrieveMemoryLogPoliciesGet

client.admin.retrieveMemoryLogPoliciesGet(id: string, options?: AdminRetrieveMemoryLogPoliciesGetOptions, requestOptions?: RequestOptions): Promise<RetrieveMemoryLogPolicyResponseShape>

Retrieves a live RetrieveMemory log policy by UUID, or a tombstoned policy when includeDeleted is true.

HTTP: GET /v1/admin/retrieve-memory-log-policies/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringThe UUID of the policy to retrieve
optionsAdminRetrieveMemoryLogPoliciesGetOptions optionalOptional query parameters.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;RetrieveMemoryLogPolicyResponseShape&gt;

Example

const fetchedPolicy = await client.admin.retrieveMemoryLogPoliciesGet("your-policy-id", {
  includeDeleted: false,
});
console.log(fetchedPolicy.displayName);

client.admin.retrieveMemoryLogPoliciesList

client.admin.retrieveMemoryLogPoliciesList(options?: AdminRetrieveMemoryLogPoliciesListOptions, requestOptions?: RequestOptions): Promise<Page<RetrieveMemoryLogPolicyResponseShape>>

Lists RetrieveMemory log policies with optional tombstone, active-time, name, label, sort, and pagination filters. LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).

HTTP: GET /v1/admin/retrieve-memory-log-policies

Parameters

ParameterTypeDescription
optionsAdminRetrieveMemoryLogPoliciesListOptions optionalOptional query parameters.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;Page&lt;RetrieveMemoryLogPolicyResponseShape&gt;&gt;

Example

for await (const item of await client.admin.retrieveMemoryLogPoliciesList({ maxResults: 10 })) {
  console.log(item.policyId, item.displayName);
}

Data Models

Enum Values

PurgeableBackgroundJobStatus

BACKGROUND_JOB_SUCCEEDED, BACKGROUND_JOB_FAILED, BACKGROUND_JOB_CANCELED

Interfaces

ActiveLicenseMetadata

FieldTypeRequiredDescription
filenamestringyesFilename of the active license on disk.
sha256stringyesHex-encoded SHA-256 hash of the active license file.
sizeBytesnumberyesSize of the active license file in bytes.
modifiedAtstringyesLast modification timestamp of the active license file.

AdminDrainRequest

FieldTypeRequiredDescription
timeoutSecnumber | nullnoMaximum seconds to wait for the server to quiesce before returning.
reasonstring | nullnoHuman-readable reason for initiating drain mode.
waitForQuiesceboolean | nullnoIf true, wait for in-flight requests to complete and the server to reach QUIESCED before responding.

AdminDrainResponse

FieldTypeRequiredDescription
state"STARTING" | "READY" | "DRAINING" | "QUIESCED"noLifecycle state reported after the drain request was processed.
quiescedbooleanyesWhether the server has reached the QUIESCED lifecycle state.
messagestringnoHuman-readable status message describing the drain outcome.

AdminPurgeJobsRequest

FieldTypeRequiredDescription
olderThanstringyesISO-8601 timestamp cutoff; only terminal jobs older than this instant are eligible.
statusesArray&lt;PurgeableBackgroundJobStatus&gt;noOptional terminal background job statuses to target for purging. If omitted, all terminal statuses are eligible. Canonical values are BACKGROUND_JOB_SUCCEEDED, BACKGROUND_JOB_FAILED, and BACKGROUND_JOB_CANCELED. Short aliases SUCCEEDED, FAILED, and CANCELED are also accepted for compatibility.
dryRunbooleannoIf true, report purge counts without deleting any rows.
limitnumbernoMaximum number of jobs to purge in this request. Must be >= 0; 0 means no limit.

AdminPurgeJobsResponse

FieldTypeRequiredDescription
jobsPurgednumberyesNumber of background job rows removed, or that would be removed during dry-run.
attemptsPurgednumberyesNumber of background job attempt rows removed.
referencesPurgednumberyesNumber of background job reference rows removed.
dryRunbooleanyesWhether the purge executed in dry-run mode.

AdminReloadLicenseResponse

FieldTypeRequiredDescription
status"LOADED" | "UNCHANGED" | "FAILED" | "NOT_FOUND"yesOutcome of the reload attempt, such as LOADED, UNCHANGED, FAILED, or NOT_FOUND.
messagestringyesHuman-readable message describing the reload result.
activeLicenseActiveLicenseMetadatanoMetadata for the currently active license after reload, or null if no license is active.

CreateRetrieveMemoryLogPolicyRequest

REST request for creating an immutable RetrieveMemory log policy.

FieldTypeRequiredDescription
policyIdstring | nullnoOptional client-provided policy UUID.
displayNamestringyesHuman-readable policy name.
descriptionstring | nullnoOptional operator description.
conditionRetrieveMemoryLogPolicyConditionyesPolicy match condition.
activeFromnumber | nullnoInclusive activation time in milliseconds since epoch.
activeUntilnumber | nullnoExclusive deactivation time in milliseconds since epoch.
labelsRecord&lt;string, string&gt; | nullnoOperator labels for listing and administration.

DeleteRetrieveMemoryLogPolicyRequest

Optional REST body for tombstoning a RetrieveMemory log policy.

FieldTypeRequiredDescription
reasonstring | nullnoOptional tombstone reason.

ListRetrieveMemoryLogPoliciesResponse

REST response containing a page of RetrieveMemory log policies.

FieldTypeRequiredDescription
policiesArray&lt;RetrieveMemoryLogPolicy&gt;yesPolicy page.
nextTokenstring | nullnoOpaque token for the next page.

RetrieveMemoryLogPolicy

REST representation of an immutable RetrieveMemory log policy.

FieldTypeRequiredDescription
policyIdstringyesPolicy UUID.
displayNamestringyesHuman-readable policy name.
descriptionstring | nullnoOptional operator description.
conditionRetrieveMemoryLogPolicyConditionyesPolicy match condition.
activeFromnumberyesInclusive activation time in milliseconds since epoch.
activeUntilnumber | nullnoExclusive deactivation time in milliseconds since epoch.
labelsRecord&lt;string, string&gt;yesOperator labels for listing and administration.
currentlyActivebooleanyesWhether the policy is active at response evaluation time.
deletedAtnumber | nullnoTombstone time in milliseconds since epoch.
deletedByIdstring | nullnoUser UUID that tombstoned the policy.
deleteReasonstring | nullnoOptional tombstone reason.
createdAtnumberyesCreation time in milliseconds since epoch.
updatedAtnumberyesUpdate time in milliseconds since epoch.
createdByIdstringyesCreator user UUID.
updatedByIdstringyesLast-updater user UUID.

RetrieveMemoryLogPolicyCondition

RetrieveMemory log policy condition. Set matchAll=true to match every authenticated RetrieveMemory request and do not provide anyOf clauses. Otherwise, anyOf is required and must contain at least one non-empty scoped clause.

FieldTypeRequiredDescription
matchAllboolean | nullnoWhen true, match every authenticated RetrieveMemory request. Must be omitted or false when anyOf contains clauses. Defaults to false when omitted.
anyOfArray&lt;RetrieveMemoryLogPolicyConditionClause&gt; | nullnoOR clauses used for scoped matching. Required and non-empty when matchAll is false or omitted. Must be omitted or empty when matchAll is true. Each clause must include at least one match dimension.

RetrieveMemoryLogPolicyConditionClause

One OR clause in a RetrieveMemory log policy condition. All populated dimensions in the clause must match; clauses are ORed together.

FieldTypeRequiredDescription
requestorUserIdsArray&lt;string&gt; | nullnoAuthenticated requestor user UUID strings.
apiKeyIdsArray&lt;string&gt; | nullnoAPI key UUID strings used to authenticate RetrieveMemory requests.
spaceIdsArray&lt;string&gt; | nullnoPost-permission accessible space UUID strings.
apiKeyLabelSelectorsRecord&lt;string, string&gt; | nullnoExact API-key label selectors that must all match.
spaceLabelSelectorsRecord&lt;string, string&gt; | nullnoExact space label selectors that must match at least one accessible space.

Response Shapes

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

ActiveLicenseMetadataResponseShape

FieldTypeRequiredDescription
filenamestringyesFilename of the active license on disk.
sha256stringyesHex-encoded SHA-256 hash of the active license file.
sizeBytesnumberyesSize of the active license file in bytes.
modifiedAtstringyesLast modification timestamp of the active license file.

AdminDrainResponseShape

FieldTypeRequiredDescription
state"STARTING" | "READY" | "DRAINING" | "QUIESCED" | nullnoLifecycle state reported after the drain request was processed.
quiescedbooleanyesWhether the server has reached the QUIESCED lifecycle state.
messagestringnoHuman-readable status message describing the drain outcome.

AdminPurgeJobsResponseShape

FieldTypeRequiredDescription
jobsPurgednumberyesNumber of background job rows removed, or that would be removed during dry-run.
attemptsPurgednumberyesNumber of background job attempt rows removed.
referencesPurgednumberyesNumber of background job reference rows removed.
dryRunbooleanyesWhether the purge executed in dry-run mode.

AdminReloadLicenseResponseShape

FieldTypeRequiredDescription
status"LOADED" | "UNCHANGED" | "FAILED" | "NOT_FOUND" | nullyesOutcome of the reload attempt, such as LOADED, UNCHANGED, FAILED, or NOT_FOUND.
messagestringyesHuman-readable message describing the reload result.
activeLicenseActiveLicenseMetadataResponseShapenoMetadata for the currently active license after reload, or null if no license is active.

ListRetrieveMemoryLogPoliciesResponseShape

FieldTypeRequiredDescription
policiesArray&lt;RetrieveMemoryLogPolicyResponseShape&gt;yesPolicy page.
nextTokenstring | nullnoOpaque token for the next page.

RetrieveMemoryLogPolicyResponseShape

FieldTypeRequiredDescription
policyIdstringyesPolicy UUID.
displayNamestringyesHuman-readable policy name.
descriptionstring | nullnoOptional operator description.
conditionRetrieveMemoryLogPolicyConditionResponseShapeyesPolicy match condition.
activeFromnumberyesInclusive activation time in milliseconds since epoch.
activeUntilnumber | nullnoExclusive deactivation time in milliseconds since epoch.
labelsRecord&lt;string, string&gt;yesOperator labels for listing and administration.
currentlyActivebooleanyesWhether the policy is active at response evaluation time.
deletedAtnumber | nullnoTombstone time in milliseconds since epoch.
deletedByIdstring | nullnoUser UUID that tombstoned the policy.
deleteReasonstring | nullnoOptional tombstone reason.
createdAtnumberyesCreation time in milliseconds since epoch.
updatedAtnumberyesUpdate time in milliseconds since epoch.
createdByIdstringyesCreator user UUID.
updatedByIdstringyesLast-updater user UUID.

RetrieveMemoryLogPolicyConditionResponseShape

FieldTypeRequiredDescription
matchAllboolean | nullnoWhen true, match every authenticated RetrieveMemory request. Must be omitted or false when anyOf contains clauses. Defaults to false when omitted.
anyOfArray&lt;RetrieveMemoryLogPolicyConditionClauseResponseShape&gt; | nullnoOR clauses used for scoped matching. Required and non-empty when matchAll is false or omitted. Must be omitted or empty when matchAll is true. Each clause must include at least one match dimension.

RetrieveMemoryLogPolicyConditionClauseResponseShape

FieldTypeRequiredDescription
requestorUserIdsArray&lt;string&gt; | nullnoAuthenticated requestor user UUID strings.
apiKeyIdsArray&lt;string&gt; | nullnoAPI key UUID strings used to authenticate RetrieveMemory requests.
spaceIdsArray&lt;string&gt; | nullnoPost-permission accessible space UUID strings.
apiKeyLabelSelectorsRecord&lt;string, string&gt; | nullnoExact API-key label selectors that must all match.
spaceLabelSelectorsRecord&lt;string, string&gt; | nullnoExact space label selectors that must match at least one accessible space.