Skip to content

[BUG] Official example not working. #137

@neoandmatrix

Description

@neoandmatrix

What happened?

I was trying out the example given at https://github.com/CaviraOSS/OpenMemory/blob/main/docs/getting-started.md for the python but not able to get it work.

Steps to Reproduce

  1. create a project with uv init.
  2. install openmemory with uv add openmemory-py.
  3. paste the given example in main.py
  4. run with uv run main.py

Component

Backend (API/Server)

Environment

  • OS [Linux/Fedora]
  • Python 3.12.9
  • Openmemory 1.3.2

Relevant log output

uv run main.py 
Traceback (most recent call last):
  File "/home/iamneo/personal-projects/openmem/main.py", line 3, in <module>
    from openmemory.client import Memory
  File "/home/iamneo/personal-projects/openmem/.venv/lib/python3.12/site-packages/openmemory/__init__.py", line 3, in <module>
    from . import connectors as sources
  File "/home/iamneo/personal-projects/openmem/.venv/lib/python3.12/site-packages/openmemory/connectors/__init__.py", line 5, in <module>
    from .langchain import OpenMemoryChatMessageHistory, OpenMemoryRetriever
  File "/home/iamneo/personal-projects/openmem/.venv/lib/python3.12/site-packages/openmemory/connectors/langchain.py", line 14, in <module>
    class OpenMemoryChatMessageHistory(BaseChatMessageHistory):
  File "/home/iamneo/personal-projects/openmem/.venv/lib/python3.12/site-packages/openmemory/connectors/langchain.py", line 21, in OpenMemoryChatMessageHistory
    def messages(self) -> List[BaseMessage]:
                               ^^^^^^^^^^^
NameError: name 'BaseMessage' is not defined

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    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