I don't really theorize a lot, but I had this idea from reading a couple other theories.
Back in The Avengers, Tony had JARVIS hack into SHIELD's mainframe and basically download all of their files. Now, while he may have all of their files, he probably hasn't accessed all of them yet (due to a little Extremis problem), and they've just been sitting in his database until Tony decides to look through them.
So he does, and has JARVIS start skimming them for anything interesting. All of a sudden, one file causes him to freeze up and crash entirely. When Tony reboots him to investigate, JARVIS takes control of an Iron Man suit (because come on, why would Tony not have rebuilt at least one by now) and attacks Tony, before flying away, locking Tony out of his system.
Cue Avengers butt-kicking, having to battle a highly-advanced artificial intelligence which has virtually all available information on all of them. Somehow, they win; I don't know how, that's not the point of this theory.
After-credits scene has Tony and Bruce finally opening up the remains of JARVIS/Ultron and tracking down the file that corrupted him. There's not much left, but they're able to get the name of the SHIELD scientist who made the file: Dr. Henry Pym.
This doesn't automatically mean Pym's evil, just that he wrote some kind of code (maybe another AI entirely) and didn't expect JARVIS to be opening it up. Perhaps after he wrote it, it crashed SHIELD's computers, and after they got up and running again he was fired and the file was encrypted so as not to cause any more trouble, until Tony Stark dug it up.
From what I can see, this seems to be a way to not only respect the origin of Pym creating Ultron (which was always weird, considering his specialty in particle physics never alluded to an ability to program highly-advanced AI), but also fit with everything we know about the film so far: that Ultron came about as a result of the Avengers themselves (since Tony never would have hacked into SHIELD in the first place if not for the events of the first film), and while Pym's not directly "in the mix," he still has a vital hand in Ultron's birth.
Then again, this confidence might just be pride in my own idea talking, so let me know what you think, and have a great day, please.
-Dan