LangChain
Auto-trace chain, LLM, and tool lifecycle events from LangChain and LangGraph.
Installation
Section titled “Installation”pip install "axonpush[langchain]"import osfrom axonpush import AxonPushfrom axonpush.integrations.langchain import AxonPushCallbackHandler
client = AxonPush( api_key=os.environ["AXONPUSH_API_KEY"], tenant_id=os.environ["AXONPUSH_TENANT_ID"], base_url=os.environ.get("AXONPUSH_BASE_URL", "https://api.axonpush.xyz"),)
handler = AxonPushCallbackHandler( client=client, channel_id=1, agent_id="langchain-agent",)Pass the handler via config to any chain or agent:
result = chain.invoke(input, config={"callbacks": [handler]})result = agent_executor.invoke( {"input": "What are AI agents?"}, config={"callbacks": [handler]},)Events Traced
Section titled “Events Traced”| Event | When |
|---|---|
chain.start | Chain begins execution |
chain.end | Chain completes |
llm.start | LLM call begins |
llm.end | LLM call completes |
tool.*.start | Tool execution begins |
tool.end | Tool execution completes |