Skip to content

RedisCloud incompatibility with search [Typescript] #3191

@lazakrisz

Description

@lazakrisz

🐛 Describe the bug

Hi,
there is an issue with using mem0 and redis cloud. The search module is differently named, and the following check fails:

If I run this code:

const client = createClient({
  url: process.env.REDIS_URL,
});

await client.connect();

const modulesResponse = (await client.moduleList()) as unknown as any[];

console.log("modulesResponse", modulesResponse);

await client.disconnect();

// Now create the Memory instance
return new Memory({
  vectorStore: {
    provider: "redis",
    config: {
      collectionName: "memories",
      embeddingModelDims: 1536,
      redisUrl: process.env.REDIS_URL,
    },
  },
});

I get the following exception:

Redis Client Connected
Connected to Redis
Error initializing Redis: RediSearch module is not loaded. Please ensure Redis Stack is properly installed and running.
Failed to initialize Redis: [Error: RediSearch module is not loaded. Please ensure Redis Stack is properly installed and running.]
[Error: RediSearch module is not loaded. Please ensure Redis Stack is properly installed and running.]
 ⨯ unhandledRejection: [Error: RediSearch module is not loaded. Please ensure Redis Stack is properly installed and running.]
 ⨯ unhandledRejection:  [Error: RediSearch module is not loaded. Please ensure Redis Stack is properly installed and running.]

However I have a redis instance running on RedisCloud that should be fully compatible, see here:

Image

The issue can be fixed by changing the filtering logic (I'll make a PR), this is my module response from the above code:

modulesResponse [
  { name: 'ReJSON', ver: 20810 },
  { name: 'bf', ver: 20807 },
  { name: 'searchlight', ver: 21017 },
  { name: 'timeseries', ver: 11207 }
]
Redis Client Connected
Connected to Redis
Error initializing Redis: RediSearch module is not loaded. Please ensure Redis Stack is properly installed and r
// ...

langchain also had a similar issue raised, see here: langchain-ai/langchain#2113 (comment), they also extended their search to include searchlight module from Redis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions