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
| Parameter | Type | Description |
|---|---|---|
request | JsonBatchMemoryCreationRequest | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<BatchMemoryResponseShape>
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
| Parameter | Type | Description |
|---|---|---|
request | BatchMemoryDeletionRequest | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<BatchMemoryResponseShape>
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
| Parameter | Type | Description |
|---|---|---|
request | BatchMemoryRetrievalRequest | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<BatchMemoryResponseShape>
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/{id}/content
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The UUID of the memory to download |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<Uint8Array>
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
| Parameter | Type | Description |
|---|---|---|
request | JsonMemoryCreationRequest | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<MemoryResponseShape>
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/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The UUID of the memory to delete |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<void>
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/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The UUID of the memory to retrieve |
options | MemoriesGetOptions optional | Optional query parameters. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<MemoryResponseShape>
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/{spaceId}/memories
Parameters
| Parameter | Type | Description |
|---|---|---|
spaceId | string | The UUID of the space containing the memories |
options | MemoriesListOptions optional | Optional query parameters. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<Page<MemoryResponseShape>>
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/{id}/pages
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Memory UUID |
options | MemoriesPagesOptions optional | Optional query parameters. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<Page<MemoryPageImageResponseShape>>
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/{id}/pages/{pageIndex}/image
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Memory UUID |
pageIndex | number | 0-based page index |
options | MemoriesPagesImageOptions optional | Optional query parameters. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<Uint8Array>
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
| Parameter | Type | Description |
|---|---|---|
request | MemoriesRetrieveParams | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: AsyncIterable<RetrieveMemoryEventResponseShape>
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
| Field | Type | Required | Description |
|---|---|---|---|
text | string | yes | Generated abstractive reply text |
relevanceScore | number | yes | Relevance score for this reply (0.0 to 1.0) |
resultSetId | string | null | no | Optional result set ID linking this abstract to a specific result set |
BackgroundJobAttempt
Telemetry captured for a single execution attempt of a background job
| Field | Type | Required | Description |
|---|---|---|---|
attemptId | number | yes | Identifier of the attempt |
jobId | number | yes | Identifier of the job that owns this attempt |
startedAt | number | null | no | Attempt start timestamp (milliseconds since epoch) |
finishedAt | number | null | no | Attempt completion timestamp (milliseconds since epoch) |
ok | boolean | null | no | Indicates whether the attempt succeeded (null if still running) |
workerId | string | null | no | Identifier of the worker processing the attempt |
statusMessage | string | null | no | Latest status message reported by the worker |
progressCurrent | number | yes | Current progress counter value |
progressTotal | number | null | no | Total progress target when known |
progressUnit | string | null | no | Unit label associated with the progress counters |
progressUpdatedAt | number | null | no | Timestamp when progress was last updated (milliseconds since epoch) |
errorMessage | string | null | no | Short error message recorded when the attempt failed |
errorStacktrace | string | null | no | Stack trace captured when the attempt failed, if available |
BackgroundJobSummary
Summary of the most recent background job execution for a resource
| Field | Type | Required | Description |
|---|---|---|---|
jobId | number | yes | Database identifier of the background job |
jobType | string | yes | Logical 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" | yes | Current status of the background job |
attempts | number | yes | Number of attempts started so far |
maxAttempts | number | yes | Maximum number of attempts allowed for this job |
runAt | number | null | no | Timestamp when the job becomes eligible to run (milliseconds since epoch) |
leaseUntil | number | null | no | Lease expiration timestamp if the job is currently running (milliseconds since epoch) |
lockedBy | string | null | no | Identifier of the worker currently holding the lease, if any |
lastError | string | null | no | Most recent short error message if the job failed |
updatedAt | number | null | no | Timestamp when the job row was last updated (milliseconds since epoch) |
BatchDeleteMemorySelectorRequest
A single delete selector: either memoryId or filterSelector
| Field | Type | Required | Description |
|---|---|---|---|
memoryId | string | null | no | Deletes one specific memory by UUID |
filterSelector | FilteredDeleteMemorySelectorRequest | null | no | Deletes a filtered set of memories within a specific space |
BatchMemoryDeletionRequest
Request body for deleting memories using ID and/or filtered selectors
| Field | Type | Required | Description |
|---|---|---|---|
requests | Array<BatchDeleteMemorySelectorRequest> | yes | Array of delete selectors |
BatchMemoryResponse
Response containing per-item results for a batch memories operation
| Field | Type | Required | Description |
|---|---|---|---|
results | Array<BatchMemoryResult> | yes | Array of per-item results |
totalDeleted | number | no | Total number of memories deleted across all selectors |
BatchMemoryResult
Individual item result for a batch memories operation
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | yes | Whether this individual operation succeeded |
memoryId | string | null | no | Memory ID associated with this result (present for batchGet errors and batchDelete results) |
memory | Memory | null | no | Created or retrieved memory (present when the operation returns a memory on success) |
error | ErrorDetail | null | no | Error details when success is false |
requestIndex | number | no | 0-based index into the original batch request selectors |
deletedCount | number | no | Number of rows deleted by this selector |
BatchMemoryRetrievalRequest
Request body for retrieving multiple memories by their IDs
| Field | Type | Required | Description |
|---|---|---|---|
memoryIds | Array<string> | yes | Array of memory IDs to retrieve |
includeContent | boolean | null | no | Whether to include the original content in the response |
includeProcessingHistory | boolean | null | no | Whether to include background job processing history for each memory |
BinaryContent
Binary content with MIME type for context items.
| Field | Type | Required | Description |
|---|---|---|---|
contentType | string | yes | MIME type of the binary content. |
data | string | yes | Base64-encoded binary data. |
ChunkReference
Reference to a memory chunk with pointer to its parent memory
| Field | Type | Required | Description |
|---|---|---|---|
resultSetId | string | yes | Result set ID that produced this chunk |
chunk | MemoryChunkResponse | yes | The memory chunk data |
memoryIndex | number | yes | Index of the chunk's memory in the client's memories array |
relevanceScore | number | yes | Relevance score for this chunk (0.0 to 1.0) |
ContextItem
Context item with either text or binary content.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | null | no | Text content for this context item. |
binary | BinaryContent | null | no | Binary content for this context item. |
EmbedderWeight
Per-embedder weight override for retrieval operations.
| Field | Type | Required | Description |
|---|---|---|---|
embedderId | string | yes | The UUID for the embedder. |
weight | number | yes | The weight to apply to this embedder's results. Can be positive, negative, or zero. |
ErrorDetail
Structured error details for an individual batch operation result
| Field | Type | Required | Description |
|---|---|---|---|
code | number | yes | Numeric error code (typically an HTTP or gRPC-derived status code) |
message | string | yes | Human-readable error message |
FilteredDeleteMemorySelectorRequest
Filtered selector scoped to a specific space
| Field | Type | Required | Description |
|---|---|---|---|
spaceId | string | yes | Space ID scope for the filtered delete |
statusFilter | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | null | no | Optional processing status filter (PENDING, PROCESSING, COMPLETED, FAILED) |
filter | string | null | no | Optional metadata filter expression |
HnswOptions
Optional request-level overrides for pgvector HNSW search settings. Unset fields inherit server defaults.
| Field | Type | Required | Description |
|---|---|---|---|
efSearch | number | null | no | HNSW candidate list size (1..1000). |
iterativeScan | HnswIterativeScan | null | no | HNSW iterative scan mode. Use POST retrieve for this advanced tuning control. |
maxScanTuples | number | null | no | Maximum tuples to scan during iterative filtering (1..2147483647). |
scanMemMultiplier | number | null | no | Multiplier on work_mem for iterative scanning (1.0..1000.0). |
JsonBatchMemoryCreationRequest
Request body for creating multiple memories via application/json.
| Field | Type | Required | Description |
|---|---|---|---|
requests | Array<JsonMemoryCreationRequest> | yes | Array of memory creation requests. |
JsonMemoryCreationRequest
Request body for creating a new Memory. A Memory represents content stored in a space.
| Field | Type | Required | Description |
|---|---|---|---|
memoryId | string | null | no | Optional client-provided UUID for the memory. If omitted, the server generates one. Returns ALREADY_EXISTS if the ID is already in use. |
spaceId | string | yes | ID of the space where this memory will be stored |
originalContent | string | null | no | Original content as plain text (use either this or originalContentB64) |
originalContentB64 | string | null | no | Original content as base64-encoded binary data (use either this or originalContent) |
originalContentRef | string | null | no | Reference to external content location |
contentType | string | yes | MIME type of the content |
metadata | Record<string, unknown> | null | no | Additional metadata for the memory |
chunkingConfig | ChunkingConfiguration | null | no | Chunking strategy for this memory (if not provided, uses space default) |
extractPageImages | boolean | null | no | Optional hint to extract page images for eligible document types (for example, PDFs) |
fileField | string | null | no | Optional 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
| Field | Type | Required | Description |
|---|---|---|---|
pageImages | Array<MemoryPageImage> | yes | Page-image metadata rows |
nextToken | string | null | no | Opaque token for retrieving the next page |
LoggingOptions
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | null | no | Opts this request in to durable server-side request logging. False or omitted does not opt out of admin policy logging. |
callerAttributes | Record<string, unknown> | null | no | Optional 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
| Field | Type | Required | Description |
|---|---|---|---|
memoryId | string | yes | Unique identifier of the memory |
spaceId | string | yes | ID of the space containing this memory |
originalContent | string | null | no | Original content (only included if requested) |
originalContentLength | number | null | no | Size in bytes of the inline original content |
originalContentSha256 | string | null | no | SHA-256 digest of the inline original content, hex encoded |
originalContentRef | string | null | no | Reference to external content location |
contentType | string | yes | MIME type of the content |
processingStatus | "UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | yes | Processing status of the memory |
pageImageStatus | "UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | yes | Processing status of page-image extraction for this memory |
pageImageCount | number | yes | Number of extracted page-image renditions linked to this memory |
metadata | Record<string, unknown> | null | no | Additional metadata for the memory |
createdAt | number | yes | Timestamp when the memory was created (milliseconds since epoch) |
updatedAt | number | yes | Timestamp when the memory was last updated (milliseconds since epoch) |
createdById | string | yes | ID of the user who created this memory |
updatedById | string | yes | ID of the user who last updated this memory |
chunkingConfig | ChunkingConfiguration | null | no | Chunking strategy used for this memory |
processingHistory | ProcessingHistory | null | no | Background job processing history associated with this memory |
MemoryChunkResponse
Memory chunk information
| Field | Type | Required | Description |
|---|---|---|---|
chunkId | string | yes | Unique identifier of the memory chunk |
memoryId | string | yes | ID of the memory this chunk belongs to |
chunkSequenceNumber | number | yes | Sequence number of this chunk within the memory |
chunkText | string | yes | The text content of this chunk |
vectorStatus | "UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | yes | Status of vector processing for this chunk |
startOffset | number | null | no | Start offset of this chunk in the original content |
endOffset | number | null | no | End offset of this chunk in the original content |
metadata | Record<string, unknown> | null | no | Additional metadata for the memory chunk |
createdAt | number | yes | Creation timestamp (milliseconds since epoch) |
updatedAt | number | yes | Last update timestamp (milliseconds since epoch) |
createdById | string | yes | ID of the user who created the chunk |
updatedById | string | yes | ID of the user who last updated the chunk |
MemoryListResponse
Response containing a list of memories within a space
| Field | Type | Required | Description |
|---|---|---|---|
memories | Array<Memory> | yes | Array of memories in the space |
nextToken | string | null | no | Token for retrieving the next page of results |
MemoryPageImage
Metadata for one memory page-image rendition
| Field | Type | Required | Description |
|---|---|---|---|
memoryId | string | yes | Memory UUID |
pageIndex | number | yes | 0-based page index |
dpi | number | yes | Render DPI |
contentType | string | yes | Image MIME type |
imageContentLength | number | null | no | Image byte length |
imageContentSha256 | string | null | no | Hex-encoded SHA-256 digest of image content |
createdAt | number | yes | Creation timestamp (milliseconds since epoch) |
updatedAt | number | yes | Last update timestamp (milliseconds since epoch) |
createdById | string | yes | Creator user UUID |
updatedById | string | yes | Last 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.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Fully qualified factory class name of the post-processor to apply. |
config | Record<string, unknown> | null | no | Configuration 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
| Field | Type | Required | Description |
|---|---|---|---|
latestJob | BackgroundJobSummary | null | no | Summary of the most recent background job |
attempts | Array<BackgroundJobAttempt> | null | no | Attempt-level telemetry captured for the latest job |
ResultSetBoundary
Boundary marker for logical result sets in streaming memory retrieval
| Field | Type | Required | Description |
|---|---|---|---|
resultSetId | string | yes | Unique identifier for this result set (UUID) |
kind | "BEGIN" | "END" | yes | Type of boundary marker |
stageName | string | yes | Free-form label describing the pipeline stage |
expectedItems | number | null | no | Hint for progress tracking - expected number of items in this result set |
RetrieveMemoryEvent
Streaming event from memory retrieval operation
| Field | Type | Required | Description |
|---|---|---|---|
resultSetBoundary | ResultSetBoundary | null | no | Result set boundary marker (BEGIN/END) |
abstractReply | AbstractReply | null | no | Generated abstractive reply |
retrievedItem | RetrievedItem | null | no | A retrieved memory or chunk |
memoryDefinition | Memory | null | no | Memory object to add to client's memories array |
status | GoodMemStatus | null | no | Warning or non-fatal status with granular codes (operation continues) |
RetrieveMemoryRequest
Request body for semantic memory retrieval with optional embedder weight overrides.
| Field | Type | Required | Description |
|---|---|---|---|
message | string | yes | Primary query/message for semantic search. |
context | Array<ContextItem> | null | no | Optional context items (text or binary) to provide additional context for the search. |
spaceKeys | Array<SpaceKey> | yes | List of spaces to search with optional per-embedder weight overrides. |
requestedSize | number | null | no | Maximum number of memories to retrieve. |
outputBudget | TokenBudget | null | no | Optional 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. |
fetchMemory | boolean | null | no | Whether 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. |
fetchMemoryContent | boolean | null | no | Whether streamed memory-definition records include originalContent bytes. Requires fetchMemory=true. Defaults to false when omitted. |
hnsw | HnswOptions | null | no | Optional request-level HNSW tuning overrides. Advanced usage; available on POST retrieve. |
postProcessor | PostProcessor | null | no | Optional post-processor configuration to transform retrieval results. |
logging | LoggingOptions | null | no | Optional 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
| Field | Type | Required | Description |
|---|---|---|---|
memory | Memory | null | no | Complete memory object (if retrieved) |
chunk | ChunkReference | null | no | Reference to a memory chunk (if retrieved) |
SpaceKey
Space configuration for retrieval operations with optional embedder weight overrides.
| Field | Type | Required | Description |
|---|---|---|---|
spaceId | string | yes | The UUID for the space to search. |
embedderWeights | Array<EmbedderWeight> | null | no | Optional per-embedder weight overrides for this space. If not specified, database defaults are used. |
filter | string | null | no | Optional filter expression that must evaluate to true for memories in this space. |
TokenBudget
Soft token budget hint for retrieve request processing.
| Field | Type | Required | Description |
|---|---|---|---|
tokens | number | yes | Token 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
| Field | Type | Required | Description |
|---|---|---|---|
text | string | yes | Generated abstractive reply text |
relevanceScore | number | yes | Relevance score for this reply (0.0 to 1.0) |
resultSetId | string | null | no | Optional result set ID linking this abstract to a specific result set |
BackgroundJobAttemptResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
attemptId | number | yes | Identifier of the attempt |
jobId | number | yes | Identifier of the job that owns this attempt |
startedAt | number | null | no | Attempt start timestamp (milliseconds since epoch) |
finishedAt | number | null | no | Attempt completion timestamp (milliseconds since epoch) |
ok | boolean | null | no | Indicates whether the attempt succeeded (null if still running) |
workerId | string | null | no | Identifier of the worker processing the attempt |
statusMessage | string | null | no | Latest status message reported by the worker |
progressCurrent | number | yes | Current progress counter value |
progressTotal | number | null | no | Total progress target when known |
progressUnit | string | null | no | Unit label associated with the progress counters |
progressUpdatedAt | number | null | no | Timestamp when progress was last updated (milliseconds since epoch) |
errorMessage | string | null | no | Short error message recorded when the attempt failed |
errorStacktrace | string | null | no | Stack trace captured when the attempt failed, if available |
BackgroundJobSummaryResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
jobId | number | yes | Database identifier of the background job |
jobType | string | yes | Logical 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" | null | yes | Current status of the background job |
attempts | number | yes | Number of attempts started so far |
maxAttempts | number | yes | Maximum number of attempts allowed for this job |
runAt | number | null | no | Timestamp when the job becomes eligible to run (milliseconds since epoch) |
leaseUntil | number | null | no | Lease expiration timestamp if the job is currently running (milliseconds since epoch) |
lockedBy | string | null | no | Identifier of the worker currently holding the lease, if any |
lastError | string | null | no | Most recent short error message if the job failed |
updatedAt | number | null | no | Timestamp when the job row was last updated (milliseconds since epoch) |
BatchMemoryResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
results | Array<BatchMemoryResultResponseShape> | yes | Array of per-item results |
totalDeleted | number | no | Total number of memories deleted across all selectors |
BatchMemoryResultResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | yes | Whether this individual operation succeeded |
memoryId | string | null | no | Memory ID associated with this result (present for batchGet errors and batchDelete results) |
memory | MemoryResponseShape | null | no | Created or retrieved memory (present when the operation returns a memory on success) |
error | ErrorDetailResponseShape | null | no | Error details when success is false |
requestIndex | number | no | 0-based index into the original batch request selectors |
deletedCount | number | no | Number of rows deleted by this selector |
ChunkReferenceResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
resultSetId | string | yes | Result set ID that produced this chunk |
chunk | MemoryChunkResponseShape | yes | The memory chunk data |
memoryIndex | number | yes | Index of the chunk's memory in the client's memories array |
relevanceScore | number | yes | Relevance score for this chunk (0.0 to 1.0) |
ErrorDetailResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
code | number | yes | Numeric error code (typically an HTTP or gRPC-derived status code) |
message | string | yes | Human-readable error message |
ListMemoryPageImagesResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
pageImages | Array<MemoryPageImageResponseShape> | yes | Page-image metadata rows |
nextToken | string | null | no | Opaque token for retrieving the next page |
MemoryResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
memoryId | string | yes | Unique identifier of the memory |
spaceId | string | yes | ID of the space containing this memory |
originalContent | string | null | no | Original content (only included if requested) |
originalContentLength | number | null | no | Size in bytes of the inline original content |
originalContentSha256 | string | null | no | SHA-256 digest of the inline original content, hex encoded |
originalContentRef | string | null | no | Reference to external content location |
contentType | string | yes | MIME type of the content |
processingStatus | "UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | null | yes | Processing status of the memory |
pageImageStatus | "UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | null | yes | Processing status of page-image extraction for this memory |
pageImageCount | number | yes | Number of extracted page-image renditions linked to this memory |
metadata | Record<string, unknown> | null | no | Additional metadata for the memory |
createdAt | number | yes | Timestamp when the memory was created (milliseconds since epoch) |
updatedAt | number | yes | Timestamp when the memory was last updated (milliseconds since epoch) |
createdById | string | yes | ID of the user who created this memory |
updatedById | string | yes | ID of the user who last updated this memory |
chunkingConfig | ChunkingConfigurationResponseShape | null | no | Chunking strategy used for this memory |
processingHistory | ProcessingHistoryResponseShape | null | no | Background job processing history associated with this memory |
MemoryChunkResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
chunkId | string | yes | Unique identifier of the memory chunk |
memoryId | string | yes | ID of the memory this chunk belongs to |
chunkSequenceNumber | number | yes | Sequence number of this chunk within the memory |
chunkText | string | yes | The text content of this chunk |
vectorStatus | "UNSPECIFIED" | "PENDING" | "PROCESSING" | "COMPLETED" | "FAILED" | null | yes | Status of vector processing for this chunk |
startOffset | number | null | no | Start offset of this chunk in the original content |
endOffset | number | null | no | End offset of this chunk in the original content |
metadata | Record<string, unknown> | null | no | Additional metadata for the memory chunk |
createdAt | number | yes | Creation timestamp (milliseconds since epoch) |
updatedAt | number | yes | Last update timestamp (milliseconds since epoch) |
createdById | string | yes | ID of the user who created the chunk |
updatedById | string | yes | ID of the user who last updated the chunk |
MemoryListResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
memories | Array<MemoryResponseShape> | yes | Array of memories in the space |
nextToken | string | null | no | Token for retrieving the next page of results |
MemoryPageImageResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
memoryId | string | yes | Memory UUID |
pageIndex | number | yes | 0-based page index |
dpi | number | yes | Render DPI |
contentType | string | yes | Image MIME type |
imageContentLength | number | null | no | Image byte length |
imageContentSha256 | string | null | no | Hex-encoded SHA-256 digest of image content |
createdAt | number | yes | Creation timestamp (milliseconds since epoch) |
updatedAt | number | yes | Last update timestamp (milliseconds since epoch) |
createdById | string | yes | Creator user UUID |
updatedById | string | yes | Last updater user UUID |
ProcessingHistoryResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
latestJob | BackgroundJobSummaryResponseShape | null | no | Summary of the most recent background job |
attempts | Array<BackgroundJobAttemptResponseShape> | null | no | Attempt-level telemetry captured for the latest job |
ResultSetBoundaryResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
resultSetId | string | yes | Unique identifier for this result set (UUID) |
kind | "BEGIN" | "END" | null | yes | Type of boundary marker |
stageName | string | yes | Free-form label describing the pipeline stage |
expectedItems | number | null | no | Hint for progress tracking - expected number of items in this result set |
RetrieveMemoryEventResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
resultSetBoundary | ResultSetBoundaryResponseShape | null | no | Result set boundary marker (BEGIN/END) |
abstractReply | AbstractReplyResponseShape | null | no | Generated abstractive reply |
retrievedItem | RetrievedItemResponseShape | null | no | A retrieved memory or chunk |
memoryDefinition | MemoryResponseShape | null | no | Memory object to add to client's memories array |
status | GoodMemStatusResponseShape | null | no | Warning or non-fatal status with granular codes (operation continues) |
RetrievedItemResponseShape
Type constraint: RetrievedItemResponseShape = RequireExactlyOne<RetrievedItemResponseShapeBase, "chunk" \| "memory">
| Field | Type | Required | Description |
|---|---|---|---|
memory | MemoryResponseShape | null | no | Complete memory object (if retrieved) |
chunk | ChunkReferenceResponseShape | null | no | Reference to a memory chunk (if retrieved) |