mem0ai/mem0 · error · Error

WeaviateDB: clusterUrl is required when client and apiKey ar

Error message

WeaviateDB: clusterUrl is required when client and apiKey are not provided

What it means

Error "WeaviateDB: clusterUrl is required when client and apiKey are not provided" thrown in mem0ai/mem0.

Source

Thrown at mem0-ts/src/oss/src/vector_stores/weaviate.ts:77

    this._sdk = sdk;

    const { client, clusterUrl, apiKey, additionalHeaders } = this._config;
    const weaviate = sdk.default;

    if (client) {
      this._client = client;
    } else if (clusterUrl?.includes("localhost")) {
      this._client = await weaviate.connectToLocal({
        headers: additionalHeaders,
      });
    } else if (apiKey) {
      this._client = await weaviate.connectToWeaviateCloud(clusterUrl!, {
        authCredentials: new weaviate.ApiKey(apiKey),
        headers: additionalHeaders,
      });
    } else {
      if (!clusterUrl) {
        throw new Error(
          "WeaviateDB: clusterUrl is required when client and apiKey are not provided",
        );
      }
      const parsed = new URL(clusterUrl);
      const httpSecure = parsed.protocol === "https:";
      this._client = await weaviate.connectToCustom({
        httpHost: parsed.hostname,
        httpPort: parsed.port
          ? parseInt(parsed.port, 10)
          : httpSecure
            ? 443
            : 8080,
        httpSecure,
        grpcHost: parsed.hostname,
        grpcPort: 50051,
        grpcSecure: false,
        headers: additionalHeaders,
      });

View on GitHub (pinned to 001c235229)

Solutions

  1. Provide clusterUrl in the Weaviate config (e.g. http://localhost:8080 or your WCD cluster URL).
  2. Alternatively pass a pre-configured Weaviate client via the client field together with apiKey if needed.

When it happens

Trigger: Thrown at mem0-ts/src/oss/src/vector_stores/weaviate.ts:77 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/5fc540e9317b4978. Report an issue: GitHub.