Skip to content
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

LangChain Zep Integration Fails Due to Deprecated Import #27356

Open
5 tasks done
rabbit19981023 opened this issue Oct 15, 2024 · 3 comments
Open
5 tasks done

LangChain Zep Integration Fails Due to Deprecated Import #27356

rabbit19981023 opened this issue Oct 15, 2024 · 3 comments
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@rabbit19981023
Copy link

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

from langchain_community.memory.zep_memory import ZepMemory

memory = ZepMemory(
    session_id="SESSION ID",
    url="http://localhost:8000",
    api_key="ZEP SECRET",
)

Error Message and Stack Trace (if applicable)

Traceback (most recent call last):
File "/home/andrew/my-projects/ai-learning/langchain-zep-test/.venv/lib/python3.12/site-packages/langchain_community/chat_message_histories
/zep.py", line 79, in init
from zep_python import ZepClient
ImportError: cannot import name 'ZepClient' from 'zep_python' (/home/andrew/my-projects/ai-learning/langchain-zep-test/.venv/lib/python3.12/s
ite-packages/zep_python/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/andrew/my-projects/ai-learning/langchain-zep-test/.venv/bin/langchain-zep-test", line 5, in
from langchain_zep_test import main
File "/home/andrew/my-projects/ai-learning/langchain-zep-test/src/langchain_zep_test/init.py", line 7, in
memory = ZepMemory(
^^^^^^^^^^
File "/home/andrew/my-projects/ai-learning/langchain-zep-test/.venv/lib/python3.12/site-packages/langchain_community/memory/zep_memory.py",
line 91, in init
chat_message_history = ZepChatMessageHistory(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/andrew/my-projects/ai-learning/langchain-zep-test/.venv/lib/python3.12/site-packages/langchain_community/chat_message_histories
/zep.py", line 81, in init
raise ImportError(
ImportError: Could not import zep-python package. Please install it with pip install zep-python.

Description

I found the source code uses ZepClient, which is deprecated, now Zep provides Zep and AsyncZep to use.

System Info

System Information

OS: Linux
OS Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024
Python Version: 3.12.6 (main, Sep 9 2024, 22:11:19) [Clang 18.1.8 ]

Package Information

langchain_core: 0.3.10
langchain: 0.3.3
langchain_community: 0.3.2
langsmith: 0.1.135
langchain_groq: 0.2.0
langchain_text_splitters: 0.3.0
langchain_zep_test: 0.1.0

Optional packages not installed

langgraph
langserve

Other Dependencies

aiohttp: 3.10.10
async-timeout: Installed. No version info available.
dataclasses-json: 0.6.7
groq: 0.11.0
httpx: 0.27.2
jsonpatch: 1.33
langchain-community>=0.3.2: Installed. No version info available.
langchain-groq>=0.2.0: Installed. No version info available.
numpy: 1.26.4
orjson: 3.10.7
packaging: 24.1
pydantic: 2.9.2
pydantic-settings: 2.5.2
PyYAML: 6.0.2
requests: 2.32.3
requests-toolbelt: 1.0.0
SQLAlchemy: 2.0.35
tenacity: 8.5.0
typing-extensions: 4.12.2
zep-python>=2.0.2: Installed. No version info available.

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Oct 15, 2024
@Jacky3003
Copy link

Jacky3003 commented Oct 16, 2024

Hello, interested in diving deeper into this issue and I also would like to work on a fix if possible. Have you found any potential solutions as of now @rabbit19981023?

EDIT: getting the same error with the following system info:

System Information

OS: Linux
OS Version: #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 11 15:25:05 UTC 2
Python Version: 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0]

Package Information

langchain_core: 0.3.10
langchain: 0.3.3
langchain_community: 0.3.2
langsmith: 0.1.135
langchain_groq: 0.2.0
langchain_text_splitters: 0.3.0
langchain_zep_test: Not installed

Optional packages not installed

langgraph
langserve

Other Dependencies

aiohttp: 3.10.10
async-timeout: 4.0.3
dataclasses-json: 0.6.7
groq: 0.11.0
httpx: 0.27.2
jsonpatch: 1.33
numpy: 1.21.5
orjson: 3.10.7
packaging: 24.1
pydantic: 2.9.2
pydantic-settings: 2.5.2
PyYAML: 5.4.1
requests: 2.32.3
requests-toolbelt: 1.0.0
SQLAlchemy: 2.0.32
tenacity: 8.5.0
typing-extensions: 4.12.2
langchain-community>=0.3.2: Installed. No version info available.
langchain-groq>=0.2.0: Installed. No version info available.
zep-python>=2.0.2: Installed. No version info available.

Should also note that any tests and dependencies that use ZepClient need to be changed as well to reflect usages for Zep and AsyncZep.

@rabbit19981023
Copy link
Author

Have you found any potential solutions as of now

@Jacky3003 I think just to update some interface to get working without error, something like ZepClient.memory.get_memory -> Zep.memory.get.

But I haven't tried to solve it yet. If you can fix it, that would be a big help

@Jacky3003
Copy link

@rabbit19981023 Zep and AsyncZep exist within langchain under libs/community/langchain_community/memory/zep_cloud_memory.py, and libs/community/langchain_community/chat_message_histories/zep_cloud.py, so you could try using those as such:

from langchain_community.memory.zep_cloud_memory import ZepCloudMemory

But it also seems to have its fair share of issues, so either way a fix is needed, just wanted to give an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants