mem0ai/mem0 · critical · Error

Valkey search module is not available. Please ensure Valkey

Error message

Valkey search module is not available. Please ensure Valkey is running with the search module enabled.

What it means

The Valkey store verifies the RediSearch-compatible search module is loaded by calling FT._LIST during index creation. If the server replies 'unknown command', the search module is not loaded and this error is thrown: plain Valkey/Redis without the search module cannot serve vector queries. Other errors (auth, connection) are rethrown unchanged.

Source

Thrown at mem0-ts/src/oss/src/vector_stores/valkey.ts:256

      "memory",
      "TEXT",
      "metadata",
      "TAG",
      "created_at",
      "NUMERIC",
      "updated_at",
      "NUMERIC",
      ...vectorConfig,
    ];
  }

  private async ensureSearchModule(): Promise<void> {
    try {
      await this.client.call("FT._LIST");
    } catch (error: any) {
      const message = String(error?.message ?? error).toLowerCase();
      if (message.includes("unknown command")) {
        throw new Error(
          "Valkey search module is not available. Please ensure Valkey is running with the search module enabled.",
        );
      }
      throw error;
    }
  }

  private async createIndex(): Promise<void> {
    await this.ensureSearchModule();

    try {
      await this.client.call("FT.INFO", this.collectionName);
      return;
    } catch (error: any) {
      const message = String(error?.message ?? error).toLowerCase();
      if (
        !message.includes("not found") &&
        !message.includes("unknown index")

View on GitHub (pinned to 001c235229)

Solutions

  1. Run a search-enabled server: use redis/redis-stack-server or a Valkey image/build with the search module, loading redisearch.so in the config.
  2. If self-hosting Valkey, build/install the search module and add --loadmodule /path/to/search.so to the server command.
  3. Use Redis Cloud / a provider plan that includes RediSearch (FT.* commands).
  4. Verify with redis-cli FT._LIST — it must list indexes, not return 'unknown command'.

Example fix

# before
docker run -p 6379:6379 redis:latest

# after
docker run -p 6379:6379 redis/redis-stack-server:latest
Defensive patterns

Strategy: validation

Validate before calling

// pre-flight: confirm search module before constructing Memory
import { createClient } from 'redis';
const redis = createClient({ url: valkeyUrl });
await redis.connect();
try { await redis.sendCommand(['FT._LIST']); } catch { throw new Error('Server lacks the search module — use redis-stack or a search-enabled Valkey build'); } finally { await redis.disconnect(); }

Try / catch

try { await memory.add(text); } catch (e) { if (e instanceof Error && e.message.includes('search module')) { /* switch connection string to a search-enabled server */ } else throw e; }

Prevention

When it happens

Trigger: Connecting to a stock Redis or Valkey server compiled/launched without the search module (no --loadmodule redisearch.so / search-module build); managed Redis offerings without RediSearch; targeting the wrong port that happens to run plain Redis.

Common situations: Using plain redis:latest Docker image instead of a search-enabled image (e.g. valkey/valkey-search or redis/redis-stack-server); self-compiled Valkey without the module; managed Redis (ElastiCache non-cluster with search disabled) that lacks FT commands.

Related errors


AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15). Data as JSON: /api/errors/c1c31799788ab4f1. Report an issue: GitHub.