Skip to content

fix(openai-sdk): migrate to supermemory 3.x api so a fresh install imports - #1427

Open
Cintu07 wants to merge 2 commits into
supermemoryai:mainfrom
Cintu07:fix/openai-sdk-migrate-3x
Open

fix(openai-sdk): migrate to supermemory 3.x api so a fresh install imports#1427
Cintu07 wants to merge 2 commits into
supermemoryai:mainfrom
Cintu07:fix/openai-sdk-migrate-3x

Conversation

@Cintu07

@Cintu07 Cintu07 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

fixes #1235.

a fresh pip install supermemory-openai-sdk pulls the latest supermemory and the import fails. supermemory 3.x renamed the types the sdk imports and moved add off client.memories.

this moves the sdk onto the 3.x api:

  • imports: MemoryAddResponse -> AddResponse, MemoryGetResponse -> DocumentGetResponse
  • calls: client.memories.add(...) -> client.add(...) in tools.py and middleware.py
  • deps: supermemory>=3.7.0, version 1.0.5

verified the package imports on the declared floor supermemory 3.7.0 (the first release with client.add and AddResponse; 3.5.0 and 3.6.0 do not have them) and on the 3.50.0 line, and the test suite runs again (24 passed, 11 skipped) where it could not even be collected before.

Copilot AI lite review requested due to automatic review settings August 7, 2026 18:54
@Cintu07

Cintu07 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

heads up, since this makes the openai-sdk tests collectable again, it should unblock adding this package to CI. #1417 mentions the openai-sdk part was waiting on this issue getting fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the supermemory-openai-sdk Python package to be compatible with the newer supermemory 3.x client API so that a fresh install can import successfully and add memories using the correct call surface.

Changes:

  • Update imported response types to the newer AddResponse / DocumentGetResponse names.
  • Migrate add calls from client.memories.add(...) to client.add(...) in both the tools and middleware paths.
  • Bump package version and raise the declared minimum supermemory dependency (needs adjustment; see comments).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/openai-sdk-python/src/supermemory_openai/tools.py Updates type imports/aliases and switches add_memory to use client.add(...).
packages/openai-sdk-python/src/supermemory_openai/middleware.py Switches middleware add path to client.add(...) for sync/async clients.
packages/openai-sdk-python/pyproject.toml Bumps package version and adjusts the declared supermemory dependency floor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 53 to 55
success: bool
memory: Optional[MemoryAddResponse]
memory: Optional[AddResponse]
error: Optional[str]
Comment on lines 27 to 31
dependencies = [
"openai>=1.102.0",
"supermemory>=3.1.0",
"supermemory>=3.5.0",
"typing-extensions>=4.0.0",
"requests>=2.25.0",
@Cintu07

Cintu07 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

dam that was good catch on dependency floor, anyway fixed: bumped to supermemory>=3.7.0, which is the first version that actually has client.add and AddResponse (checked 3.5 and 3.6 don't have them, 3.7 does).

the memory type mismatch is pre-existing, it was there before this pr under the old MemoryAddResponse name, so leaving it out of scope to keep this a clean api migration. happy to do it as a follow up hehe ^^

dependencies = [
"openai>=1.102.0",
"supermemory>=3.1.0",
"supermemory>=3.7.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version requirement mismatch with description. The PR description states the fix was "confirmed import supermemory_openai works against supermemory 3.51" and mentions "supermemory>=3.5.0", but the code requires supermemory>=3.7.0. If "3.51" means version 3.5.1, this dependency will reject it despite being tested against it.

# If tested against 3.5.1, should be:
dependencies = [
    "supermemory>=3.5.0",
]
# Or if 3.7.0 is actually required, update the description
Suggested change
"supermemory>=3.7.0",
"supermemory>=3.5.0",

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

supermemory-openai-sdk fails to import with the latest supermemory (3.50)

2 participants