mem0ai/mem0 · error · ValueError
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. The search module can be loaded using the --loadmodule option with the valkey-search library. For installation and setup instructions, refer to the Valkey Search documentation.
What it means
Error "Valkey search module is not available. Please ensure Valkey is running with the search module enabled. The search module can be loaded using the --loadmodule option with the valkey-search library. For installation and setup instructions, refer to the Valkey Search documentation." thrown in mem0ai/mem0.
Source
Thrown at mem0/vector_stores/valkey.py:212
return cmd
def _create_index(self, embedding_model_dims):
"""
Create the search index with the specified schema.
Args:
embedding_model_dims (int): Dimensions for the vector embeddings.
Raises:
ValueError: If the search module is not available.
Exception: For other errors during index creation.
"""
# Check if the search module is available
try:
self.client.execute_command("FT._LIST")
except ResponseError as e:
if "unknown command" in str(e).lower():
raise ValueError(
"Valkey search module is not available. Please ensure Valkey is running with the search module enabled. "
"The search module can be loaded using the --loadmodule option with the valkey-search library. "
"For installation and setup instructions, refer to the Valkey Search documentation."
)
else:
logger.exception(f"Error checking search module: {e}")
raise
# Check if the index already exists
try:
self.client.ft(self.collection_name).info()
return
except ResponseError as e:
if "not found" not in str(e).lower():
logger.exception(f"Error checking index existence: {e}")
raise
# Build and execute the index creation commandView on GitHub (pinned to 001c235229)
Solutions
- Run Valkey with the search module loaded (--loadmodule valkey-search) or use a distribution that bundles it.
When it happens
Trigger: Thrown at mem0/vector_stores/valkey.py:212 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/72d7fd6a80ca153e.
Report an issue: GitHub.