Skip to content

[Bug]: LangGraph example demo raises AttributeError when adding memories with v2 APIs #1002

Description

@sscargal

Describe the bug

The current LangGraph example in the repository does not work and fails during execution when adding memories. The error is raised in the MemMachine tools integration with LangGraph, specifically in the demonstration script using the v2 APIs.

Steps to reproduce

Run the LangGraph integration demo as follows:

  1. Set up the environment according to the documentation.
  2. From within the integrations/langgraph/ directory, execute:
    python demo.py
    
  3. You will see the initialization succeed, but when adding memories, the following error is produced (this is repeated):
Failed to add memory
Traceback (most recent call last):
  File "/home/leoq/memtest/.venv/lib/python3.12/site-packages/memmachine/rest_client/memory.py", line 274, in add
    message = self._build_memory_message(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/leoq/memtest/.venv/lib/python3.12/site-packages/memmachine/rest_client/memory.py", line 196, in _build_memory_message
    combined_metadata["episode_type"] = episode_type.value
                                        ^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'value'
   ❌ Failed: Error adding memory

Expected behavior

The demo should run without errors and successfully add memories using the v2 APIs with the LangGraph integration.

Environment

  • OS: Mac OS X
  • MemMachine Version: v0.2.5
  • Development language version: Python 3.12
  • MemMachine LangGraph integration (demo.py) from the current repository main branch

Additional context

The error suggests that episode_type is being passed as a str, but the code expects an Enum that has a .value attribute. Passing the string type results in an AttributeError. This breaks compatibility with the intended v2 APIs.

Please review the demo and supporting function calls to ensure correct data types are used with episode_type and that the LangGraph example works out-of-the-box with v2 APIs.

Activity

  1. added theissue type on Jan 29, 2026
  2. github-actions commented on Apr 24, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If this issue is still relevant, please comment to keep it open, or add the keep-open label if it should remain open indefinitely (e.g., a roadmap item awaiting a champion). Thank you for your contributions.

  3. added
    keep-openPrevents the auto-close task from closing this issue.
    and removed on Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

keep-openPrevents the auto-close task from closing this issue.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions