Retrieve a stored file (image, audio, video, document) by its blob ID.

GET /v1/blobs/:blob_id

Retrieve the raw file associated with a multimodal memory. Returns the original file with its correct MIME type.

Endpoint

GET https://api.cortexdb.ai/v1/blobs/{blob_id}

Path Parameters

| Parameter | Type | Required | Description | |---|---|---|---| | blob_id | string | Yes | The blob identifier returned from remember or upload, or from a recall result's blob_ref.blob_id |

Examples

from cortexdb import CortexDBClient

client = CortexDBClient(base_url="http://localhost:8080", api_key="your-api-key")

# After recall, download the blob
result = await client.recall(
    query="architecture diagram",
    tenant_id="my-app",
    modality_filter=["image"]
)

for memory in result.memories:
    if memory.blob_ref:
        data, mime_type = await client.get_blob(memory.blob_ref.blob_id)
        filename = memory.blob_ref.original_filename or "download"
        with open(filename, "wb") as f:
            f.write(data)
curl -X GET https://api.cortexdb.ai/v1/blobs/01912a3b-4c5d-7e6f-8a9b-0c1d2e3f4a5c \
  -H "Authorization: Bearer your-api-key" \
  --output downloaded-file.png

Response

Returns the raw binary file with appropriate headers:

Content-Type: image/png
Content-Length: 245892
Content-Disposition: attachment; filename="architecture-diagram.png"
X-Blob-Checksum: 1234567890
X-Blob-Size: 245892

Integrity Verification

Every blob is stored with a CRC64 checksum computed at upload time. The checksum is included in the X-Blob-Checksum response header. Clients can verify file integrity by comparing this value against a locally computed checksum.

Error Codes

| Code | Meaning | |---|---| | 404 | Blob not found — may have been deleted via forget, or blob_id not recognized | | 503 | Blob store not configured on this server |

See Also