Riku-Ansem

Riku-Ansem is the form that Riku takes after he fails to capture Roxas under the request of DiZ (Ansem the Wise) to awaken Sora so he summoned the dark power of Xehanort's Heartless in order to use it to capture Roxas because Roxas was beating Riku. He succeeds and takes Roxas away where Organization XIII can not find him.

Riku takes this form at the end of Kingdom Hearts 358/2 Days and continues to remain in this form throughout Kingdom Hearts II, and most people believed that he was Xehanort's Heartless until Kairi found out that he was Riku and revealed his identity to Sora, Donald and Goofy.

After Sora and company catch up with Ansem the Wise, the Kingdom Hearts Encoder that Ansem the Wise uses to attempt to turn Kingdom Hearts into data. This plan backfires and during the explosion, Riku is transformed back into his normal form. It can be assumed that this explosion rids Riku of the presence of Xehanort's Heartless within him.

However, it also reduced his power of darkness, as revealed when they attempted to leave the World That Never Was and Riku failed to open a Corridor of Darkness.

Kingdom Hearts II
Mysterious wielder of the darkness.
 * Part I - Ansem

What could his true purpose be?

The form Sora's longtime friend Riku chose.
 * Part II - Riku

''Though Xehanort tried to control Riku from within, Riku's heart proved stronger. But the only way to wield darkness fully was to become it.''

''Riku began calling himself "Ansem", perhaps as a sign of resolve. He would live in darkness if that's what it took to wake Sora.''