Skip to content

fix(example): update ReMeShortTermMemory.get_memory() signature to match base class#1424

Open
octo-patch wants to merge 2 commits intoagentscope-ai:mainfrom
octo-patch:fix/issue-1405-reme-get-memory-signature
Open

fix(example): update ReMeShortTermMemory.get_memory() signature to match base class#1424
octo-patch wants to merge 2 commits intoagentscope-ai:mainfrom
octo-patch:fix/issue-1405-reme-get-memory-signature

Conversation

@octo-patch
Copy link
Copy Markdown

Fixes #1405

Problem

ReMeShortTermMemory.get_memory() was defined without any parameters, violating the MemoryBase interface which requires mark, exclude_mark, prepend_summary, and **kwargs. When ReActAgent calls memory.get_memory(exclude_mark=_MemoryMark.COMPRESSED), it raises:

TypeError: ReMeShortTermMemory.get_memory() got an unexpected keyword argument 'exclude_mark'

Solution

Updated ReMeShortTermMemory.get_memory() to match the base class signature by adding mark, exclude_mark, prepend_summary, and **kwargs parameters. Since ReMeShortTermMemory manages memory through its own ReMe pipeline (not mark-based filtering), these parameters are accepted but the underlying implementation is unchanged.

Testing

The fix makes the method signature compatible with MemoryBase so ReActAgent can call memory.get_memory(exclude_mark=...) without raising a TypeError.

…payloads (fixes agentscope-ai#1374)

When users add custom fields (e.g. 'filename') to document metadata and
store them in Qdrant, retrieving the documents fails with:
  TypeError: DocMetadata.__init__() got an unexpected keyword argument 'filename'

Use @DataClass(init=False) with a custom __init__ that accepts **kwargs
and sets extra fields as attributes, preserving user-defined metadata.
…tch base class

The get_memory() override was missing mark, exclude_mark, prepend_summary and **kwargs
parameters required by the MemoryBase interface. This caused a TypeError when ReActAgent
called memory.get_memory(exclude_mark=...) on a ReMeShortTermMemory instance.

Fixes agentscope-ai#1405
@cla-assistant
Copy link
Copy Markdown

cla-assistant bot commented Apr 4, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

[Bug]:short_term_memory_example报错ReMeShortTermMemory.get_memory() got an unexpected keyword argument 'exclude_mark'

1 participant