Environment
- mem0ai/oss version: latest (npm)
- @qdrant/js-client-rest version: latest
- Runtime: Next.js 16 on Railway (serverless)
- Qdrant: Qdrant Cloud
Problem
When using mem0 OSS (TypeScript) with Qdrant Cloud, I consistently get an "Illegal host" error, even when passing a pre-configured QdrantClient or using the url parameter directly.
Steps to Reproduce
Attempt 1: Pre-configured QdrantClient with host+port+https
```typescript
const qdrantClient = new QdrantClient({
host: "xxx.us-west-1-0.aws.cloud.qdrant.io",
port: 6333,
apiKey: "xxx",
https: true,
})
const memory = new Memory({
vectorStore: {
provider: "qdrant",
config: {
client: qdrantClient,
collectionName: "my-collection",
},
},
// ... other config
})
```
Result: "Illegal host" error
Attempt 2: Pre-configured QdrantClient with url parameter
```typescript
const qdrantClient = new QdrantClient({
url: "https://xxx.us-west-1-0.aws.cloud.qdrant.io:6333",
apiKey: "xxx",
})
const memory = new Memory({
vectorStore: {
provider: "qdrant",
config: {
client: qdrantClient,
collectionName: "my-collection",
},
},
// ... other config
})
```
Result: "Illegal host" error
Attempt 3: Direct config without pre-configured client
```typescript
const memory = new Memory({
vectorStore: {
provider: "qdrant",
config: {
url: "https://xxx.us-west-1-0.aws.cloud.qdrant.io:6333",
apiKey: "xxx",
collectionName: "my-collection",
},
},
// ... other config
})
```
Result: "Illegal host" error
Important Finding
Direct QdrantClient connection works perfectly:
```typescript
const client = new QdrantClient({
url: "https://xxx.us-west-1-0.aws.cloud.qdrant.io:6333",
apiKey: "xxx"
})
const collection = await client.getCollection("my-collection")
// ✅ Works fine!
```
This confirms:
- Qdrant Cloud URL and API key are correct
- Network connectivity is fine
- The issue is within mem0's internal handling of the Qdrant client
Suspected Cause
Looking at the mem0-ts source code at src/oss/src/vector_stores/qdrant.ts, when a pre-configured client is passed, it should be used directly (lines 37-38). However, the "Illegal host" error suggests that somewhere in the mem0 codebase (possibly during embedding or other operations), a different Qdrant connection is being attempted with incorrect parameters.
Questions
- Is there a known working configuration for Qdrant Cloud with mem0 OSS (TypeScript)?
- Are there any examples of successful Qdrant Cloud integration in serverless environments?
- Could this be related to how mem0 internally reinitializes the vector store during add/search operations?
Workaround Attempted
I've tried all combinations of:
host + port + https: true
url parameter only
- Pre-configured client vs direct config
- With and without explicit port in URL
None of them work when going through mem0, but all work when using QdrantClient directly.
Related Issues
Would appreciate any guidance on how to properly configure Qdrant Cloud with mem0 OSS. Thank you!
Environment
Problem
When using mem0 OSS (TypeScript) with Qdrant Cloud, I consistently get an "Illegal host" error, even when passing a pre-configured QdrantClient or using the url parameter directly.
Steps to Reproduce
Attempt 1: Pre-configured QdrantClient with host+port+https
```typescript
const qdrantClient = new QdrantClient({
host: "xxx.us-west-1-0.aws.cloud.qdrant.io",
port: 6333,
apiKey: "xxx",
https: true,
})
const memory = new Memory({
vectorStore: {
provider: "qdrant",
config: {
client: qdrantClient,
collectionName: "my-collection",
},
},
// ... other config
})
```
Result: "Illegal host" error
Attempt 2: Pre-configured QdrantClient with url parameter
```typescript
const qdrantClient = new QdrantClient({
url: "https://xxx.us-west-1-0.aws.cloud.qdrant.io:6333",
apiKey: "xxx",
})
const memory = new Memory({
vectorStore: {
provider: "qdrant",
config: {
client: qdrantClient,
collectionName: "my-collection",
},
},
// ... other config
})
```
Result: "Illegal host" error
Attempt 3: Direct config without pre-configured client
```typescript
const memory = new Memory({
vectorStore: {
provider: "qdrant",
config: {
url: "https://xxx.us-west-1-0.aws.cloud.qdrant.io:6333",
apiKey: "xxx",
collectionName: "my-collection",
},
},
// ... other config
})
```
Result: "Illegal host" error
Important Finding
Direct QdrantClient connection works perfectly:
```typescript
const client = new QdrantClient({
url: "https://xxx.us-west-1-0.aws.cloud.qdrant.io:6333",
apiKey: "xxx"
})
const collection = await client.getCollection("my-collection")
// ✅ Works fine!
```
This confirms:
Suspected Cause
Looking at the mem0-ts source code at
src/oss/src/vector_stores/qdrant.ts, when a pre-configuredclientis passed, it should be used directly (lines 37-38). However, the "Illegal host" error suggests that somewhere in the mem0 codebase (possibly during embedding or other operations), a different Qdrant connection is being attempted with incorrect parameters.Questions
Workaround Attempted
I've tried all combinations of:
host+port+https: trueurlparameter onlyNone of them work when going through mem0, but all work when using QdrantClient directly.
Related Issues
Would appreciate any guidance on how to properly configure Qdrant Cloud with mem0 OSS. Thank you!