> ## Documentation Index
> Fetch the complete documentation index at: https://supermemory-vorflux-slack-workspace-override-consent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Supported Content Types

> All the content formats Supermemory can ingest and process

Supermemory automatically extracts and indexes content from various formats. There are two entry points: `client.add()` for text and URLs, `client.documents.uploadFile()` for actual files. See [Add Memories](/ingestion/add-memories) to learn how to ingest content via the API.

## Text Content

Raw text, conversations, notes, or any string content.

```typescript theme={null}
await client.add({
  content: "User prefers dark mode and uses vim keybindings",
  containerTag: "user_123"
});
```

**Best for:** Chat messages, user preferences, notes, logs, transcripts.

***

## URLs & Web Pages

Send a URL and Supermemory fetches, extracts, and indexes the content.

```typescript theme={null}
await client.add({
  content: "https://docs.example.com/api-reference",
  containerTag: "documentation"
});
```

**Extracts:** Article text, headings, metadata. Strips navigation, ads, boilerplate. URL extraction is powered by [Markdowner](https://md.dhr.wtf).

***

## Documents

### PDF

Files are binary, so they go through `uploadFile`, not `add` — pass a stream, not base64:

```typescript theme={null}
import fs from 'fs';

await client.documents.uploadFile({
  file: fs.createReadStream('report.pdf'),
  containerTag: "user_123",
  metadata: JSON.stringify({ title: "Q4 Financial Report" })
});
```

**Extracts:** Text, tables, headers. OCR for scanned documents.

### Microsoft Office

Word, Excel, and PowerPoint files upload the same way — Supermemory detects the type from the file itself:

```typescript theme={null}
await client.documents.uploadFile({
  file: fs.createReadStream('roadmap.docx'),
  containerTag: "user_123",
  metadata: JSON.stringify({ title: "Product Roadmap" })
});
```

### Google Workspace

Automatically handled via [Google Drive connector](/connectors/google-drive):

* Google Docs
* Google Sheets
* Google Slides

***

## Code & Markdown

Both are plain text, so they go through `add` like any other string content — no file upload needed:

```typescript theme={null}
// Markdown
await client.add({
  content: markdownContent,
  containerTag: "user_123",
  metadata: { title: "README.md" }
});

// Code (language auto-detected)
await client.add({
  content: codeContent,
  containerTag: "user_123",
  metadata: { language: "typescript" }
});
```

**Extracts:** Structure, headings, code blocks with syntax awareness.

Code is chunked using [code-chunk](https://github.com/supermemoryai/code-chunk), which understands AST boundaries to keep functions, classes, and logical blocks intact. See [Super RAG](/concepts/super-rag) for how Supermemory optimizes chunking for each content type.

***

## Images

`fileType: "image"` and `mimeType` are both required so Supermemory knows exactly how to process it:

```typescript theme={null}
await client.documents.uploadFile({
  file: fs.createReadStream('diagram.png'),
  fileType: "image",
  mimeType: "image/png",
  containerTag: "user_123",
  metadata: JSON.stringify({ title: "Architecture Diagram" })
});
```

**Extracts:** OCR text, visual descriptions, diagram interpretations.

**Supported:** PNG, JPG, JPEG, WebP, GIF

***

## Audio & Video

Video has a dedicated `fileType`; audio is uploaded the same way and detected from the file itself:

```typescript theme={null}
// Video
await client.documents.uploadFile({
  file: fs.createReadStream('demo.mp4'),
  fileType: "video",
  mimeType: "video/mp4",
  containerTag: "user_123",
  metadata: JSON.stringify({ title: "Product Demo" })
});

// Audio
await client.documents.uploadFile({
  file: fs.createReadStream('call-recording.mp3'),
  mimeType: "audio/mpeg",
  containerTag: "user_123",
  metadata: JSON.stringify({ title: "Customer Call Recording" })
});
```

**Extracts:** Transcription, speaker detection, topic segmentation.

**Supported:** MP3, WAV, M4A, MP4, WebM

***

## Structured Data

JSON and CSV are text — stringify and send them through `add()`, no file upload needed.

### JSON

```typescript theme={null}
await client.add({
  content: JSON.stringify(userData),
  containerTag: "user_123",
  metadata: { title: "User Profile Data", format: "json" }
});
```

### CSV

```typescript theme={null}
await client.add({
  content: csvContent,
  containerTag: "user_123",
  metadata: { title: "Sales Data Q4", format: "csv" }
});
```

***

## File Upload

For any binary file, use `uploadFile` — it accepts a stream, not base64:

```typescript theme={null}
import fs from 'fs';

await client.documents.uploadFile({
  file: fs.createReadStream('./document.pdf'),
  containerTag: "user_123",
  metadata: JSON.stringify({ title: "document.pdf" })
});
```

No Node `fs` access? `uploadFile` also accepts a web `File`, a `fetch` `Response`, or the SDK's `toFile` helper:

```typescript theme={null}
import Supermemory, { toFile } from 'supermemory';

await client.documents.uploadFile({ file: new File(['my bytes'], 'file') });
await client.documents.uploadFile({ file: await fetch('https://somesite/file') });
await client.documents.uploadFile({ file: await toFile(Buffer.from('my bytes'), 'file') });
```

***

## Auto-Detection

`add()` tells URLs and plain text apart on its own — no extra flag needed:

```typescript theme={null}
// URL detected automatically
await client.add({ content: "https://example.com/page" });

// Plain text detected automatically
await client.add({ content: "User said they prefer email contact" });
```

For files, `uploadFile` detects type from the file itself in most cases. `fileType` only exists to force specific processing — and it's required (along with `mimeType`) for images and video.

***

## Content Limits

| Type  | Max Size                   |
| ----- | -------------------------- |
| Text  | 1MB                        |
| Files | 50MB                       |
| URLs  | Fetched content up to 10MB |

**Typical processing time:** text is near-instant; PDFs take 1-5s; images 2-10s; video 10s+; webpages 1-3s. Text content is chunked at the sentence level with a 2-sentence overlap between chunks.

<Tip>
  For large files, consider chunking or using [connectors](/connectors/overview) for automatic sync.
</Tip>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Add Memories" icon="plus" href="/ingestion/add-memories">
    Upload content via the API
  </Card>

  <Card title="Super RAG" icon="bolt" href="/concepts/super-rag">
    How content is chunked and indexed
  </Card>
</CardGroup>
