Skip to main content
LangChain, as a callback handler.
That is the whole integration. From here every call the client makes is recorded on the open trajectory.

What is distinctive

A handler rather than a wrapper, because LangChain already has the seam. Pass it where you pass any other callback and every model call, tool call and retrieval in the chain lands on the trajectory.

In context

The witness block opens the trajectory and closes it on exit, including when the body raises — an episode that ended badly is exactly the one worth having a record of.

Recording without content

Shape and metadata only: model, latency, token counts, tool names. No prompt or response text. The governed facts are unchanged.
Authority is never asked for by an adapter. It stays an explicit trajectory.authorize(...) call, so importing a middleware can never become a spend decision. See authorise an action.