In agri-food supply chains (ASCs), consumers pay for agri-food products produced by farmers. During this process, consumers emphasize the importance of agri-food safety while farmers expect to increase their profits. Due to the complexity and dynamics of ASCs, the effective traceability and management for agri-food products face huge challenges. However, most of the existing solutions cannot well meet the requirements of traceability and management in ASCs. To address these challenges, we first design a blockchain-based ASC framework to provide product traceability, which guarantees decentralized security for the agri-food tracing data in ASCs. Next, a Deep Reinforcement learning based Supply Chain Management (DR-SCM) method is proposed to make effective decisions on the production and storage of agri-food products for profit optimization. The extensive simulation experiments are conducted to demonstrate the effectiveness of the proposed blockchain-based framework and the DR-SCM method under different ASC environments. The results show that reliable product traceability is well guaranteed by using the proposed blockchain-based ASC framework. Moreover, the DR-SCM can achieve higher product profits than heuristic and Q-learning methods.