Ragland and Lee will join Jamie Collins, who signed a three-year, $30 million contract with Detroit last week, in the Lions' linebacker room. The franchise also released team captain Devon Kennard this off-season as it continues to overhaul its linebacker group.
Ragland is expected to compete with 2017 first-round pick Jarrad Davis and former second-round choice Jahlani Tavai for the inside linebacker spot.
Ragland, 26, moved into a part-time role after the Chiefs switched to a 4-3 base defense last season. After being a healthy scratch in the first two games of the regular season, he started seven of the team's next 14 contests and Super Bowl LIV against the 49ers.
The Buffalo Bills selected Ragland in the second round of the 2016 NFL Draft out of Alabama. He was with the Bills for only one season but never played in a regular-season game because of a torn ACL that he suffered in training camp. He was traded to the Chiefs before the 2017 campaign.
In three seasons with the Chiefs, Ragland recorded 160 total tackles, 2.5 sacks, one interception and one pass defensed.
Lee, who primarily served as a special-teams player, played 40 percent or more of special-teams snaps every season he was with San Francisco. The outside linebacker started five contests for the 49ers in 2018 and recorded a career-best 65 tackles and one sack that season.