How did he know they'd need it in the future?
I think Teddy is the smartest of the Mecha in the whole movie.
I think I get it now. David was in a simulation at the end and everything was fake including Teddy. They only included him to make it seem more like a fantasy for David.
Because Teddy is AWESOME. "The bear told me." "I told her."