Skip to content

[Bug]: Error when using ChatMemoryBuffer and Context Serialization in llama_index Workflow #18475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Sanbornzhang opened this issue Apr 17, 2025 · 1 comment
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized

Comments

@Sanbornzhang
Copy link
Contributor

Bug Description

I am trying to use ChatMemoryBuffer in a llama_index workflow, along with Context serialization to save and restore intermediate states. However, when calling Context.from_dict, I encounter the following error:

TypeError: Can't instantiate abstract class BaseChatStore with abstract methods add_message, delete_last_message, delete_message, delete_messages, get_keys, get_messages, set_messages

The error occurs in line 193 of llama_index/core/workflow/context.py, specifically in this code segment:

serializer.deserialize(ev) for ev in data["broker_log"]

Version

0.12.30

Steps to Reproduce

The error occurs because when global_ctx is passed to Context.from_dict while using ChatMemoryBuffer, the BaseChatStore abstract class methods (such as add_message, delete_message, etc.) are not properly implemented or instantiated in the global_ctx.

Relevant Logs/Tracbacks

@Sanbornzhang Sanbornzhang added bug Something isn't working triage Issue needs to be triaged/prioritized labels Apr 17, 2025
@logan-markewich
Copy link
Collaborator

@Sanbornzhang you'll have to provide some full code to reproduce this issue. Not every object is easily serializable either, you may have to use pydantics field serializer utils to define how to serialize and load specific event objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized
Projects
None yet
Development

No branches or pull requests

2 participants