It would be good to note that even our leading minds in science have still not been able to tell us what thoughts are, let alone where they come from.
Thought is provably more a function of the "mind" than of the brain. This is to suggest that "thoughts" have their genesis in a realm that we have not learned to monitor or even properly identify as of yet. This realm is what the mystics would call the Spirit realm.
I have had numerous experiences in which i had the odd pleasure of watching evil spirits cast thoughts into the "minds" of those they wished to lead astray and have also experienced thoughts from the LIGHT (what you might call God). This can and does absolutely happen all the time. What do you think Q meant when he said, "the Lord is leading us all"?
What do you think "Jesus" meant when he said, “Very truly I tell you, the Son can do nothing by himself; he can do only what he sees his Father doing, because whatever the Father does the Son also does. For the Father loves the Son and shows him all he does. "?
The question is, where are these thoughts coming from and where are they leading you?