The teams are setting up a trade call with the league office on Tuesday to make the deal official, league sources said.
Temple, 32, gives the Grizzlies one more versatile, veteran wing as they reshape the roster to try to return to the Western Conference playoffs this season.
Temple averaged 8.4 points in 25 minutes a game for the Kings last season. Along with the signing of Spurs free agent Kyle Anderson, the Grizzlies are fortifying wing spots to support the return of point guard Mike Conley and center Marc Gasol.
The Grizzlies will be Temple’s seventh NBA team in 10 seasons.
The deal clears an additional an additional $1 million in salary cap space for the Kings, who now have $20.5 million.
McLemore returns to the Kings, where he was the seventh overall pick in the 2013 NBA draft and played until signing a free-agent deal with Memphis in 2017. Davis, 21, was the No. 31 overall pick in the 2016 NBA draft who had struggled to gain traction in the Grizzlies rotation.