diff --git a/apps/docs/add-memories.mdx b/apps/docs/add-memories.mdx index 9b4b9ec1..2102dfa7 100644 --- a/apps/docs/add-memories.mdx +++ b/apps/docs/add-memories.mdx @@ -122,7 +122,7 @@ await client.documents.update("doc_id_123", { }); ``` -This triggers full reprocessing of the document. +This triggers full reprocessing of the document. If you only update metadata (no content change), the document is updated in place with no reindexing. ### Formatting conversations diff --git a/apps/docs/add-memories/overview.mdx b/apps/docs/add-memories/overview.mdx index 5b07381b..be96185a 100644 --- a/apps/docs/add-memories/overview.mdx +++ b/apps/docs/add-memories/overview.mdx @@ -182,7 +182,7 @@ curl -X POST "https://api.supermemory.ai/v3/documents/file" \ `PATCH /v3/documents/{id}` -Update existing document content. +Update existing document content or metadata. Content changes trigger reindexing; metadata-only updates do not. diff --git a/apps/docs/document-operations.mdx b/apps/docs/document-operations.mdx index 2161d696..ecf4c54d 100644 --- a/apps/docs/document-operations.mdx +++ b/apps/docs/document-operations.mdx @@ -175,7 +175,7 @@ Get a specific document with its processing status. ## Update Document -Update a document's content or metadata. Triggers reprocessing. +Update a document's content or metadata. **Content changes** trigger full reprocessing; **metadata-only changes** (e.g. updating `accepted`, `version`) do not reindex. diff --git a/apps/docs/memory-api/creation/adding-memories.mdx b/apps/docs/memory-api/creation/adding-memories.mdx index a8837e3c..4c6471e3 100644 --- a/apps/docs/memory-api/creation/adding-memories.mdx +++ b/apps/docs/memory-api/creation/adding-memories.mdx @@ -366,9 +366,7 @@ requests.patch( - The file upload endpoint returns immediately with a memory ID and processing - status. The file will be processed asynchronously, and you can check its - status using the GET endpoint. + Metadata-only PATCH updates the document in place—no reindexing. Use this when adding or changing metadata (e.g. `accepted`, `title`, `description`) without modifying the document content. ## Next Steps diff --git a/apps/docs/memory-api/ingesting.mdx b/apps/docs/memory-api/ingesting.mdx index 301fb66a..fcf101a5 100644 --- a/apps/docs/memory-api/ingesting.mdx +++ b/apps/docs/memory-api/ingesting.mdx @@ -612,9 +612,8 @@ curl -X PATCH "https://api.supermemory.ai/v3/documents/abc123" \ ``` **Update Behavior** -- Old memories are deleted -- New memories created from updated content -- Same document ID maintained +- **Content changes:** Old memories are deleted, new memories created from updated content. Same document ID maintained. +- **Metadata-only changes:** Document metadata is updated in place. No reindexing—works with both internal `id` and `customId`. ### Rate Limits & Quotas diff --git a/apps/docs/update-delete-memories/overview.mdx b/apps/docs/update-delete-memories/overview.mdx index a4f5f0e1..033f6c33 100644 --- a/apps/docs/update-delete-memories/overview.mdx +++ b/apps/docs/update-delete-memories/overview.mdx @@ -8,7 +8,10 @@ Choose from direct updates, idempotent upserts, single deletions, and powerful b ## Direct Updates -Update existing memories by their ID when you know the specific memory you want to modify. Changes trigger reprocessing through the full pipeline. +Update existing memories by their ID when you know the specific memory you want to modify. + +- **Content changes** — Trigger full reprocessing (reindexing) through the pipeline. Response status is `"queued"`. +- **Metadata-only changes** — Update the document row only; no reindexing. Response status stays `"done"`. Use this when updating fields like `accepted`, `version`, or other filter metadata without changing the document content. @@ -25,7 +28,7 @@ const updated = await client.documents.update('memory_id_123', { metadata: { version: 2, updated: true } }); -console.log(updated.status); // "queued" for reprocessing +console.log(updated.status); // "queued" when content changed; "done" when metadata-only console.log(updated.id); // "memory_id_123" ``` @@ -42,7 +45,7 @@ updated = client.documents.update( metadata={'version': 2, 'updated': True} ) -print(f"Status: {updated.status}") # "queued" for reprocessing +print(f"Status: {updated.status}") # "queued" when content changed; "done" when metadata-only print(f"ID: {updated.id}") # "memory_id_123" ``` @@ -58,6 +61,10 @@ curl -X PATCH "https://api.supermemory.ai/v3/documents/memory_id_123" \ + +**Metadata-only updates:** If you omit `content` or send the same content and only change `metadata` (e.g. `accepted: false` → `accepted: true`), the document is updated in place with no reindexing. Works with both internal `id` and `customId`—no special setup required. + + ## Upserts Using customId Use `customId` for idempotent operations where the same `customId` with `add()` will update existing memory instead of creating duplicates. @@ -503,7 +510,7 @@ echo "Total deleted: $TOTAL_DELETED memories" ### Update Operations 1. **Use customId for idempotent updates** - Prevents duplicate memories and enables safe retries -2. **Monitor processing status** - Updates trigger full reprocessing pipeline +2. **Monitor processing status** - Content changes trigger full reprocessing; metadata-only updates do not reindex 3. **Handle metadata carefully** - Updates replace specified metadata keys 4. **Implement proper error handling** - Memory may be deleted between operations diff --git a/apps/web/components/document-modal/index.tsx b/apps/web/components/document-modal/index.tsx index cbe03c56..9f0dc950 100644 --- a/apps/web/components/document-modal/index.tsx +++ b/apps/web/components/document-modal/index.tsx @@ -43,7 +43,9 @@ function getDocumentSourceUrl(document: DocumentWithMemories): string { } // Extract ID from API URL like docs.googleapis.com/v1/documents/{id} - const apiMatch = url.match(/docs\.googleapis\.com\/v1\/documents\/([a-zA-Z0-9_-]+)/) + const apiMatch = url.match( + /docs\.googleapis\.com\/v1\/documents\/([a-zA-Z0-9_-]+)/, + ) if (apiMatch?.[1]) { return `${prefix}${apiMatch[1]}/edit` }