GoodMemGoodMem

Memories

Memory CRUD, retrieval, and batch operations.

Methods on this page are called through client.memories.

client.memories.batchCreate

client.memories.batchCreate(request: JsonBatchMemoryCreationRequest, requestOptions?: RequestOptions): Promise<BatchMemoryResponseShape>

Creates multiple memories in a single operation, with individual success/failure results.

HTTP: POST /v1/memories:batchCreate

Parameters

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

Returns: Promise&lt;BatchMemoryResponseShape&gt;

Example

const batchCreate = await client.memories.batchCreate({
  requests: [
    { spaceId: "your-space-id", originalContent: "First memory" },
    { spaceId: "your-space-id", originalContent: "Second memory" },
  ],
});
console.log(batchCreate.results.length);

client.memories.batchDelete

client.memories.batchDelete(request: BatchMemoryDeletionRequest, requestOptions?: RequestOptions): Promise<BatchMemoryResponseShape>

Deletes memories using selector entries. Each selector can target either a specific memory ID or a filtered subset scoped to a specific space.

HTTP: POST /v1/memories:batchDelete

Parameters

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

Returns: Promise&lt;BatchMemoryResponseShape&gt;

Example

await client.memories.batchDelete({
  requests: [
    { memoryId: "your-memory-id-1" },
    { memoryId: "your-memory-id-2" },
  ],
});

client.memories.batchGet

client.memories.batchGet(request: BatchMemoryRetrievalRequest, requestOptions?: RequestOptions): Promise<BatchMemoryResponseShape>

Retrieves multiple memories in a single operation, with individual success/failure results.

HTTP: POST /v1/memories:batchGet

Parameters

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

Returns: Promise&lt;BatchMemoryResponseShape&gt;

Example

const batchGet = await client.memories.batchGet({
  memoryIds: ["your-memory-id-1", "your-memory-id-2"],
  includeContent: false,
});
console.log(batchGet.results.length);

client.memories.content

client.memories.content(id: string, requestOptions?: RequestOptions): Promise<Uint8Array>

Returns the original binary payload for a memory. The response uses the memory's stored content type when available. Returns 404 when the memory does not have inline content; clients can check originalContentRef from the metadata endpoint to locate external content.

HTTP: GET /v1/memories/&#123;id&#125;/content

Parameters

ParameterTypeDescription
idstringThe UUID of the memory to download
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;Uint8Array&gt;

Example

const content = await client.memories.content("your-memory-id");
console.log(new TextDecoder().decode(content));

client.memories.create

client.memories.create(request: JsonMemoryCreationRequest, requestOptions?: RequestOptions): Promise<MemoryResponseShape>

Creates a new memory in a specified space and starts asynchronous processing. The memory begins in PENDING status while a background job performs chunking and embedding generation. IDEMPOTENCY: If memoryId is omitted, the server generates a new UUID and retries are not idempotent. If the client supplies a stable memoryId, the operation behaves as create-if-absent: the first request creates the memory and subsequent retries return HTTP 409 Conflict (ALREADY_EXISTS) rather than creating duplicates. Returns INVALID_ARGUMENT if space_id, original_content, or content_type is missing or invalid. Returns NOT_FOUND if the specified space does not exist. Requires CREATE_MEMORY_OWN permission for spaces you own (or CREATE_MEMORY_ANY for admin users to create in any space). Side effects include creating the memory record and enqueuing a background processing job.

HTTP: POST /v1/memories

Parameters

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

Returns: Promise&lt;MemoryResponseShape&gt;

Example

Example 1:

const memory = await client.memories.create({
  spaceId: "your-space-id",
  originalContent: "GoodMem stores and retrieves vectorized memories for RAG.",
  metadata: { source: "docs" },
});

Example 2:

const minimalPdf = `%PDF-1.4
1 0 obj
<< /Type /Catalog /Pages 2 0 R >>
endobj
2 0 obj
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
endobj
3 0 obj
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Resources << /Font << /F1 5 0 R >> >> /Contents 4 0 R >>
endobj
4 0 obj
<< /Length 51 >>
stream
BT /F1 12 Tf 72 720 Td (GoodMem example PDF) Tj ET
endstream
endobj
5 0 obj
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
endobj
xref
0 6
0000000000 65535 f
0000000009 00000 n
0000000058 00000 n
0000000115 00000 n
0000000241 00000 n
0000000341 00000 n
trailer
<< /Size 6 /Root 1 0 R >>
startxref
411
%%EOF
`;
const pdfFile = new Blob([minimalPdf], { type: "application/pdf" });
  const pdfMemory = await client.memories.createFromFile({
    spaceId: "your-space-id",
    file: pdfFile,
    filename: "guide.pdf",
    metadata: { source: "FILE" },
    extractPageImages: true,
  });

Example 3:

const referencedMemory = await client.memories.create({
  spaceId: "your-space-id",
  originalContent: "Content mirrored from external storage.",
  originalContentRef: "s3://bucket/object.txt",
  metadata: { source: "external" },
});

client.memories.delete

client.memories.delete(id: string, requestOptions?: RequestOptions): Promise<void>

Permanently deletes a memory and its associated chunks. This operation cannot be undone and immediately removes the memory record from the database. IDEMPOTENCY: This operation is safe to retry - may return NOT_FOUND if the memory was already deleted or never existed. Requires DELETE_MEMORY_OWN permission for memories in spaces you own (or DELETE_MEMORY_ANY for admin users to delete any memory). Side effects include permanent removal of the memory record and all associated chunk data.

HTTP: DELETE /v1/memories/&#123;id&#125;

Parameters

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

Returns: Promise&lt;void&gt;

Example

await client.memories.delete("your-memory-id");

client.memories.get

client.memories.get(id: string, options?: MemoriesGetOptions, requestOptions?: RequestOptions): Promise<MemoryResponseShape>

Retrieves a single memory by its ID. PERMISSION CLARIFICATION: With READ_MEMORY_OWN permission, access is granted if you own the parent space OR if the parent space is public (public_read=true). With READ_MEMORY_ANY permission, you can access any memory regardless of ownership. This is a read-only operation with no side effects and is safe to retry. Returns NOT_FOUND if the memory or its parent space does not exist.

HTTP: GET /v1/memories/&#123;id&#125;

Parameters

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

Returns: Promise&lt;MemoryResponseShape&gt;

Example

const fetchedMemory = await client.memories.get("your-memory-id", {
  includeContent: true,
});
console.log(fetchedMemory.processingStatus);

client.memories.list

client.memories.list(spaceId: string, options?: MemoriesListOptions, requestOptions?: RequestOptions): Promise<Page<MemoryResponseShape>>

Lists all memories within a given space. Pagination is supported via maxResults and nextToken (opaque). nextToken is a URL-safe Base64 string without padding; do not parse or construct it. This is a read-only operation with no side effects and is safe to retry. Requires LIST_MEMORY_OWN or LIST_MEMORY_ANY permission. Returns NOT_FOUND if the specified space does not exist.

HTTP: GET /v1/spaces/&#123;spaceId&#125;/memories

Parameters

ParameterTypeDescription
spaceIdstringThe UUID of the space containing the memories
optionsMemoriesListOptions optionalOptional query parameters.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

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

Example

Example 1:

for await (const item of await client.memories.list("your-space-id")) {
  console.log(item.memoryId, item.processingStatus);
}

Example 2:

for await (const item of await client.memories.list("your-space-id", {
  filter: 'metadata.source == "docs"',
  maxResults: 10,
})) {
  console.log(item.memoryId);
}

client.memories.pages

client.memories.pages(id: string, options?: MemoriesPagesOptions, requestOptions?: RequestOptions): Promise<Page<MemoryPageImageResponseShape>>

Lists extracted page-image metadata for a memory with optional filters and pagination.

HTTP: GET /v1/memories/&#123;id&#125;/pages

Parameters

ParameterTypeDescription
idstringMemory UUID
optionsMemoriesPagesOptions optionalOptional query parameters.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

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

Example

for await (const image of await client.memories.pages("your-memory-id", { maxResults: 10 })) {
  console.log(image.pageIndex, image.contentType);
}

client.memories.pagesImage

client.memories.pagesImage(id: string, pageIndex: number, options?: MemoriesPagesImageOptions, requestOptions?: RequestOptions): Promise<Uint8Array>

Downloads inline bytes for one page image. The page index is required. The optional dpi and content type query parameters act as rendition filters; if omitted, the server returns the unique rendition for that page or rejects ambiguous matches.

HTTP: GET /v1/memories/&#123;id&#125;/pages/&#123;pageIndex&#125;/image

Parameters

ParameterTypeDescription
idstringMemory UUID
pageIndexnumber0-based page index
optionsMemoriesPagesImageOptions optionalOptional query parameters.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;Uint8Array&gt;

Example

const pageImage = await client.memories.pagesImage("your-memory-id", 0, {
  contentType: "image/png",
});
console.log(pageImage.byteLength);

client.memories.retrieve

client.memories.retrieve(request: MemoriesRetrieveParams, requestOptions?: RequestOptions): AsyncIterable<RetrieveMemoryEventResponseShape>

Streams semantic retrieval results with full feature support including context items and embedder weight overrides, per-space filters, and request-level HNSW tuning.

HTTP: POST /v1/memories:retrieve

Parameters

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

Returns: AsyncIterable&lt;RetrieveMemoryEventResponseShape&gt;

Example

Example 1:

for await (const event of client.memories.retrieve("What is GoodMem?", {
  spaceIds: ["your-space-id"],
  requestedSize: 5,
})) {
  console.log(event.retrievedItem?.chunk?.chunk.chunkText);
}

Example 2:

for await (const event of client.memories.retrieve("Summarize the memories.", {
  spaceIds: ["your-space-id"],
  llmId: "your-llm-id",
  outputBudget: { tokens: 2048 },
})) {
  console.log(event.abstractReply?.text);
}

Example 3:

for await (const event of client.memories.retrieve("What is GoodMem?", {
  spaceIds: ["your-space-id"],
  requestedSize: 5,
  logging: {
    enabled: true,
    callerAttributes: {
      testCase: "docs_logging_opt_in",
      attempt: 1,
    },
  },
})) {
  console.log(event.retrievedItem?.chunk?.chunk.chunkText);
}

Data Models

Enum Values

HnswIterativeScan

ITERATIVE_SCAN_UNSPECIFIED, ITERATIVE_SCAN_OFF, ITERATIVE_SCAN_RELAXED_ORDER, ITERATIVE_SCAN_STRICT_ORDER

Interfaces

AbstractReply

Generated abstractive reply with relevance information

FieldTypeRequiredDescription
textstringyesGenerated abstractive reply text
relevanceScorenumberyesRelevance score for this reply (0.0 to 1.0)
resultSetIdstring | nullnoOptional result set ID linking this abstract to a specific result set

BackgroundJobAttempt

Telemetry captured for a single execution attempt of a background job

FieldTypeRequiredDescription
attemptIdnumberyesIdentifier of the attempt
jobIdnumberyesIdentifier of the job that owns this attempt
startedAtnumber | nullnoAttempt start timestamp (milliseconds since epoch)
finishedAtnumber | nullnoAttempt completion timestamp (milliseconds since epoch)
okboolean | nullnoIndicates whether the attempt succeeded (null if still running)
workerIdstring | nullnoIdentifier of the worker processing the attempt
statusMessagestring | nullnoLatest status message reported by the worker
progressCurrentnumberyesCurrent progress counter value
progressTotalnumber | nullnoTotal progress target when known
progressUnitstring | nullnoUnit label associated with the progress counters
progressUpdatedAtnumber | nullnoTimestamp when progress was last updated (milliseconds since epoch)
errorMessagestring | nullnoShort error message recorded when the attempt failed
errorStacktracestring | nullnoStack trace captured when the attempt failed, if available

BackgroundJobSummary

Summary of the most recent background job execution for a resource

FieldTypeRequiredDescription
jobIdnumberyesDatabase identifier of the background job
jobTypestringyesLogical job type dispatched by the background job framework
status"BACKGROUND_JOB_STATUS_UNSPECIFIED" | "BACKGROUND_JOB_PENDING" | "BACKGROUND_JOB_RUNNING" | "BACKGROUND_JOB_SUCCEEDED" | "BACKGROUND_JOB_FAILED" | "BACKGROUND_JOB_CANCELED"yesCurrent status of the background job
attemptsnumberyesNumber of attempts started so far
maxAttemptsnumberyesMaximum number of attempts allowed for this job
runAtnumber | nullnoTimestamp when the job becomes eligible to run (milliseconds since epoch)
leaseUntilnumber | nullnoLease expiration timestamp if the job is currently running (milliseconds since epoch)
lockedBystring | nullnoIdentifier of the worker currently holding the lease, if any
lastErrorstring | nullnoMost recent short error message if the job failed
updatedAtnumber | nullnoTimestamp when the job row was last updated (milliseconds since epoch)

BatchDeleteMemorySelectorRequest

A single delete selector: either memoryId or filterSelector

FieldTypeRequiredDescription
memoryIdstring | nullnoDeletes one specific memory by UUID
filterSelectorFilteredDeleteMemorySelectorRequest | nullnoDeletes a filtered set of memories within a specific space

BatchMemoryDeletionRequest

Request body for deleting memories using ID and/or filtered selectors

FieldTypeRequiredDescription
requestsArray&lt;BatchDeleteMemorySelectorRequest&gt;yesArray of delete selectors

BatchMemoryResponse

Response containing per-item results for a batch memories operation

FieldTypeRequiredDescription
resultsArray&lt;BatchMemoryResult&gt;yesArray of per-item results
totalDeletednumbernoTotal number of memories deleted across all selectors

BatchMemoryResult

Individual item result for a batch memories operation

FieldTypeRequiredDescription
successbooleanyesWhether this individual operation succeeded
memoryIdstring | nullnoMemory ID associated with this result (present for batchGet errors and batchDelete results)
memoryMemory | nullnoCreated or retrieved memory (present when the operation returns a memory on success)
errorErrorDetail | nullnoError details when success is false
requestIndexnumberno0-based index into the original batch request selectors
deletedCountnumbernoNumber of rows deleted by this selector

BatchMemoryRetrievalRequest

Request body for retrieving multiple memories by their IDs

FieldTypeRequiredDescription
memoryIdsArray&lt;string&gt;yesArray of memory IDs to retrieve
includeContentboolean | nullnoWhether to include the original content in the response
includeProcessingHistoryboolean | nullnoWhether to include background job processing history for each memory

BinaryContent

Binary content with MIME type for context items.

FieldTypeRequiredDescription
contentTypestringyesMIME type of the binary content.
datastringyesBase64-encoded binary data.

ChunkReference

Reference to a memory chunk with pointer to its parent memory

FieldTypeRequiredDescription
resultSetIdstringyesResult set ID that produced this chunk
chunkMemoryChunkResponseyesThe memory chunk data
memoryIndexnumberyesIndex of the chunk's memory in the client's memories array
relevanceScorenumberyesRelevance score for this chunk (0.0 to 1.0)

ContextItem

Context item with either text or binary content.

FieldTypeRequiredDescription
textstring | nullnoText content for this context item.
binaryBinaryContent | nullnoBinary content for this context item.

EmbedderWeight

Per-embedder weight override for retrieval operations.

FieldTypeRequiredDescription
embedderIdstringyesThe UUID for the embedder.
weightnumberyesThe weight to apply to this embedder's results. Can be positive, negative, or zero.

ErrorDetail

Structured error details for an individual batch operation result

FieldTypeRequiredDescription
codenumberyesNumeric error code (typically an HTTP or gRPC-derived status code)
messagestringyesHuman-readable error message

FilteredDeleteMemorySelectorRequest

Filtered selector scoped to a specific space

FieldTypeRequiredDescription
spaceIdstringyesSpace ID scope for the filtered delete
statusFilter"PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | nullnoOptional processing status filter (PENDING, PROCESSING, COMPLETED, FAILED)
filterstring | nullnoOptional metadata filter expression

HnswOptions

Optional request-level overrides for pgvector HNSW search settings. Unset fields inherit server defaults.

FieldTypeRequiredDescription
efSearchnumber | nullnoHNSW candidate list size (1..1000).
iterativeScanHnswIterativeScan | nullnoHNSW iterative scan mode. Use POST retrieve for this advanced tuning control.
maxScanTuplesnumber | nullnoMaximum tuples to scan during iterative filtering (1..2147483647).
scanMemMultipliernumber | nullnoMultiplier on work_mem for iterative scanning (1.0..1000.0).

JsonBatchMemoryCreationRequest

Request body for creating multiple memories via application/json.

FieldTypeRequiredDescription
requestsArray&lt;JsonMemoryCreationRequest&gt;yesArray of memory creation requests.

JsonMemoryCreationRequest

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
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.

ListMemoryPageImagesResponse

Page of memory page-image metadata

FieldTypeRequiredDescription
pageImagesArray&lt;MemoryPageImage&gt;yesPage-image metadata rows
nextTokenstring | nullnoOpaque token for retrieving the next page

LoggingOptions

FieldTypeRequiredDescription
enabledboolean | nullnoOpts this request in to durable server-side request logging. False or omitted does not opt out of admin policy logging.
callerAttributesRecord&lt;string, unknown&gt; | nullnoOptional flat scalar attributes attached if this request is persisted by caller opt-in or admin policy logging. Supported value types are string, integer, floating-point, and boolean. At most 32 entries are accepted.

Memory

Memory object containing stored content and metadata

FieldTypeRequiredDescription
memoryIdstringyesUnique identifier of the memory
spaceIdstringyesID of the space containing this memory
originalContentstring | nullnoOriginal content (only included if requested)
originalContentLengthnumber | nullnoSize in bytes of the inline original content
originalContentSha256string | nullnoSHA-256 digest of the inline original content, hex encoded
originalContentRefstring | nullnoReference to external content location
contentTypestringyesMIME type of the content
processingStatus"UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED"yesProcessing status of the memory
pageImageStatus"UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED"yesProcessing status of page-image extraction for this memory
pageImageCountnumberyesNumber of extracted page-image renditions linked to this memory
metadataRecord&lt;string, unknown&gt; | nullnoAdditional metadata for the memory
createdAtnumberyesTimestamp when the memory was created (milliseconds since epoch)
updatedAtnumberyesTimestamp when the memory was last updated (milliseconds since epoch)
createdByIdstringyesID of the user who created this memory
updatedByIdstringyesID of the user who last updated this memory
chunkingConfigChunkingConfiguration | nullnoChunking strategy used for this memory
processingHistoryProcessingHistory | nullnoBackground job processing history associated with this memory

MemoryChunkResponse

Memory chunk information

FieldTypeRequiredDescription
chunkIdstringyesUnique identifier of the memory chunk
memoryIdstringyesID of the memory this chunk belongs to
chunkSequenceNumbernumberyesSequence number of this chunk within the memory
chunkTextstringyesThe text content of this chunk
vectorStatus"UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED"yesStatus of vector processing for this chunk
startOffsetnumber | nullnoStart offset of this chunk in the original content
endOffsetnumber | nullnoEnd offset of this chunk in the original content
metadataRecord&lt;string, unknown&gt; | nullnoAdditional metadata for the memory chunk
createdAtnumberyesCreation timestamp (milliseconds since epoch)
updatedAtnumberyesLast update timestamp (milliseconds since epoch)
createdByIdstringyesID of the user who created the chunk
updatedByIdstringyesID of the user who last updated the chunk

MemoryListResponse

Response containing a list of memories within a space

FieldTypeRequiredDescription
memoriesArray&lt;Memory&gt;yesArray of memories in the space
nextTokenstring | nullnoToken for retrieving the next page of results

MemoryPageImage

Metadata for one memory page-image rendition

FieldTypeRequiredDescription
memoryIdstringyesMemory UUID
pageIndexnumberyes0-based page index
dpinumberyesRender DPI
contentTypestringyesImage MIME type
imageContentLengthnumber | nullnoImage byte length
imageContentSha256string | nullnoHex-encoded SHA-256 digest of image content
createdAtnumberyesCreation timestamp (milliseconds since epoch)
updatedAtnumberyesLast update timestamp (milliseconds since epoch)
createdByIdstringyesCreator user UUID
updatedByIdstringyesLast updater user UUID

PostProcessor

Post-processor configuration for transforming retrieval results. Custom processors are discovered from installed extensions and must be referenced by their fully qualified factory class name. See https://docs.goodmem.ai/docs/reference/post-processors/chat-post-processor/ for the built-in ChatPostProcessor configuration.

FieldTypeRequiredDescription
namestringyesFully qualified factory class name of the post-processor to apply.
configRecord&lt;string, unknown&gt; | nullnoConfiguration parameters for the post-processor. Fields depend on the selected processor; see the linked documentation for the built-in ChatPostProcessor schema.

ProcessingHistory

Background job execution history associated with a memory

FieldTypeRequiredDescription
latestJobBackgroundJobSummary | nullnoSummary of the most recent background job
attemptsArray&lt;BackgroundJobAttempt&gt; | nullnoAttempt-level telemetry captured for the latest job

ResultSetBoundary

Boundary marker for logical result sets in streaming memory retrieval

FieldTypeRequiredDescription
resultSetIdstringyesUnique identifier for this result set (UUID)
kind"BEGIN" | "END"yesType of boundary marker
stageNamestringyesFree-form label describing the pipeline stage
expectedItemsnumber | nullnoHint for progress tracking - expected number of items in this result set

RetrieveMemoryEvent

Streaming event from memory retrieval operation

FieldTypeRequiredDescription
resultSetBoundaryResultSetBoundary | nullnoResult set boundary marker (BEGIN/END)
abstractReplyAbstractReply | nullnoGenerated abstractive reply
retrievedItemRetrievedItem | nullnoA retrieved memory or chunk
memoryDefinitionMemory | nullnoMemory object to add to client's memories array
statusGoodMemStatus | nullnoWarning or non-fatal status with granular codes (operation continues)

RetrieveMemoryRequest

Request body for semantic memory retrieval with optional embedder weight overrides.

FieldTypeRequiredDescription
messagestringyesPrimary query/message for semantic search.
contextArray&lt;ContextItem&gt; | nullnoOptional context items (text or binary) to provide additional context for the search.
spaceKeysArray&lt;SpaceKey&gt;yesList of spaces to search with optional per-embedder weight overrides.
requestedSizenumber | nullnoMaximum number of memories to retrieve.
outputBudgetTokenBudget | nullnoOptional soft cap for generated retrieve replies. When set to a positive token count, chat post-processing uses this value as the LLM completion-token budget.
fetchMemoryboolean | nullnoWhether to include streamed memory-definition records in the response. Defaults to true when omitted. These records include memory metadata and audit fields, but omit originalContent unless fetchMemoryContent is true.
fetchMemoryContentboolean | nullnoWhether streamed memory-definition records include originalContent bytes. Requires fetchMemory=true. Defaults to false when omitted.
hnswHnswOptions | nullnoOptional request-level HNSW tuning overrides. Advanced usage; available on POST retrieve.
postProcessorPostProcessor | nullnoOptional post-processor configuration to transform retrieval results.
loggingLoggingOptions | nullnoOptional durable request logging block for POST retrieve requests. Set logging.enabled=true to opt in, or supply flat scalar logging.callerAttributes to attach if caller opt-in or an admin policy logs the request.

RetrievedItem

A retrieved result that can be either a Memory or MemoryChunk

FieldTypeRequiredDescription
memoryMemory | nullnoComplete memory object (if retrieved)
chunkChunkReference | nullnoReference to a memory chunk (if retrieved)

SpaceKey

Space configuration for retrieval operations with optional embedder weight overrides.

FieldTypeRequiredDescription
spaceIdstringyesThe UUID for the space to search.
embedderWeightsArray&lt;EmbedderWeight&gt; | nullnoOptional per-embedder weight overrides for this space. If not specified, database defaults are used.
filterstring | nullnoOptional filter expression that must evaluate to true for memories in this space.

TokenBudget

Soft token budget hint for retrieve request processing.

FieldTypeRequiredDescription
tokensnumberyesToken count for the budget. Must be positive.

Response Shapes

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

AbstractReplyResponseShape

FieldTypeRequiredDescription
textstringyesGenerated abstractive reply text
relevanceScorenumberyesRelevance score for this reply (0.0 to 1.0)
resultSetIdstring | nullnoOptional result set ID linking this abstract to a specific result set

BackgroundJobAttemptResponseShape

FieldTypeRequiredDescription
attemptIdnumberyesIdentifier of the attempt
jobIdnumberyesIdentifier of the job that owns this attempt
startedAtnumber | nullnoAttempt start timestamp (milliseconds since epoch)
finishedAtnumber | nullnoAttempt completion timestamp (milliseconds since epoch)
okboolean | nullnoIndicates whether the attempt succeeded (null if still running)
workerIdstring | nullnoIdentifier of the worker processing the attempt
statusMessagestring | nullnoLatest status message reported by the worker
progressCurrentnumberyesCurrent progress counter value
progressTotalnumber | nullnoTotal progress target when known
progressUnitstring | nullnoUnit label associated with the progress counters
progressUpdatedAtnumber | nullnoTimestamp when progress was last updated (milliseconds since epoch)
errorMessagestring | nullnoShort error message recorded when the attempt failed
errorStacktracestring | nullnoStack trace captured when the attempt failed, if available

BackgroundJobSummaryResponseShape

FieldTypeRequiredDescription
jobIdnumberyesDatabase identifier of the background job
jobTypestringyesLogical job type dispatched by the background job framework
status"BACKGROUND_JOB_STATUS_UNSPECIFIED" | "BACKGROUND_JOB_PENDING" | "BACKGROUND_JOB_RUNNING" | "BACKGROUND_JOB_SUCCEEDED" | "BACKGROUND_JOB_FAILED" | "BACKGROUND_JOB_CANCELED" | nullyesCurrent status of the background job
attemptsnumberyesNumber of attempts started so far
maxAttemptsnumberyesMaximum number of attempts allowed for this job
runAtnumber | nullnoTimestamp when the job becomes eligible to run (milliseconds since epoch)
leaseUntilnumber | nullnoLease expiration timestamp if the job is currently running (milliseconds since epoch)
lockedBystring | nullnoIdentifier of the worker currently holding the lease, if any
lastErrorstring | nullnoMost recent short error message if the job failed
updatedAtnumber | nullnoTimestamp when the job row was last updated (milliseconds since epoch)

BatchMemoryResponseShape

FieldTypeRequiredDescription
resultsArray&lt;BatchMemoryResultResponseShape&gt;yesArray of per-item results
totalDeletednumbernoTotal number of memories deleted across all selectors

BatchMemoryResultResponseShape

FieldTypeRequiredDescription
successbooleanyesWhether this individual operation succeeded
memoryIdstring | nullnoMemory ID associated with this result (present for batchGet errors and batchDelete results)
memoryMemoryResponseShape | nullnoCreated or retrieved memory (present when the operation returns a memory on success)
errorErrorDetailResponseShape | nullnoError details when success is false
requestIndexnumberno0-based index into the original batch request selectors
deletedCountnumbernoNumber of rows deleted by this selector

ChunkReferenceResponseShape

FieldTypeRequiredDescription
resultSetIdstringyesResult set ID that produced this chunk
chunkMemoryChunkResponseShapeyesThe memory chunk data
memoryIndexnumberyesIndex of the chunk's memory in the client's memories array
relevanceScorenumberyesRelevance score for this chunk (0.0 to 1.0)

ErrorDetailResponseShape

FieldTypeRequiredDescription
codenumberyesNumeric error code (typically an HTTP or gRPC-derived status code)
messagestringyesHuman-readable error message

ListMemoryPageImagesResponseShape

FieldTypeRequiredDescription
pageImagesArray&lt;MemoryPageImageResponseShape&gt;yesPage-image metadata rows
nextTokenstring | nullnoOpaque token for retrieving the next page

MemoryResponseShape

FieldTypeRequiredDescription
memoryIdstringyesUnique identifier of the memory
spaceIdstringyesID of the space containing this memory
originalContentstring | nullnoOriginal content (only included if requested)
originalContentLengthnumber | nullnoSize in bytes of the inline original content
originalContentSha256string | nullnoSHA-256 digest of the inline original content, hex encoded
originalContentRefstring | nullnoReference to external content location
contentTypestringyesMIME type of the content
processingStatus"UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | nullyesProcessing status of the memory
pageImageStatus"UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | nullyesProcessing status of page-image extraction for this memory
pageImageCountnumberyesNumber of extracted page-image renditions linked to this memory
metadataRecord&lt;string, unknown&gt; | nullnoAdditional metadata for the memory
createdAtnumberyesTimestamp when the memory was created (milliseconds since epoch)
updatedAtnumberyesTimestamp when the memory was last updated (milliseconds since epoch)
createdByIdstringyesID of the user who created this memory
updatedByIdstringyesID of the user who last updated this memory
chunkingConfigChunkingConfigurationResponseShape | nullnoChunking strategy used for this memory
processingHistoryProcessingHistoryResponseShape | nullnoBackground job processing history associated with this memory

MemoryChunkResponseShape

FieldTypeRequiredDescription
chunkIdstringyesUnique identifier of the memory chunk
memoryIdstringyesID of the memory this chunk belongs to
chunkSequenceNumbernumberyesSequence number of this chunk within the memory
chunkTextstringyesThe text content of this chunk
vectorStatus"UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | nullyesStatus of vector processing for this chunk
startOffsetnumber | nullnoStart offset of this chunk in the original content
endOffsetnumber | nullnoEnd offset of this chunk in the original content
metadataRecord&lt;string, unknown&gt; | nullnoAdditional metadata for the memory chunk
createdAtnumberyesCreation timestamp (milliseconds since epoch)
updatedAtnumberyesLast update timestamp (milliseconds since epoch)
createdByIdstringyesID of the user who created the chunk
updatedByIdstringyesID of the user who last updated the chunk

MemoryListResponseShape

FieldTypeRequiredDescription
memoriesArray&lt;MemoryResponseShape&gt;yesArray of memories in the space
nextTokenstring | nullnoToken for retrieving the next page of results

MemoryPageImageResponseShape

FieldTypeRequiredDescription
memoryIdstringyesMemory UUID
pageIndexnumberyes0-based page index
dpinumberyesRender DPI
contentTypestringyesImage MIME type
imageContentLengthnumber | nullnoImage byte length
imageContentSha256string | nullnoHex-encoded SHA-256 digest of image content
createdAtnumberyesCreation timestamp (milliseconds since epoch)
updatedAtnumberyesLast update timestamp (milliseconds since epoch)
createdByIdstringyesCreator user UUID
updatedByIdstringyesLast updater user UUID

ProcessingHistoryResponseShape

FieldTypeRequiredDescription
latestJobBackgroundJobSummaryResponseShape | nullnoSummary of the most recent background job
attemptsArray&lt;BackgroundJobAttemptResponseShape&gt; | nullnoAttempt-level telemetry captured for the latest job

ResultSetBoundaryResponseShape

FieldTypeRequiredDescription
resultSetIdstringyesUnique identifier for this result set (UUID)
kind"BEGIN" | "END" | nullyesType of boundary marker
stageNamestringyesFree-form label describing the pipeline stage
expectedItemsnumber | nullnoHint for progress tracking - expected number of items in this result set

RetrieveMemoryEventResponseShape

FieldTypeRequiredDescription
resultSetBoundaryResultSetBoundaryResponseShape | nullnoResult set boundary marker (BEGIN/END)
abstractReplyAbstractReplyResponseShape | nullnoGenerated abstractive reply
retrievedItemRetrievedItemResponseShape | nullnoA retrieved memory or chunk
memoryDefinitionMemoryResponseShape | nullnoMemory object to add to client's memories array
statusGoodMemStatusResponseShape | nullnoWarning or non-fatal status with granular codes (operation continues)

RetrievedItemResponseShape

Type constraint: RetrievedItemResponseShape = RequireExactlyOne&lt;RetrievedItemResponseShapeBase, "chunk" \| "memory"&gt;

FieldTypeRequiredDescription
memoryMemoryResponseShape | nullnoComplete memory object (if retrieved)
chunkChunkReferenceResponseShape | nullnoReference to a memory chunk (if retrieved)