Deco will replace the incumbent Mateu Alemany in the role when the transfer window closes on September 1.
As a player, Deco starred for four seasons for Barcelona between 2004 and 2008, winning two La Liga titles and the UEFA Champions League in 2006.
Born in Brazil, the 45-year-old played internationally for Portugal, winning 75 caps and scoring five goals.
A statement from the Spanish champions read:"Barcelona and Anderson Luis de Souza "Deco" have reached an agreement regarding his joining the club.
"The first team player between 2004 and 2008 signs a contract as sporting director at the club for the next three seasons.
"Deco will be in charge of setting FC Barcelona's sporting philosophy and putting together the squad with the coach and the coaching and becoming head of the football section.
"This incorporation is in line with the statement released on 2 May in which the President and the director of the Football Area, Mateu Alemany, agreed his release from his duties once the current transfer window comes to an end on 2 September.
"As stated in the release Deco and Mateu Alemany will continue to work together until the closing of the transfer window.
"In the coming weeks, the club will release details of the FC Barcelona sporting structure."