Keita leaves Liverpool after five years in which he won every major prize in English football with the Premier League, Champions League, FA Cup and League Cup.
The move marks a return to Germany for the Guinea international, who previously spent two years at RB Leipzig before joining Liverpool in 2018. He only managed 13 games for Liverpool this season, in part because of a series of injuries.
"I'm really excited for my new challenge here in Bremen," Keita said in a statement.
"This club and its philosophy will be a good match for me, so this is the right step for my career."
It is a surprise signing for Bremen, who placed 13th in their first season back in the Bundesliga after promotion and described the deal as a "transfer coup."
Much could depend on Keita's fitness as injuries regularly hampered his time at Liverpool, where he made only 129 appearances in all competitions.
Keita singled out head coach Ole Werner, who signed a contract extension at Werder Bremen on Tuesday, for helping to convince him to move to the club.
"I was impressed by what the club told me about the setup here and Werder's style of play," he said. "The coach gave me a really good feeling and showed how I can help the team."