open-webui / pipelines

Pipelines: Versatile, UI-Agnostic OpenAI-Compatible Plugin Framework
MIT License
773 stars 234 forks source link

Error loading module: mem0_memory_filter_pipeline #274

Open mark-kazakov opened 1 week ago

mark-kazakov commented 1 week ago

pipelines image tag: latest (sha256 e2588ccca1929ee5f1a759cf836f4933e7dd0c2626be73d1b86aac6e75920621)

Installing the following pipeline filter from the example list: https://raw.githubusercontent.com/open-webui/pipelines/refs/heads/main/examples/filters/mem0_memory_filter_pipeline.py

docker logs -f pipelines
RESET_PIPELINES_DIR is not set to true. No action taken.
PIPELINES_REQUIREMENTS_PATH not specified. Skipping installation of requirements.
PIPELINES_URLS not specified. Skipping pipelines download and installation.
INFO:     Started server process [7]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:9099 (Press CTRL+C to quit)
INFO:     172.19.0.14:38354 - "GET /models HTTP/1.1" 200 OK
INFO:     172.19.0.14:38360 - "GET /pipelines HTTP/1.1" 200 OK
Requirement already satisfied: pydantic in /usr/local/lib/python3.11/site-packages (2.7.1)
Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.11/site-packages (from pydantic) (0.7.0)
Requirement already satisfied: pydantic-core==2.18.2 in /usr/local/lib/python3.11/site-packages (from pydantic) (2.18.2)
Requirement already satisfied: typing-extensions>=4.6.1 in /usr/local/lib/python3.11/site-packages (from pydantic) (4.12.2)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip
Requirement already satisfied: ollama in /usr/local/lib/python3.11/site-packages (0.3.3)
Requirement already satisfied: httpx<0.28.0,>=0.27.0 in /usr/local/lib/python3.11/site-packages (from ollama) (0.27.2)
Requirement already satisfied: anyio in /usr/local/lib/python3.11/site-packages (from httpx<0.28.0,>=0.27.0->ollama) (4.6.0)
Requirement already satisfied: certifi in /usr/local/lib/python3.11/site-packages (from httpx<0.28.0,>=0.27.0->ollama) (2024.8.30)
Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.11/site-packages (from httpx<0.28.0,>=0.27.0->ollama) (1.0.5)
Requirement already satisfied: idna in /usr/local/lib/python3.11/site-packages (from httpx<0.28.0,>=0.27.0->ollama) (3.10)
Requirement already satisfied: sniffio in /usr/local/lib/python3.11/site-packages (from httpx<0.28.0,>=0.27.0->ollama) (1.3.1)
Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.11/site-packages (from httpcore==1.*->httpx<0.28.0,>=0.27.0->ollama) (0.14.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip
Collecting mem0ai
  Downloading mem0ai-0.1.15-py3-none-any.whl.metadata (9.9 kB)
Collecting langchain-community<0.3.0,>=0.2.12 (from mem0ai)
  Downloading langchain_community-0.2.17-py3-none-any.whl.metadata (2.7 kB)
Collecting neo4j<6.0.0,>=5.23.1 (from mem0ai)
  Downloading neo4j-5.24.0-py3-none-any.whl.metadata (5.7 kB)
Requirement already satisfied: openai<2.0.0,>=1.33.0 in /usr/local/lib/python3.11/site-packages (from mem0ai) (1.47.0)
Requirement already satisfied: posthog<4.0.0,>=3.5.0 in /usr/local/lib/python3.11/site-packages (from mem0ai) (3.6.6)
Collecting pydantic<3.0.0,>=2.7.3 (from mem0ai)
  Downloading pydantic-2.9.2-py3-none-any.whl.metadata (149 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 149.4/149.4 kB 3.8 MB/s eta 0:00:00
Requirement already satisfied: pytz<2025.0,>=2024.1 in /usr/local/lib/python3.11/site-packages (from mem0ai) (2024.2)
Collecting qdrant-client<2.0.0,>=1.9.1 (from mem0ai)
  Downloading qdrant_client-1.11.2-py3-none-any.whl.metadata (10 kB)
Collecting rank-bm25<0.3.0,>=0.2.2 (from mem0ai)
  Downloading rank_bm25-0.2.2-py3-none-any.whl.metadata (3.2 kB)
Requirement already satisfied: sqlalchemy<3.0.0,>=2.0.31 in /usr/local/lib/python3.11/site-packages (from mem0ai) (2.0.35)
Requirement already satisfied: PyYAML>=5.3 in /usr/local/lib/python3.11/site-packages (from langchain-community<0.3.0,>=0.2.12->mem0ai) (6.0.2)
Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in /usr/local/lib/python3.11/site-packages (from langchain-community<0.3.0,>=0.2.12->mem0ai) (3.9.5)
Requirement already satisfied: dataclasses-json<0.7,>=0.5.7 in /usr/local/lib/python3.11/site-packages (from langchain-community<0.3.0,>=0.2.12->mem0ai) (0.6.7)
Collecting langchain<0.3.0,>=0.2.16 (from langchain-community<0.3.0,>=0.2.12->mem0ai)
  Downloading langchain-0.2.16-py3-none-any.whl.metadata (7.1 kB)
Collecting langchain-core<0.3.0,>=0.2.39 (from langchain-community<0.3.0,>=0.2.12->mem0ai)
  Downloading langchain_core-0.2.41-py3-none-any.whl.metadata (6.2 kB)
Collecting langsmith<0.2.0,>=0.1.112 (from langchain-community<0.3.0,>=0.2.12->mem0ai)
  Downloading langsmith-0.1.126-py3-none-any.whl.metadata (13 kB)
Requirement already satisfied: numpy<2,>=1 in /usr/local/lib/python3.11/site-packages (from langchain-community<0.3.0,>=0.2.12->mem0ai) (1.26.3)
Requirement already satisfied: requests<3,>=2 in /usr/local/lib/python3.11/site-packages (from langchain-community<0.3.0,>=0.2.12->mem0ai) (2.32.2)
Requirement already satisfied: tenacity!=8.4.0,<9.0.0,>=8.1.0 in /usr/local/lib/python3.11/site-packages (from langchain-community<0.3.0,>=0.2.12->mem0ai) (8.5.0)
Requirement already satisfied: anyio<5,>=3.5.0 in /usr/local/lib/python3.11/site-packages (from openai<2.0.0,>=1.33.0->mem0ai) (4.6.0)
Requirement already satisfied: distro<2,>=1.7.0 in /usr/local/lib/python3.11/site-packages (from openai<2.0.0,>=1.33.0->mem0ai) (1.9.0)
Requirement already satisfied: httpx<1,>=0.23.0 in /usr/local/lib/python3.11/site-packages (from openai<2.0.0,>=1.33.0->mem0ai) (0.27.2)
Requirement already satisfied: jiter<1,>=0.4.0 in /usr/local/lib/python3.11/site-packages (from openai<2.0.0,>=1.33.0->mem0ai) (0.5.0)
Requirement already satisfied: sniffio in /usr/local/lib/python3.11/site-packages (from openai<2.0.0,>=1.33.0->mem0ai) (1.3.1)
Requirement already satisfied: tqdm>4 in /usr/local/lib/python3.11/site-packages (from openai<2.0.0,>=1.33.0->mem0ai) (4.66.5)
Requirement already satisfied: typing-extensions<5,>=4.11 in /usr/local/lib/python3.11/site-packages (from openai<2.0.0,>=1.33.0->mem0ai) (4.12.2)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/site-packages (from posthog<4.0.0,>=3.5.0->mem0ai) (1.16.0)
Requirement already satisfied: monotonic>=1.5 in /usr/local/lib/python3.11/site-packages (from posthog<4.0.0,>=3.5.0->mem0ai) (1.6)
Requirement already satisfied: backoff>=1.10.0 in /usr/local/lib/python3.11/site-packages (from posthog<4.0.0,>=3.5.0->mem0ai) (1.11.1)
Requirement already satisfied: python-dateutil>2.1 in /usr/local/lib/python3.11/site-packages (from posthog<4.0.0,>=3.5.0->mem0ai) (2.9.0.post0)
Requirement already satisfied: annotated-types>=0.6.0 in /usr/local/lib/python3.11/site-packages (from pydantic<3.0.0,>=2.7.3->mem0ai) (0.7.0)
Collecting pydantic-core==2.23.4 (from pydantic<3.0.0,>=2.7.3->mem0ai)
  Downloading pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB)
Requirement already satisfied: grpcio>=1.41.0 in /usr/local/lib/python3.11/site-packages (from qdrant-client<2.0.0,>=1.9.1->mem0ai) (1.66.1)
Collecting grpcio-tools>=1.41.0 (from qdrant-client<2.0.0,>=1.9.1->mem0ai)
  Downloading grpcio_tools-1.66.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.3 kB)
Collecting portalocker<3.0.0,>=2.7.0 (from qdrant-client<2.0.0,>=1.9.1->mem0ai)
  Downloading portalocker-2.10.1-py3-none-any.whl.metadata (8.5 kB)
Requirement already satisfied: urllib3<3,>=1.26.14 in /usr/local/lib/python3.11/site-packages (from qdrant-client<2.0.0,>=1.9.1->mem0ai) (2.2.3)
Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.11/site-packages (from sqlalchemy<3.0.0,>=2.0.31->mem0ai) (3.0.3)
Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community<0.3.0,>=0.2.12->mem0ai) (1.3.1)
Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community<0.3.0,>=0.2.12->mem0ai) (24.2.0)
Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community<0.3.0,>=0.2.12->mem0ai) (1.4.1)
Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community<0.3.0,>=0.2.12->mem0ai) (6.1.0)
Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.3->langchain-community<0.3.0,>=0.2.12->mem0ai) (1.11.1)
Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.11/site-packages (from anyio<5,>=3.5.0->openai<2.0.0,>=1.33.0->mem0ai) (3.10)
Requirement already satisfied: marshmallow<4.0.0,>=3.18.0 in /usr/local/lib/python3.11/site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community<0.3.0,>=0.2.12->mem0ai) (3.22.0)
Requirement already satisfied: typing-inspect<1,>=0.4.0 in /usr/local/lib/python3.11/site-packages (from dataclasses-json<0.7,>=0.5.7->langchain-community<0.3.0,>=0.2.12->mem0ai) (0.9.0)
Requirement already satisfied: protobuf<6.0dev,>=5.26.1 in /usr/local/lib/python3.11/site-packages (from grpcio-tools>=1.41.0->qdrant-client<2.0.0,>=1.9.1->mem0ai) (5.28.2)
Requirement already satisfied: setuptools in /usr/local/lib/python3.11/site-packages (from grpcio-tools>=1.41.0->qdrant-client<2.0.0,>=1.9.1->mem0ai) (65.5.1)
Requirement already satisfied: certifi in /usr/local/lib/python3.11/site-packages (from httpx<1,>=0.23.0->openai<2.0.0,>=1.33.0->mem0ai) (2024.8.30)
Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.11/site-packages (from httpx<1,>=0.23.0->openai<2.0.0,>=1.33.0->mem0ai) (1.0.5)
Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.11/site-packages (from httpcore==1.*->httpx<1,>=0.23.0->openai<2.0.0,>=1.33.0->mem0ai) (0.14.0)
Collecting h2<5,>=3 (from httpx[http2]>=0.20.0->qdrant-client<2.0.0,>=1.9.1->mem0ai)
  Downloading h2-4.1.0-py3-none-any.whl.metadata (3.6 kB)
Collecting langchain-text-splitters<0.3.0,>=0.2.0 (from langchain<0.3.0,>=0.2.16->langchain-community<0.3.0,>=0.2.12->mem0ai)
  Downloading langchain_text_splitters-0.2.4-py3-none-any.whl.metadata (2.3 kB)
Collecting jsonpatch<2.0,>=1.33 (from langchain-core<0.3.0,>=0.2.39->langchain-community<0.3.0,>=0.2.12->mem0ai)
  Downloading jsonpatch-1.33-py2.py3-none-any.whl.metadata (3.0 kB)
Requirement already satisfied: packaging<25,>=23.2 in /usr/local/lib/python3.11/site-packages (from langchain-core<0.3.0,>=0.2.39->langchain-community<0.3.0,>=0.2.12->mem0ai) (24.1)
Requirement already satisfied: orjson<4.0.0,>=3.9.14 in /usr/local/lib/python3.11/site-packages (from langsmith<0.2.0,>=0.1.112->langchain-community<0.3.0,>=0.2.12->mem0ai) (3.10.7)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests<3,>=2->langchain-community<0.3.0,>=0.2.12->mem0ai) (3.3.2)
Collecting hyperframe<7,>=6.0 (from h2<5,>=3->httpx[http2]>=0.20.0->qdrant-client<2.0.0,>=1.9.1->mem0ai)
  Downloading hyperframe-6.0.1-py3-none-any.whl.metadata (2.7 kB)
Collecting hpack<5,>=4.0 (from h2<5,>=3->httpx[http2]>=0.20.0->qdrant-client<2.0.0,>=1.9.1->mem0ai)
  Downloading hpack-4.0.0-py3-none-any.whl.metadata (2.5 kB)
Collecting jsonpointer>=1.9 (from jsonpatch<2.0,>=1.33->langchain-core<0.3.0,>=0.2.39->langchain-community<0.3.0,>=0.2.12->mem0ai)
  Downloading jsonpointer-3.0.0-py2.py3-none-any.whl.metadata (2.3 kB)
Requirement already satisfied: mypy-extensions>=0.3.0 in /usr/local/lib/python3.11/site-packages (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain-community<0.3.0,>=0.2.12->mem0ai) (1.0.0)
Downloading mem0ai-0.1.15-py3-none-any.whl (72 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.2/72.2 kB 3.3 MB/s eta 0:00:00
Downloading langchain_community-0.2.17-py3-none-any.whl (2.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 9.4 MB/s eta 0:00:00
Downloading neo4j-5.24.0-py3-none-any.whl (294 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 294.6/294.6 kB 7.3 MB/s eta 0:00:00
Downloading pydantic-2.9.2-py3-none-any.whl (434 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 434.9/434.9 kB 8.8 MB/s eta 0:00:00
Downloading pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 10.2 MB/s eta 0:00:00
Downloading qdrant_client-1.11.2-py3-none-any.whl (258 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 258.9/258.9 kB 7.5 MB/s eta 0:00:00
Downloading rank_bm25-0.2.2-py3-none-any.whl (8.6 kB)
Downloading grpcio_tools-1.66.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 9.9 MB/s eta 0:00:00
Downloading langchain-0.2.16-py3-none-any.whl (1.0 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 9.7 MB/s eta 0:00:00
Downloading langchain_core-0.2.41-py3-none-any.whl (397 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 397.0/397.0 kB 7.7 MB/s eta 0:00:00
Downloading langsmith-0.1.126-py3-none-any.whl (290 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 290.4/290.4 kB 7.7 MB/s eta 0:00:00
Downloading portalocker-2.10.1-py3-none-any.whl (18 kB)
Downloading h2-4.1.0-py3-none-any.whl (57 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.5/57.5 kB 3.0 MB/s eta 0:00:00
Downloading jsonpatch-1.33-py2.py3-none-any.whl (12 kB)
Downloading langchain_text_splitters-0.2.4-py3-none-any.whl (25 kB)
Downloading hpack-4.0.0-py3-none-any.whl (32 kB)
Downloading hyperframe-6.0.1-py3-none-any.whl (12 kB)
Downloading jsonpointer-3.0.0-py2.py3-none-any.whl (7.6 kB)
Installing collected packages: rank-bm25, pydantic-core, portalocker, neo4j, jsonpointer, hyperframe, hpack, grpcio-tools, pydantic, jsonpatch, h2, langsmith, qdrant-client, langchain-core, langchain-text-splitters, langchain, langchain-community, mem0ai
  Attempting uninstall: pydantic-core
    Found existing installation: pydantic_core 2.18.2
    Uninstalling pydantic_core-2.18.2:
      Successfully uninstalled pydantic_core-2.18.2
  Attempting uninstall: pydantic
    Found existing installation: pydantic 2.7.1
    Uninstalling pydantic-2.7.1:
      Successfully uninstalled pydantic-2.7.1
Successfully installed grpcio-tools-1.66.1 h2-4.1.0 hpack-4.0.0 hyperframe-6.0.1 jsonpatch-1.33 jsonpointer-3.0.0 langchain-0.2.16 langchain-community-0.2.17 langchain-core-0.2.41 langchain-text-splitters-0.2.4 langsmith-0.1.126 mem0ai-0.1.15 neo4j-5.24.0 portalocker-2.10.1 pydantic-2.9.2 pydantic-core-2.23.4 qdrant-client-1.11.2 rank-bm25-0.2.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 24.0 -> 24.2
[notice] To update, run: pip install --upgrade pip
WARNING:root:No Pipeline class found in mem0_memory_filter_pipeline
https://github.com/open-webui/pipelines/raw/refs/heads/main/examples/filters/mem0_memory_filter_pipeline.py
Installing requirement: pydantic
Installing requirement: ollama
Installing requirement: mem0ai
Error loading module: mem0_memory_filter_pipeline
FieldValidatorDecoratorInfo.__init__() got an unexpected keyword argument 'json_schema_input_type'
INFO:     172.19.0.14:38364 - "POST /pipelines/add HTTP/1.1" 200 OK
INFO:     172.19.0.14:51534 - "GET /pipelines HTTP/1.1" 200 OK
INFO:     172.19.0.14:51538 - "GET /models HTTP/1.1" 200 OK

I also tried to build the image from source code and same issue.

lotherk commented 1 day ago

I am facing the same issue.

I made it work with git-272cf8c tag of pipelines and supplying a custom requirements.txt with mem0ai, pydantic and ollama by setting PIPELINES_REQUIREMENTS_PATH.