fix(llamaindex): pass valid EpisodeType enum instead of invalid "text" string - #1512
Open
connectsudhindra-gif wants to merge 1 commit into
Open
Conversation
…" string MemMachineMemory.add() called memory.add(episode_type="text", ...), but Memory.add() expects an EpisodeType enum and calls episode_type.value internally, raising AttributeError: 'str' object has no attribute 'value'. "text" was also never a valid EpisodeType value (only MESSAGE="message" exists), so this crashed on every call. Same failure mode as the LangGraph integration bug fixed in MemMachine#1403 (issue MemMachine#1002).
connectsudhindra-gif
force-pushed
the
fix/llamaindex-episode-type
branch
from
August 15, 2026 04:49
22dfd6e to
c3285b4
Compare
Author
|
This is ready for review whenever a maintainer has time. Let me know if any changes are needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MemMachineMemory.add()inintegrations/llamaindex/mem_machine_memory.pycalledmemory.add(episode_type="text", ...), passing a raw string whereMemory.add()expects anEpisodeTypeenum.Memory._build_memory_message()callsepisode_type.valueinternally, so this raisedAttributeError: 'str' object has no attribute 'value'on every call toadd()/put()."text"was also never a validEpisodeTypevalue in the first place (the enum only definesMESSAGE = "message"), so simply string-normalizing it (as was done for the LangGraph integration in feat(client+langgraph): raw filter strings and EpisodeType normalization #1403) wouldn't have been enough here.EpisodeType.MESSAGEdirectly, matching the only valid episode type today.Test plan
integrations/llamaindex/test_mem_machine_memory.pywith two unit tests (mocking the backendMemory) that assertepisode_typeis forwarded as a realEpisodeType.MESSAGEenum via bothadd()andput().ruff checkandruff format --diffon both changed files: clean.