mem0ai/mem0 · error · ValueError
Either 'host' and 'port' or 'url' and 'api_key' or 'path' mu
Error message
Either 'host' and 'port' or 'url' and 'api_key' or 'path' must be provided.
What it means
Error "Either 'host' and 'port' or 'url' and 'api_key' or 'path' must be provided." thrown in mem0ai/mem0.
Source
Thrown at mem0/configs/vector_stores/qdrant.py:36
api_key: Optional[str] = Field(None, description="API key for Qdrant server")
https: Optional[bool] = Field(
None,
description="Whether to force HTTPS on or off. Explicit schemes in url take precedence.",
)
on_disk: Optional[bool] = Field(False,description="Enables persistent storage. Vectors are kept on disk (True) or in memory (False). Does not delete the local database path.")
@model_validator(mode="before")
@classmethod
def check_host_port_or_path(cls, values: Dict[str, Any]) -> Dict[str, Any]:
host, port, path, url, api_key = (
values.get("host"),
values.get("port"),
values.get("path"),
values.get("url"),
values.get("api_key"),
)
if not path and not (host and port) and not (url and api_key):
raise ValueError("Either 'host' and 'port' or 'url' and 'api_key' or 'path' must be provided.")
return values
@model_validator(mode="before")
@classmethod
def validate_extra_fields(cls, values: Dict[str, Any]) -> Dict[str, Any]:
allowed_fields = set(cls.model_fields.keys())
input_fields = set(values.keys())
extra_fields = input_fields - allowed_fields
if extra_fields:
raise ValueError(
f"Extra fields not allowed: {', '.join(extra_fields)}. Please input only the following fields: {', '.join(allowed_fields)}"
)
return values
model_config = ConfigDict(arbitrary_types_allowed=True)
View on GitHub (pinned to 001c235229)
Solutions
- Provide either host and port, or url and api_key, or a local path for Qdrant.
When it happens
Trigger: Thrown at mem0/configs/vector_stores/qdrant.py:36 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/189687b56c7321f5.
Report an issue: GitHub.