Anyone here read Warbreaker by Brandon Sanderson? Excellent take on an intelligent weapon. (Awesome book as well)
The concept behind it is one can basically infuse their "soul" (I use this term loosely as it is not actually their soul, but their "color", read the book to understand it better) in an inanimate objects and make them move, the closer they are to living creatures (ie: leather, straw, etc) the easier it is to work with. People can give their souls to other people, and the more souls you put into an object the more life like they act, and they act only to your will. Each object can only do one thing when initially being brought to life, the more complex the order the harder to awaken it. Bringing metal to life is considered an impossibility, as it was never living, but after pouring a ridiculous amount of souls into it someone managed to awaken a Sword, the act it was given upon being awakened was "Slay Evil". It wasn't able to move around like other objects in the book, but it was able to speak telepathically to its holders.
The issue was, it was a sword, it had never been alive. It didn't know who was evil or what evil was for that matter. When someone tried to use it, it immediately began to drain the user's color(soul) at an incredible rate, meanwhile it cut through any other person or weapon with ease, but when they ran out of "color" they died. Anyone near it with less than noble intentions felt an irresistable urge to pick it up and draw the blade from its sheath. Whenever someone touched it, it would talk to them, "Do you want to slay evil?"