  Given a complex variety $X$, a linear algebraic group $G$ and a
representation $\rho$ of the fundamental group $\pi\_1(X,x)$ into $G$, we
develop a framework for constructing a functorial mixed Hodge structure on the
formal local ring of the representation variety of $\pi\_1(X,x)$ into $G$ at
$\rho$ using mixed Hodgediagrams and methods of $L\_\infty$ algebras. We apply
it in two geometric situations: either when $X$ is compact K{\"a}hler and
$\rho$ is the monodromy of a variation of Hodge structure, or when $X$ is
smooth quasi-projective and $\rho$ has finite image.
