Inspired by AND/OR search spaces for graphical models recently introduced, we propose to augment Multi-Valued Decision Diagrams (MDD) with AND nodes, in order to capture function decomposition structure and to extend these compiled data structures to general weighted graphical models (e.g., probabilistic models). We present the AND/OR Multi-Valued Decision Diagram (AOMDD) which compiles a graphical model into a canonical form that supports polynomial (e.g., solution counting, belief updating) or constant time (e.g. equivalence of graphical models) queries. We provide two algorithms for compiling the AOMDD of a graphical model. The first is search based, and works by applying reduction rules to the trace of the memory intensive AND/OR search algorithm. The second algorithm is based on a Bucket Elimination schedule for assembling the AOMDD for a graphical model starting from the AOMDDs for its functions, and combining them via the APPLY operator. For both algorithms, the compilation tim...