Tracing
Call-graph spans, export to POST /v1/traces, and annotating branches.
strikeflow records each agent run as a tree of spans and exports gzip JSON batches to Strike (run, step, and decision span types).
Enable export
Tracing exports when all of the following hold:
STRIKEFLOW_TRACINGis not0STRIKE_API_KEYis setSTRIKE_PROJECTis set (or you passproject=tostrike.trace)
import os
import strikeflow as strike
os.environ["STRIKE_PROJECT"] = "support-bot"
strike.configure(api_key=os.environ["STRIKE_API_KEY"])Open a run
import strikeflow as strike
with strike.trace("support-agent", run_id="ticket-4411") as run:
with run.step("triage"):
result = strike.decide("Refund?", "yes_no", context="Duplicate charge reported.")
print(result.trace_id)
strike.flush() # wait for background export (also runs at process exit)Child spans:
run.llm(provider, model)for LLM calls you record manuallyrun.tool(name, host=...)for tool callsrun.step(name)for generic steps
Decisions made inside an open run become type: "decision" spans with probabilities and metadata.
Standalone decisions
If you call decide without strike.trace, the tracer still emits a minimal run when STRIKE_PROJECT is set. Pass run_id= to align with your host framework id (OpenAI response id, host thread id, etc.).
Annotate routing
After you choose a branch in application code, upsert path_taken and optional fallback metadata:
import strikeflow as strike
result = strike.decide("Which team?", ["billing", "tech"], context="unclear message")
if result.confidence < 0.7:
strike.get_tracer().annotate(
result.trace_id,
path_taken="llm",
fallback={"used": True, "reason": "low_confidence", "to": "llm", "threshold": 0.7},
)Ingest upserts by span_id, so annotations can arrive in a later batch.
Transport
| Item | Value |
|---|---|
| URL | POST {STRIKE_API_URL}/v1/traces |
| Auth | Authorization: Bearer <STRIKE_API_KEY> |
| Body | gzip JSON: {"sdk":"strikeflow-py/<version>","project":"...","spans":[...]} |
| Size limit | 1 MB per batch (larger batches are dropped) |
Export runs on a background thread and never raises into your agent.
Graph routing
strike_router and Graph.add_decision_edge write path_taken and metadata.fallback on decision spans automatically.
Console graph view
Spans exported with your project name can appear in the Strike console graph view when trace storage is available. See Graph view.