We define a 1-cocycle in the space of long knots that is a natural generalization of the Kontsevich integral seen as a 0-cocycle. It involves a 2-form that generalizes the Knizhnik--Zamolodchikov connection. We show that the well-known close relationship between the Kontsevich integral and Vassiliev invariants (via the algebra of chord diagrams and 1T-4T relations) is preserved between our integral and Vassiliev 1-cocycles, via a change of variable similar to the one that led Birman--Lin to discover the 4T relations. We explain how this construction is related to Cirio--Faria Martins' categorification of the Knizhnik--Zamolodchikov connection.