mem0ai 2.4.3 → 2.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -679,6 +679,20 @@ declare class MemoryVectorStore implements VectorStore {
679
679
  }
680
680
 
681
681
  interface QdrantConfig extends VectorStoreConfig {
682
+ /**
683
+ * Pre-configured QdrantClient instance. If using Qdrant Cloud, you must pass
684
+ * `port` explicitly when constructing the client to avoid "Illegal host" errors
685
+ * caused by a known upstream bug (qdrant/qdrant-js#59).
686
+ *
687
+ * @example
688
+ * ```typescript
689
+ * const client = new QdrantClient({
690
+ * url: "https://xxx.cloud.qdrant.io:6333",
691
+ * port: 6333,
692
+ * apiKey: "xxx",
693
+ * });
694
+ * ```
695
+ */
682
696
  client?: QdrantClient;
683
697
  host?: string;
684
698
  port?: number;
@@ -679,6 +679,20 @@ declare class MemoryVectorStore implements VectorStore {
679
679
  }
680
680
 
681
681
  interface QdrantConfig extends VectorStoreConfig {
682
+ /**
683
+ * Pre-configured QdrantClient instance. If using Qdrant Cloud, you must pass
684
+ * `port` explicitly when constructing the client to avoid "Illegal host" errors
685
+ * caused by a known upstream bug (qdrant/qdrant-js#59).
686
+ *
687
+ * @example
688
+ * ```typescript
689
+ * const client = new QdrantClient({
690
+ * url: "https://xxx.cloud.qdrant.io:6333",
691
+ * port: 6333,
692
+ * apiKey: "xxx",
693
+ * });
694
+ * ```
695
+ */
682
696
  client?: QdrantClient;
683
697
  host?: string;
684
698
  port?: number;
package/dist/oss/index.js CHANGED
@@ -734,6 +734,12 @@ var Qdrant = class {
734
734
  }
735
735
  if (config.url) {
736
736
  params.url = config.url;
737
+ try {
738
+ const parsedUrl = new URL(config.url);
739
+ params.port = parsedUrl.port ? parseInt(parsedUrl.port, 10) : 6333;
740
+ } catch (_) {
741
+ params.port = 6333;
742
+ }
737
743
  }
738
744
  if (config.host && config.port) {
739
745
  params.host = config.host;