Personality matrix/Legends

A Personality matrix was a component of a droid that dictated it's personality and behaviour.

Source
The New Essential Guide to Droids