It's Rudimentary Intelligence, in Dragon Magazine #327, p. 73. It costs 8,000 extra gold and grants the construct an Int score of half your CL without interfering with the control you have over the construct.
Constructs have immunity to mind-affecting effects regardless of whether or not they are mindless; it's a feature of the Construct type.