Project-owned top-level traces
Create oneSovaraClient for a stable project name. Use one top-level trace for
a workflow, evaluation sample, batch job, or durable conversation. A recording
session appends work to that trace; a turn groups
one interaction within it.
traceId,
or reuse the ID from getTraceId() in a previous SDK trace. Reuse either value to add steps
to the same trace in that project.
traceId. trace() returns the callback result. To
read the trace ID, call sovara_client.getTraceId() inside the callback
while the trace is active. Pass that ID to the CLI, here as TRACE_ID:
Steps and explicit tracing
Supported provider, framework tool, and MCP calls inside a trace become ordered steps. Wrap an important uncaptured application boundary withtrace:
Subtraces
Usesovara_client.subtrace(...) for child agents, delegated branches, parallel
work, and coherent multi-step phases:
subtrace() for child work. Nesting trace() does not create a child trace.
Trace metadata
latency_ms. See the
API reference for validation rules.
Evaluation samples
Pass an existing evaluation run ID withevalRunId to record a sample under it:
Lessons
When automatic injection is enabled and the required models are configured, supported model calls retrieve from the project’s production lessons. Unapplied proposals are not used. Narrow retrieval with the trace’slessonScope option:
sovara_client.lessonScope(...)
inside the trace. Use null for all folders or [] for no lessons:
Logs and concurrency
Log capture is enabled by default. Pass{ captureLogs: false } as the third
argument to trace() for concurrent top-level traces to avoid mixing process output.
Run the application
Run the application normally. The SDK records the trace:Explicit conversation turns
trace() opens a recording session without an implicit turn. turn(options, fn)
declares a scoped interaction and returns the callback result. Work outside turn
callbacks is still captured, with no turn membership.
traceId and declare
each interaction explicitly:
turnInput is an optional string for the interaction; logged input and output
describe the whole trace. Do not nest turns in the same trace. Await tasks and
consume streams before the outer callback returns.