GoodMemGoodMem
ReferenceAPIREST APIMemories

Create multiple memories in a batch

POST /v1/memories:batchCreate: Creates multiple memories in a single operation, with individual success/failure results.

POST
/v1/memories:batchCreate

Creates multiple memories in a single operation, with individual success/failure results. Each item requires CREATE_MEMORY on its containing space; authorization failures are reported in the corresponding item result.

Authorization

ApiKeyAuth
headerx-api-key<token>

Header Parameters

GoodMem-Timeout-Ms?integer

Optional waiting budget in milliseconds, measured from REST servlet ingress and shared across all internal gRPC calls. Supply one decimal integer from 1 to 86400000. Omission adds no deadline. Existing shorter deadlines still apply. Expiry returns HTTP 504 before streaming starts; after streaming starts, no successful completion event is sent. Use SSE or opt into GoodMem-Stream-Terminal for an explicit terminal outcome. Retrieval work is cooperatively cancelled. An accepted mutation may still commit after timeout or disconnect; a failed response does not imply rollback.

Formatint64
Range1 <= value <= 86400000

Request Body

Batch memory creation details. For application/json requests, each item must provide exactly one of originalContent or originalContentB64. For multipart/form-data, provide a requests part and one file part per request.

  1. body

Request body for creating multiple memories via application/json.

requests*array<>

Array of memory creation requests.

Items1 <= items

Response Body

Results of batch memory creation operation

application/json
  1. response

Response containing per-item results for a batch memories operation

results*array<>

Array of per-item results

Example Request
curl -X POST 'https://your-goodmem-server.example.com/v1/memories:batchCreate' \  -H 'GoodMem-Timeout-Ms: 30000' \  -H 'Content-Type: application/json' \  -d '{  "requests": [    {      "memoryId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",      "spaceId": "550e8400-e29b-41d4-a716-446655440000",      "originalContent": "This is the text content to be stored as a memory.",      "originalContentB64": "VGhpcyBpcyBiYXNlNjQgZW5jb2RlZCBjb250ZW50",      "originalContentRef": "s3://my-bucket/document.pdf",      "contentType": "text/plain",      "metadata": {        "source": "document",        "author": "John Doe",        "tags": [          "important"        ],        "title": "Quarterly report"      },      "chunkingConfig": {        "recursive": {          "chunkSize": 1000,          "chunkOverlap": 200,          "separators": [            "\n\n",            "\n",            ".",            " "          ],          "separatorIsRegex": false        }      }    }  ]}'
Example Response
{  "results": [    {      "success": true,      "memoryId": "550e8400-e29b-41d4-a716-446655440000",      "memory": {        "memoryId": "550e8400-e29b-41d4-a716-446655440000",        "spaceId": "550e8400-e29b-41d4-a716-446655440001",        "originalContent": "VGhpcyBpcyBiYXNlNjQgYmluYXJ5Lg==",        "originalContentSha256": "9f2c8c5a9d740eb56d...",        "originalContentRef": "s3://my-bucket/document.pdf",        "contentType": "text/plain",        "processingStatus": "COMPLETED",        "pageImageStatus": "COMPLETED",        "pageImageCount": 12,        "createdAt": 1672531200000,        "updatedAt": 1672531200000,        "createdById": "550e8400-e29b-41d4-a716-446655440002",        "updatedById": "550e8400-e29b-41d4-a716-446655440002",        "chunkingConfig": {          "recursive": {            "chunkSize": 1000,            "chunkOverlap": 200,            "separators": [              "\n\n",              "\n",              ".",              " "            ],            "keepStrategy": "KEEP_END",            "separatorIsRegex": false,            "lengthMeasurement": "CHARACTER_COUNT"          },          "sentence": {            "maxChunkSize": 1000,            "minChunkSize": 100,            "enableLanguageDetection": true,            "lengthMeasurement": "CHARACTER_COUNT"          }        },        "processingHistory": {          "latestJob": {            "jobId": 42,            "jobType": "document_processor",            "status": "BACKGROUND_JOB_RUNNING",            "attempts": 1,            "maxAttempts": 5,            "runAt": 1714713600000,            "leaseUntil": 1714713660000,            "lockedBy": "worker-1",            "lastError": "Transient network failure",            "updatedAt": 1714713615000,            "failureStage": "DOCUMENT_PROCESSING_STAGE_GENERATING_EMBEDDINGS"          }        }      },      "error": {        "code": 403,        "message": "Forbidden - insufficient permissions"      }    }  ]}