First, let's take a look at the diplomatic modifiers which can improve your relationship:
-We have a DoF
-We have a DoF with the same people
-We denounced the same people
-You freed their captured citizens
Now, the negative modifiers
-They covet land of yours
-They covet wonders you built
-You're expanding to agressively
-You denounced them
-They denounced you
-You refused a request after making a DoF
-Your friends found reason to denounce you
-You denounced a friend
-You demanded the not settle near you
-You broke a promise to not settle near them
-You're a warmonger
And I'm sure there are more. Now, what do we need to fix the AI? Simply more positive modifiers, i.e.
-We're at war with the same person
-You agreed to a request after a DoF was made
-We have good trade deals
-You were merciful
And some more couldn't go amiss.
-We have a DoF
-We have a DoF with the same people
-We denounced the same people
-You freed their captured citizens
Now, the negative modifiers
-They covet land of yours
-They covet wonders you built
-You're expanding to agressively
-You denounced them
-They denounced you
-You refused a request after making a DoF
-Your friends found reason to denounce you
-You denounced a friend
-You demanded the not settle near you
-You broke a promise to not settle near them
-You're a warmonger
And I'm sure there are more. Now, what do we need to fix the AI? Simply more positive modifiers, i.e.
-We're at war with the same person
-You agreed to a request after a DoF was made
-We have good trade deals
-You were merciful
And some more couldn't go amiss.