mem0ai/mem0 · error · ImportError
The 'vecs' library is required. Please install it using 'pip
Error message
The 'vecs' library is required. Please install it using 'pip install vecs'.
What it means
Raised at import time when the `vecs` package (Supabase's pgvector client library) is not installed. mem0's Supabase vector store delegates all collection and query work to `vecs`, which is optional, so the module import fails fast with an install instruction.
Source
Thrown at mem0/vector_stores/supabase.py:10
import logging
import uuid
from typing import List, Optional
from pydantic import BaseModel
try:
import vecs
except ImportError:
raise ImportError("The 'vecs' library is required. Please install it using 'pip install vecs'.")
from mem0.configs.vector_stores.supabase import IndexMeasure, IndexMethod
from mem0.vector_stores.base import VectorStoreBase
logger = logging.getLogger(__name__)
VECS_MAX_QUERY_LIMIT = 1000
class OutputData(BaseModel):
id: Optional[str]
score: Optional[float]
payload: Optional[dict]
class Supabase(VectorStoreBase):
def __init__(
self,View on GitHub (pinned to 001c235229)
Solutions
- Run `pip install vecs` in the environment running mem0.
- Confirm the right package: it is `vecs` on PyPI (Supabase Vector), not `supabase`.
- Ensure a Postgres/pgvector database URL is also configured, since vecs will need it at runtime (connection string with the pgvector extension available).
Example fix
# before
memory = Memory.from_config({"vector_store": {"provider": "supabase", ...}}) # ImportError
# after
# pip install vecs
memory = Memory.from_config({"vector_store": {"provider": "supabase", "config": {"collection_name": "mem", "connection_string": DB_URL}}}) Defensive patterns
Strategy: try-catch
Validate before calling
import importlib.util
if importlib.util.find_spec("vecs") is None:
raise SystemExit("Missing dependency: vecs (not 'supabase'). Run: pip install vecs") Try / catch
try:
from mem0.vector_stores.supabase import Supabase
except ImportError as e:
raise RuntimeError(f"Supabase vector client missing: {e}. Install with pip install vecs.") from e Prevention
- Remember the package is `vecs`, not `supabase` — document this in your setup README.
- Pin vecs alongside mem0ai in requirements to keep pgvector protocol compatibility.
- Ensure the Postgres connection string targets a database with the pgvector extension available.
When it happens
Trigger: `from mem0.vector_stores.supabase import Supabase` or Memory config with `"provider": "supabase"` where `import vecs` raises ImportError.
Common situations: Confusing the `supabase` JS/PY client (which is a different package) with `vecs`; base mem0ai installs; CI environments without the Supabase extra; new team members following the Supabase dashboard docs instead of mem0's setup docs.
Related errors
- Pinecone requires extra dependencies. Install with `pip inst
- The 'boto3' library is required. Please install it using 'pi
- Turbopuffer requires extra dependencies. Install with `pip i
- The 'upstash_vector' library is required. Please install it
- The 'upstash_vector' library is required. Please install it
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/fd0b519c70bb23ef.
Report an issue: GitHub.