Weird iMessage behavior on Yosemite
First make sure the "Save history when conversations are closed" is checked in "Preferences-->General" to have an archive of conversations in the future.

Second the Messages.app history and archives are saved to a couple locations in Yosemite.

~/Library/Containers/com.apple.iChat/Data/Library/Messages/
~/Library/Messages/


Backup the files in the folder ~/Library/Messages/ and save to a separate location to have a backup of your previous messages.(if they exist)

Then remove both the files in above paths:

rm -rf ~/Library/Containers/com.apple.iChat/Data/Library/Messages/*
rm -rf ~/Library/Messages


Restart Messages.app and the below message will appear that it is rebuilding your Messages database.  The couple times a have done this it resulted in having to just restart the machine as I didn't want to wait.



Just remember to make a backup of any files you delete as they hold archives of previous conversations.