Skip to content

BUG: AttributeError when profile is None in _retrieve_memories() #1027

@devteamaegis

Description

@devteamaegis

What breaks

SupermemoryPipecatService._retrieve_memories() in packages/pipecat-sdk-python/src/supermemory_pipecat/service.py accesses response.profile.static and response.profile.dynamic without first checking whether response.profile is None. The Supermemory API returns None for the profile field when the user has no stored memories (e.g. a brand-new user). This causes an unhandled AttributeError that crashes the memory retrieval path and surfaces to callers as a MemoryRetrievalError wrapping the underlying exception.

Traceback

File "service.py", line 155, in _retrieve_memories
    "static": response.profile.static,
              ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'static'

How to trigger

Call _retrieve_memories() against a user account that has no stored memories. The API responds with profile=None, which the code does not guard against before attribute access.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions