GoodMem
ReferenceAPIREST APIMemories

Delete memories in batch

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

POST
/v1/memories:batchDelete
x-api-key<token>

In: header

Batch memory deletion details

requestsarray<BatchDeleteMemorySelectorRequest>

Array of delete selectors

Default[{"memoryId":"550e8400-e29b-41d4-a716-446655440000"},{"filterSelector":{"spaceId":"550e8400-e29b-41d4-a716-446655440001","statusFilter":"FAILED","filter":"val('$.source') = 'email'"}}]

Response Body

curl -X POST "http://localhost:8080/v1/memories:batchDelete" \  -H "Content-Type: application/json" \  -d '{    "requests": [      {        "filterSelector": {          "filter": "val(\'$.source\') = \'email\'"        }      }    ]  }'
{
  "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
          }
        }
      },
      "error": {
        "code": 403,
        "message": "Forbidden - insufficient permissions"
      }
    }
  ]
}
{
  "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
          }
        }
      },
      "error": {
        "code": 403,
        "message": "Forbidden - insufficient permissions"
      }
    }
  ]
}
Empty
Empty
Empty