mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-27 06:15:15 +00:00
Fixes v5 ingestion and document-operation docs. - **Query params return `400`.** `dreaming`, `fileType` and `mimeType` were documented as query params; they are JSON body or multipart form fields. - **Errors.** Out-of-balance quota is `402`, not `429`; `429` is only rate limiting. Added the `409` returned during a namespace merge. - **Statuses.** There is no `processing` status. The real ones are queued, extracting, chunking, embedding, done and failed; treat anything else as in progress. - **`group` on updates.** `group` is ingestion-side: it picks which existing memories serve as context while content is processed. Changing it only takes effect on re-ingestion, so it's sent with `content`/`file`. The "group-only PATCH" claims are removed from the migration doc. - **Lists, deletes and forget:** - Valid `sort` values per type, a `limit` max of 100, and `include.forgotten`. - Deletes skip documents that are still processing. - Forget-matching has a 100-match cap and a 2000-character `query` limit. - **Failed documents stay `failed`.** The docs said they're deleted after 2 minutes. They actually stay `failed`, and resending the same `id` reprocesses them. - **Smaller fixes:** - Metadata allows `string[]`. - The batch response field is `count`. - `audio` is a valid `fileType`. - Chunk overlap is 200 characters. - URL extraction no longer claims Markdowner. - Search examples no longer index the response object as an array. Checked against the current API and the published SDKs (TS 5.0.1, Python 5.0.0). Legacy v3/v4 docs are unchanged apart from factual fixes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
41 lines
2.1 KiB
Text
41 lines
2.1 KiB
Text
---
|
|
title: "Ingest"
|
|
sidebarTitle: "Overview"
|
|
description: "Turn source content into searchable memory and keep it current"
|
|
icon: "/icons/hugeicons/book-open-01.svg"
|
|
---
|
|
|
|
Ingestion gives Supermemory the source material it uses to build searchable context and memories. Add new content or update an existing source without creating a disconnected copy.
|
|
|
|
| Operation | Purpose |
|
|
| --- | --- |
|
|
| `POST /ns/{namespace}/document` | Add text or a URL; reuse an ID to build on an existing document |
|
|
| `POST /ns/{namespace}/document/batch` | Bring in up to 600 documents together |
|
|
| `POST /ns/{namespace}/document/file` | Turn an uploaded file into searchable memory |
|
|
| `PATCH /ns/{namespace}/document/{id}` | Update metadata or replace canonical content |
|
|
| `POST /ns/{namespace}/document/file/{id}` | Completely replace a file-backed document |
|
|
| `PATCH /ns/{namespace}/document/file/{id}` | Refresh selected file details or its source |
|
|
|
|
<CodeGroup>
|
|
```ts TypeScript
|
|
const { id, status } = await supermemory.add("user_1", {
|
|
content: "The user prefers concise project updates",
|
|
id: "conv_1",
|
|
metadata: { source: "chat" },
|
|
dreaming: "instant",
|
|
})
|
|
```
|
|
|
|
```bash curl
|
|
curl -X POST "https://api.supermemory.ai/ns/user_1/document" \
|
|
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"content":"The user prefers concise project updates","id":"conv_1","metadata":{"source":"chat"},"dreaming":"instant"}'
|
|
```
|
|
</CodeGroup>
|
|
|
|
The `dynamic` processing mode (default) groups related documents together so memories form from coherent, logical units rather than one isolated entry at a time. Use `instant` to process each document on its own right away; it bills one extra operation per document.
|
|
|
|
Memories appear quickly only with `dreaming: "instant"`. With the default `dynamic` mode, a fresh namespace can show zero memories and an empty profile for several minutes while extraction is batched. Use `instant` in quickstarts and tests.
|
|
|
|
Every request is scoped to a namespace, keeping each user, project, or tenant isolated. See [document write migration](/migration/api-v5-document-writes).
|