  We introduce and study the Wilson loops in a general 3D topological field
theories (TFTs), and show that the expectation value of Wilson loops also gives
knot invariants as in Chern-Simons theory. We study the TFTs within the
Batalin-Vilkovisky (BV) and Alexandrov-Kontsevich-Schwarz-Zaboronsky (AKSZ)
framework, and the Ward identities of these theories imply that the expectation
value of the Wilson loop is a pairing of two dual constructions of (co)cycles
of certain extended graph complex (extended from Kontsevich's graph complex to
accommodate the Wilson loop). We also prove that there is an isomorphism
between the same complex and certain extended Chevalley-Eilenberg complex of
Hamiltonian vector fields. This isomorphism allows us to generalize the Lie
algebra weight system for knots to weight systems associated with any
homological vector field and its representations. As an example we construct
knot invariants using holomorphic vector bundle over hyperKahler manifolds.
