MemoryKit

Upload File

Upload a file (PDF, DOCX, XLSX, PPTX, TXT, CSV, MD, HTML, JSON) as a memory.

POST/v1/memories/upload

Request

Content-Type: multipart/form-data

filefilerequired

The file to upload. Supported: .pdf, .docx, .xlsx, .pptx, .txt, .csv, .md, .html, .json. Max 100 MB.

titlestring

Override the filename as title.

typestring

Content type.

tagsstring

JSON-encoded array of tags.

metadatastring

JSON-encoded metadata object.

languagestring

ISO 639-1 language code.

userIdstring

Associate with a user.

Response

Returns 202 Accepted with the memory object. The file is processed asynchronously — poll the Get Memory endpoint to check status.

idstring

Unique memory identifier.

statusstring

Always processing initially.

titlestring

Filename or custom title.

tagsstring[]

Tags associated with the memory.

created_atstring

ISO 8601 timestamp.

Example response
{
  "id": "mem_abc123",
  "status": "processing",
  "title": "quarterly-report.pdf",
  "tags": ["reports"],
  "created_at": "2025-01-15T10:30:00Z"
}
import fs from "fs";
 
const file = fs.readFileSync("./quarterly-report.pdf");
const memory = await mk.memories.upload(file, {
  filename: "quarterly-report.pdf",
  title: "Q4 Quarterly Report",
  tags: ["reports", "q4"],
});
Edit on GitHub

On this page