def generate_readable_id(name: str) -> str:
    """Generate a readable ID from a name.

    Converts the name to lowercase, replaces spaces with hyphens,
    removes special characters, and adds a random suffix.
    """
    # Convert to lowercase and replace spaces with hyphens
    readable_id = name.lower().strip()

    # Replace any character that's not a letter, number, or space with nothing
    readable_id = re.sub(r"[^a-z0-9\s]", "", readable_id)
    # Replace spaces with hyphens
    readable_id = re.sub(r"\s+", "-", readable_id)
    # Ensure no consecutive hyphens
    readable_id = re.sub(r"-+", "-", readable_id)
    # Trim hyphens from start and end
    readable_id = readable_id.strip("-")

    # Add random alphanumeric suffix
    suffix = "".join(random.choices(string.ascii_lowercase + string.digits, k=6))
    readable_id = f"{readable_id}-{suffix}"

    return readable_id
Generate a readable ID from a name.

    Converts the name to lowercase, replaces spaces with hyphens,
    removes special characters, and adds a random suffix.
    
backend/airweave/schemas/collection.py