Skip to main content

WizardFlow Python SDK

A lightweight recorder for Python agents. WizardFlow turns an agent run into a portable WizardFlow JSONL file that you can replay as an interactive graph, inspect with ordinary tools, or attach to a bug report.

Drop the file into getwizardflow.com and it is processed entirely in the browser, so nothing is uploaded. You can also replay it locally with wizardflow replay, or collect many runs, and the traces and logs of any app with OpenTelemetry, in a local dashboard: wizardflow dashboard.

WizardFlow replaying an agent run

▶ Watch this run replay

Why WizardFlow?

  • The trace is a file. Commit, diff, grep, archive, or share it without an observability account.
  • Replay it anywhere. Use the bundled local viewer or the fully client-side hosted viewer.
  • Zero runtime dependencies. The package is pure Python and requires no daemon or framework. Recording, OTLP export of a finished run, and the local dashboard with its OTLP receiver all use only the standard library (see Dependencies).
  • Explicit by design. Your code chooses which node executions and values enter the trace.
  • OpenTelemetry is optional. The same node executions can also be projected to OTLP-compatible observability backends.

Install

pip install wizardflow

Dependencies

None. Recording, replay, Markdown/HTML/JSON export, the local dashboard with its database and OTLP receiver, and sending to an OTLP endpoint, live while recording or a finished run later, all use only the Python standard library. WizardFlow installs anywhere and never pins a version your app also uses.

The OpenTelemetry packages only come in when you want WizardFlow's spans inside your app's own traces:

Live export (init(otel=True)) Needs
Straight to an endpoint (otel_endpoint=...), e.g. to watch runs arrive in wizardflow dashboard Nothing extra
Same, joined to your app's own traces opentelemetry-sdk and opentelemetry-exporter-otlp-proto-http
Into your app's own tracing (no otel_endpoint) opentelemetry-api, which an app with OpenTelemetry already has

With an endpoint, WizardFlow uses the OpenTelemetry SDK when it is installed and its own sender otherwise; otel_exporter picks one explicitly. See the OpenTelemetry guide.

Quickstart

import uuid

import wizardflow

trace = wizardflow.init(
    output_dir="traces",
    file_prefix="run",
    nodes=["generator"],
)

message_id = str(uuid.uuid4())
input_value = ...

with trace.node(message_id, "generator") as node:
    node.log_input(input_value)
    output_value = ...
    node.log_output(output_value)

trace_path = trace.end_message(message_id)
print(trace_path)

trace.node(...) records the node's execution interval. log_input() and log_output() preserve their JSON-compatible values in the trace, and end_message() appends the completed message to JSONL. There is no separate save() call.

Recording mistakes such as an unknown node id are logged as warnings rather than raised into your app; pass on_error="raise" to make them raise (handy in tests). Pass enabled=False, or set WIZARDFLOW_ENABLED=false, to turn tracing off while keeping the same API. See docs/recording.md.

Drop trace_path into getwizardflow.com, or open it locally:

wizardflow replay traces/run__<timestamp>.jsonl

The module-level style remains available for applications that use one default trace:

wizardflow.init(nodes=["generator"])

with wizardflow.node("msg-1", "generator") as node:
    node.log_input(input_value)
    node.log_output(output_value)

wizardflow.end_message("msg-1")

Local dashboard

For more than one run, wizardflow dashboard keeps your runs and any OpenTelemetry traces in a local SQLite database: a span waterfall with the graph beside it, GenAI messages and token counts, and a receiver on localhost:4318 that apps with OpenTelemetry can send to directly.

wizardflow dashboard run.jsonl   # import a run, then open the dashboard

The WizardFlow dashboard: a span waterfall, the graph, and the span inspector

See the dashboard guide.

Optional OpenTelemetry export

Enable OTLP trace export while retaining JSONL as the portable source of truth. Sending to an endpoint needs no extra packages; to have the spans join your app's own OpenTelemetry traces, install the OTel SDK (see Dependencies):

trace = wizardflow.init(
    nodes=["generator"],
    name="my-agent",
    otel=True,
    otel_endpoint="http://localhost:4318/v1/traces",
    otel_workflow_name="answer",
)

with trace.workflow() as run:               # one workflow = one OTel trace
    run.set_info(otel_attributes={"session.id": chat_id})
    with run.node("generator", kind="llm") as node:
        node.log_input(input_value)
        node.log_output(output_value)

trace.close_otel()

otel_attributes sets exact keys on the workflow's root span. For example, session.id groups traces into Phoenix sessions, and langfuse.session.id into Langfuse sessions.

Generic logs can optionally choose an exact application-owned span attribute without changing their JSONL/UI label:

node.log("quality", 0.92, otel_attribute="app.response.quality")

Content export is enabled by default when OTel export is enabled, with otel_include_content=False and CLI --no-include-content available when the receiver should only get metadata. See the OpenTelemetry guide for provider ownership, GenAI mappings, content controls, graph events, and independent JSONL/OTel lifecycles. Existing artifacts can be exported later, without any OTel packages:

wizardflow otel export run.jsonl --endpoint http://localhost:4318/v1/traces

LangGraph topology

WizardFlow can read nodes and edges from a compiled LangGraph application without importing LangGraph itself:

trace = wizardflow.init_from_langgraph(
    compiled_app,
    output_dir="traces",
    file_prefix="run",
)

Runtime recording then uses the same trace.node(...) API. Extraction is duck-typed through app.get_graph().

Documentation

  • Recording agent runs — messages, node scopes, semantic records, generic logs, kinds, output selection, multiple clients, and reinitialization.
  • OpenTelemetry export — OTLP setup, provider ownership, GenAI mappings, privacy controls, graph events, offline JSONL export, and cleanup.
  • WizardFlow JSONL format — record shapes, semantic fields, compatibility, and rotation.
  • CLI and local viewer — every command: live local replay, Markdown, HTML, and JSON export, the dashboard, and database import.
  • OTel dashboard — import runs and OTLP JSON or receive OTLP live into a local database, browse projects, traces, and logs, open graph replay, and map attributes.

CLI at a glance

# Replay: one run file, nothing stored
wizardflow replay run.jsonl            # interactive local replay
wizardflow replay --latest traces/     # newest run in a directory
wizardflow md run.jsonl -o run.md      # Markdown export
wizardflow html run.jsonl -o run.html
wizardflow json run.jsonl -o run.json

# Dashboard: all your runs and OpenTelemetry data in a local database
wizardflow dashboard                   # open it, receiving OTLP on :4318
wizardflow dashboard run.jsonl         # import a run (or OTLP JSON), then open it
wizardflow db import run.jsonl         # import without opening

The replay commands read both WizardFlow JSONL and the single-document JSON form. See the CLI guide for flags, live-trace behavior, and rotated-part navigation.

Examples

Runnable examples live in examples/:

  • quickstart.py records a small linear flow.
  • multibranch.py records two messages that take different graph branches.

Development

See CONTRIBUTING.md for local tests and maintainer workflows.

Metadata

Release files for wizardflow 0.10.0

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

Source distribution (sdist)

Source distribution for wizardflow 0.10.0
File Size Uploaded Provenance Actions
wizardflow-0.10.0.tar.gz 1.0 MB With provenance Details for wizardflow-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wizardflow 0.10.0
File Interpreter ABI Platform Actions
wizardflow-0.10.0-py3-none-any.whl Python 3 none any Details for wizardflow-0.10.0-py3-none-any.whl

Total release size: 2.0 MB

Release files / wizardflow-0.10.0.tar.gz

Download URL wizardflow-0.10.0.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
73f55cfcec980e98c8a41330c22ad1a0a119d6312bee6bc82911d7dc6ec87d9e
BLAKE2b-256 checksum
How to use checksums
f305af4bbd3738bea7f68bb1d9d93b90b2f392866f2ec0dbbc5aaabc3671796d
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 Nov 23, 2026.

Transparency log

Release files / wizardflow-0.10.0-py3-none-any.whl

Download URL wizardflow-0.10.0-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1a962132cef92ed8cf24836f222c6d11413af66805e55351be6e1125feeb4f98
BLAKE2b-256 checksum
How to use checksums
aff221508000070b8d68a1b56948583c0503a16d3564ad850225732c5f8f085d
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 Nov 23, 2026.

Transparency log

Security for wizardflow 0.10.0

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 wizardflow-0.10.0.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 Nov 23, 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