From 074549217afb8014f97f6231fa4a7ed4fea1a58f Mon Sep 17 00:00:00 2001 From: Cintu07 <178455858+Cintu07@users.noreply.github.com> Date: Wed, 22 Jul 2026 01:31:36 +0530 Subject: [PATCH 1/2] fix(pipecat): use client.add, memories.add was removed in supermemory 3.x --- packages/pipecat-sdk-python/src/supermemory_pipecat/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pipecat-sdk-python/src/supermemory_pipecat/service.py b/packages/pipecat-sdk-python/src/supermemory_pipecat/service.py index eb9d5fb6..fe1b0249 100644 --- a/packages/pipecat-sdk-python/src/supermemory_pipecat/service.py +++ b/packages/pipecat-sdk-python/src/supermemory_pipecat/service.py @@ -179,7 +179,7 @@ class SupermemoryPipecatService(FrameProcessor): if self.session_id: add_params["custom_id"] = self.session_id - await self._supermemory_client.memories.add(**add_params) + await self._supermemory_client.add(**add_params) except Exception as e: logger.error(f"Error storing messages: {e}") From d71c76b1496ca58a7cef4e644b357f9b937775f5 Mon Sep 17 00:00:00 2001 From: Cintu07 <178455858+Cintu07@users.noreply.github.com> Date: Sat, 8 Aug 2026 00:46:56 +0530 Subject: [PATCH 2/2] test(pipecat): assert _store_messages calls client.add, not memories.add --- .../tests/test_empty_profile.py | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/pipecat-sdk-python/tests/test_empty_profile.py b/packages/pipecat-sdk-python/tests/test_empty_profile.py index ec3ccd26..1b3fc63c 100644 --- a/packages/pipecat-sdk-python/tests/test_empty_profile.py +++ b/packages/pipecat-sdk-python/tests/test_empty_profile.py @@ -120,4 +120,30 @@ class TestSupermemoryPipecatNullProfile(unittest.IsolatedAsyncioTestCase): "profile": {"static": [], "dynamic": []}, "search_results": [], }, - ) \ No newline at end of file + ) + + +class _MockAddClient: + """a client that only exposes the top-level add, not memories.add.""" + + def __init__(self): + self.add = AsyncMock(return_value=SimpleNamespace(id="doc_123")) + + +class TestSupermemoryPipecatStoreMessages(unittest.IsolatedAsyncioTestCase): + async def test_store_messages_calls_top_level_add(self) -> None: + # regression guard: supermemory 3.x moved add off client.memories to the + # top level. _store_messages must call client.add, not client.memories.add. + # the mock has no memories attribute, so a reverted call would raise, + # get swallowed by the fire-and-forget block, and add would never fire. + service = SupermemoryPipecatService(api_key="mock_key", user_id="user_123") + client = _MockAddClient() + service._supermemory_client = client + + await service._store_messages([{"role": "user", "content": "hello"}]) + + client.add.assert_awaited_once() + _, kwargs = client.add.await_args + self.assertIn("content", kwargs) + self.assertEqual(kwargs["container_tags"], ["user_123"]) + self.assertFalse(hasattr(client, "memories")) \ No newline at end of file