def to_storage_dict(self, exclude_fields: Optional[List[str]] = None) -> Dict[str, Any]:
        """Convert entity to a dictionary suitable for storage in vector databases.

        This method handles serialization of complex types (dicts, lists) to JSON strings,
        except for specific fields that should remain as objects (like breadcrumbs).

        Args:
            exclude_fields: Optional list of field names to exclude from serialization

        Returns:
            Dict with all fields properly serialized for storage
        """
        # Start with the full model dump
        data = self.model_dump()

        # Helper function to recursively clean nested structures
        def clean_nested_data(obj, exclude_set):
            if isinstance(obj, dict):
                # Remove excluded fields and recursively clean remaining values
                cleaned = {}
                for key, value in obj.items():
                    if key not in exclude_set:
                        cleaned[key] = clean_nested_data(value, exclude_set)
                return cleaned
            elif isinstance(obj, list):
                # Recursively clean each item in the list
                return [clean_nested_data(item, exclude_set) for item in obj]
            elif isinstance(obj, UUID):
                # Convert UUID objects to strings
                return str(obj)
            else:
                # Return primitive types as-is
                return obj

        # Create set of fields to exclude for faster lookup
        exclude_set = set(exclude_fields) if exclude_fields else set()

        # Recursively clean the data
        data = clean_nested_data(data, exclude_set)

        # Fields that should remain as objects and not be JSON serialized
        object_fields = {"breadcrumbs"}

        # Serialize complex types to JSON strings, except for specified object fields
        for key, value in data.items():
            if key not in object_fields and isinstance(value, (dict, list)):
                data[key] = json.dumps(value)

            return data
Convert entity to a dictionary suitable for storage in vector databases.

        This method handles serialization of complex types (dicts, lists) to JSON strings,
        except for specific fields that should remain as objects (like breadcrumbs).

        Args:
            exclude_fields: Optional list of field names to exclude from serialization

        Returns:
            Dict with all fields properly serialized for storage
        
backend/airweave/platform/entities/_base.py