Twilight used to think she could handle stress pretty well. The smartypants incident however proved her wrong. So she decides that when her friends aren't there she needs somepony there to help her through the stress.
So what does our lavender librarian do?
She creates an artificial intelligence.