Search Documentation
Search across all documentation pages
attach_media
Attach a media file (image, PDF, audio, video) to a memory for multimodal embedding. The file is encrypted at rest and embedded via Gemini for cross-modal search. Accepts base64-encoded file content.
After upload, the file is automatically processed:
- Encrypted and stored in Supabase Storage
- Embedded via Gemini
gemini-embedding-2-preview(3072d multimodal vector) - Text extracted via Gemini 2.5 Flash (speech transcription, visual description, OCR)
The extracted text and embedding make the media searchable alongside text memories.
Supported Types#
| Type | Formats | Max Size |
|---|---|---|
| Images | PNG, JPEG, WebP, GIF | 20 MB |
| Documents | 50 MB | |
| Audio | MP3, WAV, OGG, WebM | 50 MB |
| Video | MP4, WebM, QuickTime | 20 MB |
SVG is not supported. Per-user storage quota applies.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
| fileBase64 | string | required | Base64-encoded file content |
| fileName | string | required | Original file name with extension |
| mimeType | string | required | MIME type (e.g. image/png, video/mp4, audio/mpeg) |
| memoryId | string (UUID) | optional | Memory to attach this media to |
| vaultId | string (UUID) | optional | Vault scope (defaults to defaultVaultId) |
Returns#
Confirmation with attachment ID, storage path, and processing status.
Example#
json
{
"tool": "attach_media",
"arguments": {
"fileBase64": "iVBORw0KGgo...",
"fileName": "architecture-diagram.png",
"mimeType": "image/png",
"memoryId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}Notes#
- Requires gateway mode (agent key). Not available in direct Supabase mode.
- Embedding and text extraction happen asynchronously via Inngest after upload.
- Video embedding is expensive ($0.00079/frame) — files are capped at 20 MB.
- Search results include an
attachmentsarray withextractedTextwhen media matches.