Let X be a smooth Calabi-Yau threefold, the Donaldson-Thomas type invariants are virtual count of ideal sheaves. To every point in the Donaldson-Thomas moduli space, we associate a cyclic dg Lie algebra L which we call Donaldson-Thomas dg Lie algebra. By transfer theorem there exists a cyclic L_infinity algebra structure on the cohomology H(L), from which we can write down a potential function W. In some cases, the potential function W is holomorphic such that locally the Donaldson-Thomas moduli space is the critical locus of the function W. The pointed Donaldson-Thomas invariant is the Milnor number of the holomorphic function W.