Skip to main content

pytracer-langgraph

pyTracer adapter for LangGraph and LangChain. It auto-instruments an agent through LangChain's callback system, so you do not add @op by hand: model calls, tool calls, and graph nodes are captured as pyTracer spans automatically.

import pytracer_sdk as pytracer
from pytracer_langgraph import PyTracerCallbackHandler

pytracer.configure(
    pytracer.HTTPTransport("https://gateway.internal", api_key="YOUR_KEY"),
    service_name="my-agent", branch="main", commit="abc123",
)

handler = PyTracerCallbackHandler()
app.invoke(inputs, config={"callbacks": [handler]})   # spans captured for this run

on_chat_model_start / on_llm_start become LLM spans, on_tool_start become tool spans, and LangGraph nodes become agent spans, all linked into one trace by the run tree.

One trace per request

Each run starts its own trace. To keep a request that makes several runs, or also uses another framework, in one trace, wrap it in a pyTracer span; the run nests under the span that is open when it starts:

with pytracer.start_span("answer-question"):
    app.invoke(inputs, config={"callbacks": [handler]})
    ...  # further runs, other adapters, or @op calls join the same trace

Replay

Call install_seams() and a captured run replays without adding @op to anything:

from pytracer_langgraph import PyTracerCallbackHandler, install_seams

install_seams()   # routes chat models and tools through pyTracer
app.invoke(inputs, config={"callbacks": [PyTracerCallbackHandler()]})

LangChain chat models (invoke / ainvoke / stream / astream, including a model bound with bind_tools) and tools (BaseTool.run / arun, which ToolNode and agents go through) then run through pyTracer, nested under the graph node that called them, so the replay engine can return their recorded results: in full mode neither the model nor the tools run again, in partial mode the tools stay frozen while the model runs live, and streamed replies replay chunk by chunk. A model call is matched on its messages (without the per-run message ids LangGraph assigns), its bound tools and stop words. uninstall_seams() removes the routing again.

Without install_seams() the adapter only captures, and replaying an adapter-only trace is flagged (the run has recordings but hits no @op seam) rather than silently running live. See the main README for the replay workflow.

Metadata

Release files for pytracer-langgraph 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytracer-langgraph 0.1.4
File Size Uploaded Provenance Actions
pytracer_langgraph-0.1.4.tar.gz 11.9 kB With provenance Details for pytracer_langgraph-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytracer-langgraph 0.1.4
File Interpreter ABI Platform Actions
pytracer_langgraph-0.1.4-py3-none-any.whl Python 3 none any Details for pytracer_langgraph-0.1.4-py3-none-any.whl

Total release size: 20.7 kB

Release files / pytracer_langgraph-0.1.4.tar.gz

Download URL pytracer_langgraph-0.1.4.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b7df77214b1b3a4de5f8f406a8d5129d29c9adf0e67a41efa31fbe1b89512591
BLAKE2b-256 checksum
How to use checksums
c8fccc344191a659ebcbb6a529c2769f9d2f04ee865779864323daa5f8545b3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / pytracer_langgraph-0.1.4-py3-none-any.whl

Download URL pytracer_langgraph-0.1.4-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fa024c8e052ab8ec0f0ffd839b6ee08a876ce1c1b5f5edf35e9525fe3219226
BLAKE2b-256 checksum
How to use checksums
34ca12e249544315f8972db76d123720250c8fab2032813d0fd24df31e2c5e70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for pytracer-langgraph 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pytracer_langgraph-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page