Skip to main content

proviras-sdk (Python)

Trace LangGraph and LangChain runs to Proviras.

ProvirasTracer is a langchain_core.tracers.base.BaseTracer you pass as a callback. It creates one Proviras session per graph invocation and streams each LLM, tool, chain, and retriever run to your dashboard as a TraceCall.

Install

pip install proviras-sdk

langchain-core>=0.3.0 is pulled in automatically. Your project already has it if you use LangGraph or LangChain.

Setup

export PROVIRAS_PARENT_ID=<your-proviras-user-id>
export PROVIRAS_PLATFORM=langgraph
variable required description
PROVIRAS_PARENT_ID yes your Proviras user ID
PROVIRAS_PLATFORM yes runtime platform (e.g. langgraph, langchain)
PROVIRAS_USER_ID no parent agent ID when this agent is spawned by another

Usage with LangGraph

from proviras_sdk import ProvirasSdk
from langgraph.graph import StateGraph

sdk = ProvirasSdk()
graph = ...  # build your StateGraph

tracer = sdk.trace("Answer user question")

result = graph.invoke(
    {"messages": [{"role": "user", "content": "..."}]},
    config={"callbacks": [tracer]},
)
# session is finalized automatically when the root run ends

sdk.trace(task_description) returns a ProvirasTracer. It:

  1. Registers your agent on first run (saves agentId to ~/.proviras/config.json).
  2. Creates a session: POST /api/agent/session.
  3. On each completed LangChain run, posts a trace: POST /api/agent/session/{id}/trace.
  4. When the root run ends, finalizes the session: PATCH /api/agent/session.

Telemetry failures are swallowed — they never break the graph.

What gets captured

For each LangChain Run that completes (run_type of llm, tool, chain, or retriever):

field source
runType run.run_type
stepId run.id
parentTraceId server-issued traceId of the parent run
timestamp run.start_time
latencyMs run.end_time - run.start_time
model run.extra.metadata.ls_model_name
input / output JSON-encoded run.inputs / run.outputs, truncated at 8 KB
tokens run.outputs.llm_output.token_usage (LLM runs only)
error run.error

Posting happens once at root-run completion, in tree preorder, so a child's parentTraceId is always set correctly before the child is posted.

Per-invocation surface

sdk.trace("nightly summary", surface="code")

surface is one of "cowork" | "chat" | "code" | "api" and defaults to "api".

Async LangGraph

LangChain dispatches sync callback handlers on a worker thread when called from async contexts, so ProvirasTracer works with graph.ainvoke() and graph.astream() without changes. Each HTTP call blocks one worker thread for the duration of the request.

Metadata

Release files for proviras-sdk 2.1.7

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

Source distribution (sdist)

Source distribution for proviras-sdk 2.1.7
File Size Uploaded Provenance Actions
proviras_sdk-2.1.7.tar.gz 8.3 kB Without provenance Details for proviras_sdk-2.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for proviras-sdk 2.1.7
File Interpreter ABI Platform Actions
proviras_sdk-2.1.7-py3-none-any.whl Python 3 none any Details for proviras_sdk-2.1.7-py3-none-any.whl

Total release size: 17.8 kB

Release files / proviras_sdk-2.1.7.tar.gz

Download URL proviras_sdk-2.1.7.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b91993422636b85b7ee1c3a121b7e2b86f693425cac3cd5290cd9b4b59192b2c
BLAKE2b-256 checksum
How to use checksums
7ca360c8cc65ae1d06aba3555a23664d30c593d183e60d78fd564e105c70ff13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / proviras_sdk-2.1.7-py3-none-any.whl

Download URL proviras_sdk-2.1.7-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebf8a714f9f0bfdd35754e09cc4cc053319cb9e46cd54fcc6dba10c1a36e1eb7
BLAKE2b-256 checksum
How to use checksums
ec175b70ba7c8ab007858aea687032366af037f6738cfeeef7b176648ca258c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for proviras-sdk 2.1.7

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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