Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
_dev

__pycache__
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.30.1"
".": "3.31.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/supermemory/_version.py
Original file line number Diff line number Diff line change
@@ -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
34 changes: 33 additions & 1 deletion src/supermemory/resources/memories.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Dict, Union
from typing import Dict, Union, Optional

import httpx

Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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,
),
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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,
),
Expand Down
37 changes: 35 additions & 2 deletions src/supermemory/types/memory_update_memory_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"""
6 changes: 6 additions & 0 deletions src/supermemory/types/memory_update_memory_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down
12 changes: 12 additions & 0 deletions tests/api_resources/test_memories.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down Expand Up @@ -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"])

Expand Down