From ea672c5342bda843a94cec1298f386f58a34899e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 04:24:56 +0000 Subject: [PATCH 1/4] chore(internal): update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 95ceb189..3824f4c4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log _dev __pycache__ From 846bd47ac5d76604016adca3a47bc57579b3c36c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 03:08:33 +0000 Subject: [PATCH 2/4] chore(ci): skip lint on metadata-only changes Note that we still want to run tests, as these depend on the metadata. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcec565c..893f49eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/supermemory-new-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 @@ -38,7 +38,7 @@ jobs: run: ./scripts/lint build: - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') timeout-minutes: 10 name: build permissions: From ef54b87aaf4a455600be3bf0cc9611d4492182a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 06:23:10 +0000 Subject: [PATCH 3/4] feat(api): api update --- .stats.yml | 4 +- README.md | 9 +++-- src/supermemory/resources/memories.py | 34 ++++++++++++++++- .../types/memory_update_memory_params.py | 37 ++++++++++++++++++- .../types/memory_update_memory_response.py | 6 +++ tests/api_resources/test_memories.py | 12 ++++++ 6 files changed, 93 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5bebbfc6..8b9b0a0d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-8a2f638d23709e5ca31c359b3b82ac806c4f2dbb238ca28ee2afed599b3f7be3.yml -openapi_spec_hash: 87a76bf487509cec077df5d5679a03de +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/supermemory--inc%2Fsupermemory-new-e519a815da9102647222f1f73920926f2d8b63d16995d3687213b604963f5ec5.yml +openapi_spec_hash: 4de453d3c2fca716f7f645d4c2c8f921 config_hash: f3eb5ca71172780678106f6d46f15dda diff --git a/README.md b/README.md index e353e704..7db0bb68 100644 --- a/README.md +++ b/README.md @@ -130,11 +130,12 @@ from supermemory import Supermemory client = Supermemory() -response = client.search.memories( - q="machine learning concepts", - include={}, +response = client.memories.update_memory( + container_tag="user_123", + new_content="John now prefers light mode", + temporal_context={}, ) -print(response.include) +print(response.temporal_context) ``` ## File uploads diff --git a/src/supermemory/resources/memories.py b/src/supermemory/resources/memories.py index 3bb87103..5134b7c9 100644 --- a/src/supermemory/resources/memories.py +++ b/src/supermemory/resources/memories.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union +from typing import Dict, Union, Optional import httpx @@ -105,7 +105,10 @@ def update_memory( new_content: str, id: str | Omit = omit, content: str | Omit = omit, + forget_after: Optional[str] | Omit = omit, + forget_reason: Optional[str] | Omit = omit, metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]] | Omit = omit, + temporal_context: memory_update_memory_params.TemporalContext | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -128,8 +131,18 @@ def update_memory( content: Exact content match of the memory entry to operate on. Use this when you don't have the ID. + forget_after: ISO 8601 datetime string. The memory will be auto-forgotten after this time. + Pass null to clear an existing expiry. Omit to inherit from the previous + version. + + forget_reason: Optional reason for the scheduled forgetting. Cleared automatically when + forgetAfter is set to null. + metadata: Optional metadata. If not provided, inherits from the previous version. + temporal_context: Structured temporal metadata. Merged into the metadata JSON column. If omitted, + existing temporalContext is preserved. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -146,7 +159,10 @@ def update_memory( "new_content": new_content, "id": id, "content": content, + "forget_after": forget_after, + "forget_reason": forget_reason, "metadata": metadata, + "temporal_context": temporal_context, }, memory_update_memory_params.MemoryUpdateMemoryParams, ), @@ -238,7 +254,10 @@ async def update_memory( new_content: str, id: str | Omit = omit, content: str | Omit = omit, + forget_after: Optional[str] | Omit = omit, + forget_reason: Optional[str] | Omit = omit, metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]] | Omit = omit, + temporal_context: memory_update_memory_params.TemporalContext | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -261,8 +280,18 @@ async def update_memory( content: Exact content match of the memory entry to operate on. Use this when you don't have the ID. + forget_after: ISO 8601 datetime string. The memory will be auto-forgotten after this time. + Pass null to clear an existing expiry. Omit to inherit from the previous + version. + + forget_reason: Optional reason for the scheduled forgetting. Cleared automatically when + forgetAfter is set to null. + metadata: Optional metadata. If not provided, inherits from the previous version. + temporal_context: Structured temporal metadata. Merged into the metadata JSON column. If omitted, + existing temporalContext is preserved. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -279,7 +308,10 @@ async def update_memory( "new_content": new_content, "id": id, "content": content, + "forget_after": forget_after, + "forget_reason": forget_reason, "metadata": metadata, + "temporal_context": temporal_context, }, memory_update_memory_params.MemoryUpdateMemoryParams, ), diff --git a/src/supermemory/types/memory_update_memory_params.py b/src/supermemory/types/memory_update_memory_params.py index 92f54180..1d135888 100644 --- a/src/supermemory/types/memory_update_memory_params.py +++ b/src/supermemory/types/memory_update_memory_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import Dict, Union +from typing import Dict, Union, Optional from typing_extensions import Required, Annotated, TypedDict from .._types import SequenceNotStr from .._utils import PropertyInfo -__all__ = ["MemoryUpdateMemoryParams"] +__all__ = ["MemoryUpdateMemoryParams", "TemporalContext"] class MemoryUpdateMemoryParams(TypedDict, total=False): @@ -27,5 +27,38 @@ class MemoryUpdateMemoryParams(TypedDict, total=False): Use this when you don't have the ID. """ + forget_after: Annotated[Optional[str], PropertyInfo(alias="forgetAfter")] + """ISO 8601 datetime string. + + The memory will be auto-forgotten after this time. Pass null to clear an + existing expiry. Omit to inherit from the previous version. + """ + + forget_reason: Annotated[Optional[str], PropertyInfo(alias="forgetReason")] + """Optional reason for the scheduled forgetting. + + Cleared automatically when forgetAfter is set to null. + """ + metadata: Dict[str, Union[str, float, bool, SequenceNotStr[str]]] """Optional metadata. If not provided, inherits from the previous version.""" + + temporal_context: Annotated[TemporalContext, PropertyInfo(alias="temporalContext")] + """Structured temporal metadata. + + Merged into the metadata JSON column. If omitted, existing temporalContext is + preserved. + """ + + +class TemporalContext(TypedDict, total=False): + """Structured temporal metadata. + + Merged into the metadata JSON column. If omitted, existing temporalContext is preserved. + """ + + document_date: Annotated[Optional[str], PropertyInfo(alias="documentDate")] + """Date the document was authored""" + + event_date: Annotated[Optional[SequenceNotStr[str]], PropertyInfo(alias="eventDate")] + """Dates of events referenced in the memory""" diff --git a/src/supermemory/types/memory_update_memory_response.py b/src/supermemory/types/memory_update_memory_response.py index 62bd0dc3..6b61b1d4 100644 --- a/src/supermemory/types/memory_update_memory_response.py +++ b/src/supermemory/types/memory_update_memory_response.py @@ -18,6 +18,12 @@ class MemoryUpdateMemoryResponse(BaseModel): created_at: str = FieldInfo(alias="createdAt") """When this memory version was created""" + forget_after: Optional[str] = FieldInfo(alias="forgetAfter", default=None) + """When this memory will be auto-forgotten, or null if no expiry""" + + forget_reason: Optional[str] = FieldInfo(alias="forgetReason", default=None) + """Reason for the scheduled forgetting, or null""" + memory: str """The content of the new memory version""" diff --git a/tests/api_resources/test_memories.py b/tests/api_resources/test_memories.py index d7625e4c..59574552 100644 --- a/tests/api_resources/test_memories.py +++ b/tests/api_resources/test_memories.py @@ -82,7 +82,13 @@ def test_method_update_memory_with_all_params(self, client: Supermemory) -> None new_content="John now prefers light mode", id="mem_abc123", content="John prefers dark mode", + forget_after="2026-06-01T00:00:00Z", + forget_reason="temporary project deadline", metadata={"foo": "string"}, + temporal_context={ + "document_date": "documentDate", + "event_date": ["string"], + }, ) assert_matches_type(MemoryUpdateMemoryResponse, memory, path=["response"]) @@ -182,7 +188,13 @@ async def test_method_update_memory_with_all_params(self, async_client: AsyncSup new_content="John now prefers light mode", id="mem_abc123", content="John prefers dark mode", + forget_after="2026-06-01T00:00:00Z", + forget_reason="temporary project deadline", metadata={"foo": "string"}, + temporal_context={ + "document_date": "documentDate", + "event_date": ["string"], + }, ) assert_matches_type(MemoryUpdateMemoryResponse, memory, path=["response"]) From 22bc5efb021dbdd74c27eee90b1b68032966e35f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 06:23:46 +0000 Subject: [PATCH 4/4] release: 3.31.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ pyproject.toml | 2 +- src/supermemory/_version.py | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 13d4dcbd..1287b3ed 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.30.1" + ".": "3.31.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f4ba9494..c1d31d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 3.31.0 (2026-03-26) + +Full Changelog: [v3.30.1...v3.31.0](https://github.com/supermemoryai/python-sdk/compare/v3.30.1...v3.31.0) + +### Features + +* **api:** api update ([ef54b87](https://github.com/supermemoryai/python-sdk/commit/ef54b87aaf4a455600be3bf0cc9611d4492182a2)) + + +### Chores + +* **ci:** skip lint on metadata-only changes ([846bd47](https://github.com/supermemoryai/python-sdk/commit/846bd47ac5d76604016adca3a47bc57579b3c36c)) +* **internal:** update gitignore ([ea672c5](https://github.com/supermemoryai/python-sdk/commit/ea672c5342bda843a94cec1298f386f58a34899e)) + ## 3.30.1 (2026-03-20) Full Changelog: [v3.30.0...v3.30.1](https://github.com/supermemoryai/python-sdk/compare/v3.30.0...v3.30.1) diff --git a/pyproject.toml b/pyproject.toml index 83f0bea3..3a4801eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "supermemory" -version = "3.30.1" +version = "3.31.0" description = "The official Python library for the supermemory API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/supermemory/_version.py b/src/supermemory/_version.py index 472d35f6..a0bd5ea1 100644 --- a/src/supermemory/_version.py +++ b/src/supermemory/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "supermemory" -__version__ = "3.30.1" # x-release-please-version +__version__ = "3.31.0" # x-release-please-version