Skip to content

Migrate Pipecat SDK to Supermemory v5 - #1872

Merged
ishaanxgupta merged 5 commits into
mainfrom
sreedharsreeram/pipecat-sdk-v5-check
Nov 13, 2026
Merged

ishaanxgupta merged 5 commits into
mainfrom
sreedharsreeram/pipecat-sdk-v5-check

Conversation

@sreedharsreeram

@sreedharsreeram sreedharsreeram commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Migrate the Pipecat integration to the Supermemory Python v5 namespace-first API. Profile and memory search are separate calls; conversation writes use the v5 id field.
  • Preserve the service's existing user_id interface, pass its value as the v5 namespace, normalize v5 profile facts for injection, and update the package and integration docs.
  • Bump supermemory-pipecat to 0.2.0 and require supermemory>=5.0.0,<6.
  • Keep the test coverage focused on the real v5 request shape and existing behavior; remove duplicate import stubs and overlapping mocks.

Verification

  • bun install --frozen-lockfile passed.
  • Python 3.12 with supermemory==5.0.1 and pipecat-ai==1.7.0: 12 package tests passed; wheel build and dependency check passed.
  • Linux Python 3.10 with supermemory==5.0.0 and pipecat-ai==0.0.98: 12 package tests and dependency check passed.
  • Real v5 Python client with a local HTTP mock sent namespace-scoped /profile, /search, and /document requests with the expected fields.
  • bun run --cwd packages/memory-graph check-types and bun run --cwd packages/memory-graph test passed (197 tests).
  • git diff --check and Black checks passed. Biome found no applicable changed files.

Known CI follow-up

  • Both GitHub Pipecat CI lanes currently fail at dependency installation: .github/workflows/ci-python.yml pins Supermemory 3.16.0 and 3.59.0, which conflict with this package's v5 requirement. Repository instructions prohibit workflow edits unless explicitly requested, so that matrix remains unchanged in this draft.
  • bun run check-types fails in untouched packages/tools TypeScript code (AI SDK/Zod type errors). No TypeScript files changed here.

@mintlify

mintlify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
supermemory 🟢 Ready View Preview Nov 4, 2026, 7:28 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
supermemory-mcp a9b23e0 Nov 04 2026, 07:30 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
supermemory-app a9b23e0 Commit Preview URL

Branch Preview URL
Nov 04 2026, 07:30 PM

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
limit=self.params.search_limit,
threshold=self.params.search_threshold,
)
responses = dict(zip(calls, await asyncio.gather(*calls.values())))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A failed search now throws away the profile too. asyncio.gather has no return_exceptions, so if /search errors, the whole call raises MemoryRetrievalError and nothing is injected, even when /profile returned fine. The old /v4/profile endpoint caught search errors server-side and still returned the profile.

Repro with the real v5 client + httpx.MockTransport: profile 200 + search 500 → MemoryRetrievalError, and the static fact is dropped.

Suggest keeping whichever call succeeded:

results = await asyncio.gather(*calls.values(), return_exceptions=True)
responses = {}
for name, result in zip(calls, results):
    if isinstance(result, Exception):
        logger.warning(f"Supermemory {name} failed: {result}")
    else:
        responses[name] = result
if calls and not responses:
    raise MemoryRetrievalError("Failed to retrieve memories", results[0])

self.user_id,
query=query,
search_mode="memories",
limit=self.params.search_limit,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

search_limit above 100 now breaks retrieval on every turn. Before, the limit was applied client-side (slice), so any value worked. Now it's sent as the v5 limit, which the server caps at 100 (max(100) in the search contract) → 400. Combined with the gather issue above, the profile is lost too.

Suggest capping it on InputParams (line 152):

search_limit: int = Field(default=10, ge=1, le=100)

raw_search_results = _field(search_results_response, "results", default=[]) or []
search_results = list(raw_search_results)[: self.params.search_limit]
profile = _field(responses.get("profile"), "profile")
search_results = list(_field(responses.get("search"), "results", default=[]) or [])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The "[3d ago]" labels are gone for search results. v5 moved updatedAt under system (system.updated_at on the SDK model), but format_memories_to_text still reads only the top-level updatedAt / updated_at (utils.py#L181).

Repro: a v5 search result with system.updatedAt formats as - Plans a trip to Lisbon instead of - [3d ago] Plans a trip to Lisbon.

The test doesn't catch it because the mock search payload ({"memory": "Plans a trip"}) has no system or similarity. Suggest falling back to _field(_field(item, "system"), "updatedAt", "updated_at") in the formatter and using the real v5 result shape in the mock.

@ishaanxgupta
ishaanxgupta merged commit 03d9dd1 into main Nov 13, 2026
18 of 20 checks passed

This branch was successfully deployed

1 active deployment
staging - apps/docs — a9b23e06 Deployed Nov 4, 2026 by mintlify[bot]
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.

2 participants