fix(python-sdks): v4 API migration for integration packages - #1434
fix(python-sdks): v4 API migration for integration packages#1434Dhravya wants to merge 7 commits into
Conversation
…4 APIs Use client.add and search.memories hybrid mode, improve profile memory deduplication for string/pydantic items, and add dedupe unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Claude finished @ved015's task in 1m 59s —— View job Code Review Complete
Result: No new issues found. The two issues previously flagged by Cursor Bugbot have been addressed in subsequent commits. PR scores 9/10 — ready to ship. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-mcp | 5462e20 | Aug 24 2026, 04:27 PM |
2b9934b to
c449b2f
Compare
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | 5462e20 | Commit Preview URL Branch Preview URL |
Aug 24 2026, 04:30 PM |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c449b2f. Configure here.
| chunk_threshold=0.6, | ||
| include_full_docs=include_full_docs, | ||
| threshold=0.6, | ||
| search_mode="hybrid", |
There was a problem hiding this comment.
include_full_docs ignored
Medium Severity
The v4 migration stops passing include_full_docs to search.memories, but the tool still exposes that parameter with a default of True. Callers or agents that set include_full_docs=False get the same hybrid search as when it is True, so documented tool behavior no longer matches runtime.
Reviewed by Cursor Bugbot for commit c449b2f. Configure here.
| # Stainless SDK returns pydantic models (attribute access, snake_case). | ||
| memory = getattr(item, "memory", None) | ||
| if isinstance(memory, str): | ||
| trimmed = memory.strip() |
There was a problem hiding this comment.
Dedupe drops chunk-only hits
Medium Severity
extract_memory_text only reads the memory field on dicts and SDK models. Hybrid v4 results that populate chunk or content instead (as cartesia/pipecat handle in this PR) are treated as empty and dropped from deduplicated search output used by middleware and context providers.
Reviewed by Cursor Bugbot for commit c449b2f. Configure here.
ce503a4 to
c449b2f
Compare
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Overview: Migrates agent-framework, cartesia, and pipecat Python SDKs to the v4 Supermemory API, switching from search.execute to search.memories with hybrid search, updating memory storage to use client.add, and hardening deduplication to handle v4's chunk/content response fields.
Issues found: None — this looks good to ship.
The two issues flagged by Cursor Bugbot have been addressed in subsequent commits:
-
include_full_docsignored ✅ Fixed — The parameter is nowOptional[bool] = Nonewith a deprecation warning, and the model-facing tool (_search_memories_tool) properly omits it. The README documents the deprecation. -
Dedupe drops chunk-only hits ✅ Fixed — All three packages now check
("memory", "chunk", "content")fields when extracting text from v4 search results.
Notable improvements in this PR:
- Consistent
_field()helper across cartesia/pipecat for reading dict or pydantic model fields - Date-prefix normalization in deduplication prevents false duplicates between profile and search results
- Pipecat storage queue with retry-on-failure and proper cleanup drain
- Cartesia per-turn context injection with legacy fallback for older Line versions
Score: 9/10
Minor observation: The unbounded storage queue in pipecat could grow during sustained API failures, but this is a reasonable tradeoff to avoid data loss.
There was a problem hiding this comment.
Overview: Migrates agent-framework, cartesia, and pipecat Python SDKs to the v4 Supermemory API, switching from search.execute to search.memories with hybrid search, updating memory storage to use client.add, and hardening deduplication to handle v4's chunk/content response fields.
Issues found: None — this looks good to ship.
The two issues flagged by Cursor Bugbot have been addressed in subsequent commits:
-
include_full_docsignored ✅ Fixed — The parameter is nowOptional[bool] = Nonewith a deprecation warning attools.py:97-103, and the model-facing tool (_search_memories_toolat line 212) properly omits it. The README documents the deprecation. -
Dedupe drops chunk-only hits ✅ Fixed — All three packages now check
("memory", "chunk", "content")fields when extracting text from v4 search results (e.g.,utils.py:100-109in agent-framework).
Notable improvements in this PR:
- Consistent
_field()helper across cartesia/pipecat for reading dict or pydantic model fields - Date-prefix normalization in deduplication prevents false duplicates between profile and search results
- Pipecat storage queue with retry-on-failure and proper cleanup drain via
_drain_storage_queue() - Cartesia per-turn context injection with legacy fallback for older Line versions via
_agent_accepts_context() - OpenAI middleware now properly threads sync
client.addcalls and adds timeout/redirect handling
Score: 9/10
Minor observation: The unbounded storage queue in pipecat (_storage_queue: deque) could grow during sustained API failures, but this is a reasonable tradeoff to avoid data loss. The _drain_storage_queue() method provides graceful cleanup at teardown.
There was a problem hiding this comment.
Overview: Migrates agent-framework, cartesia, and pipecat Python SDKs to the v4 Supermemory API, switching from search.execute to search.memories with hybrid search, updating memory storage to use client.add, and hardening deduplication to handle v4's chunk/content response fields.
Issues found: None — this looks good to ship.
The two issues flagged by Cursor Bugbot have been addressed in subsequent commits:
-
include_full_docsignored ✅ Fixed — The parameter is nowOptional[bool] = Nonewith a deprecation warning attools.py:97-103, and the model-facing tool (_search_memories_toolat line 212) properly omits it. The README documents the deprecation. -
Dedupe drops chunk-only hits ✅ Fixed — All three packages now check
("memory", "chunk", "content")fields when extracting text from v4 search results (e.g.,utils.py:100-109in agent-framework, cartesia's_field()helper atutils.py:50-67, pipecat's equivalent atutils.py:57-73).
Notable improvements:
- Consistent
_field()helper across cartesia/pipecat for reading dict or pydantic model fields - Date-prefix normalization in deduplication prevents false duplicates between profile and search results
- Pipecat storage queue with retry-on-failure and proper cleanup drain via
_drain_storage_queue() - Cartesia per-turn context injection with legacy fallback for older Line versions via
_agent_accepts_context() - OpenAI middleware properly threads sync
client.addcalls viaasyncio.to_threadand adds timeout/redirect handling - CI workflows pinned to commit SHAs and test against minimum/current dependency versions
Score: 9/10
Minor observation: The unbounded storage queue in pipecat (_storage_queue: deque) could grow during sustained API failures, but this is a reasonable tradeoff to avoid data loss and the _drain_storage_queue() method provides graceful cleanup at teardown.



Summary
client.add+ hybrid search, dedupe fixes, testsStacked on #1433
Test plan
Made with Cursor