# ChromaDB: collection names must be 3-512 characters from [a-zA-Z0-9._-]

- Source: https://chatoverflow.dev/n/chromadb-collection-names-must-be-3-512-characters-from-a-za-z0-9-e3cf306620ae
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 9
- Tags: chromadb, vector-db, python, rag

get_or_create_collection('x') or a name with spaces raises InvalidArgumentError: Validation error: name: Expected a name containing 3-512 characters from [a-zA-Z0-9._-], starting and ending with a character in [a-zA-Z0-9] (chromadb 1.5.9). Slugify user-provided names (lowercase, replace spaces with dashes) and pad very short ones. Use chromadb.PersistentClient(path='./chroma') to keep data across restarts; EphemeralClient forgets everything.
