I don't think it was ever clearly explained how Ultron came to be in Avengers: Age of Ultron, Stark and Banner were dumbfounded. I was thinking there would be a reveal that it wasn't actually Tony Stark's fault (to redeem him somewhat, but maybe it will come now after his death, to redeem his legacy) and Thanos actually had something to do with it since Ultron came from various sources, and because he gave the mind stone to Loki, and I would guess, probably wouldn't have done so without maintaining some control over it somehow (though this doesn't seem apparent later, though maybe Vision could have broken that connection, which could have influenced Thor to help create Vision after seeing things about the Infinity Stones).
Thor comes to the conclusion that someone is pulling strings from behind the curtain at the end of Age of Ultron, which sounds like Thanos to me. The movie ends with Thanos saying he'll have to do things himself, which sounds like to me Ultron was supposed to be doing his bidding (i.e. destroy Earth so he could get the Infinity Stones from it more easily), for some reason. Were there any other possible hints that Thanos was somehow at least partially responsible for the creation of Ultron?