mem0ai/mem0 · error · ValueError

Invalid collection_name: {v!r}. Must start with a letter or

Error message

Invalid collection_name: {v!r}. Must start with a letter or underscore and contain only letters, digits, and underscores.

What it means

Error "Invalid collection_name: {v!r}. Must start with a letter or underscore and contain only letters, digits, and underscores." thrown in mem0ai/mem0.

Source

Thrown at mem0/configs/vector_stores/neptune.py:34

class NeptuneAnalyticsConfig(BaseModel):
    """
    Configuration class for Amazon Neptune Analytics vector store.
    
    Amazon Neptune Analytics is a graph analytics engine that can be used as a vector store
    for storing and retrieving memory embeddings in Mem0.
    
    Attributes:
        collection_name (str): Name of the collection to store vectors. Defaults to "mem0".
        endpoint (str): Neptune Analytics graph endpoint URL or Graph ID for the runtime.
    """
    collection_name: str = Field("mem0", description="Default name for the collection")
    endpoint: str = Field("endpoint", description="Graph ID for the runtime")

    @field_validator("collection_name")
    def validate_collection_name(cls, v):
        if not _VALID_CYPHER_IDENTIFIER.match(v):
            raise ValueError(
                f"Invalid collection_name: {v!r}. Must start with a letter or underscore and "
                "contain only letters, digits, and underscores."
            )
        return v

    model_config = ConfigDict(arbitrary_types_allowed=False)

View on GitHub (pinned to 001c235229)

Solutions

  1. Rename the collection to start with a letter or underscore and use only letters, digits, and underscores.

When it happens

Trigger: Thrown at mem0/configs/vector_stores/neptune.py:34 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/2a1a79255a7f2c90. Report an issue: GitHub.