Trace operations
Reasoning trace lifecycle operations from ReasoningMemory API reference. The signatures and behavior here are for bolt. On NAMS, start_trace, complete_trace, get_trace, and get_trace_with_steps work on synthetic traces held by the client instance; get_session_traces returns the conversation’s server-stored steps as one aggregate trace; list_traces raises NotSupportedError. See NAMS lifecycle and operations for hosted behavior. Signatures show types, keyword-only arguments (*), and defaults; they are reference declarations, not calls to execute directly.
Trace operations (bolt)
start_trace
Start a new reasoning trace.
async def start_trace(
session_id: str,
task: str,
*,
generate_embedding: bool=True,
metadata: dict[str, Any] | None=None,
triggered_by_message_id: UUID | str | None=None,
user_identifier: str | None=None,
) -> ReasoningTrace: ...
| Parameter | Description |
|---|---|
|
Session identifier |
|
Task description |
|
Whether to generate task embedding |
|
Optional metadata |
|
Optional message ID that initiated this trace. Creates an |
|
When provided, scopes the trace to a :User node via |
complete_trace
Complete a reasoning trace.
async def complete_trace(
trace_id: UUID | str,
*,
outcome: str | TraceOutcome | None=None,
success: bool | None=None,
generate_step_embeddings: bool=False,
) -> ReasoningTrace: ...
| Parameter | Description |
|---|---|
|
Trace ID to complete |
|
Final outcome. Either a free-text string (legacy) or a |
|
Whether the task succeeded. Ignored when |
|
If True, batch generate embeddings for all steps that don’t have them yet. Useful when steps were recorded with generate_embedding=False during streaming. |
get_trace
Get a trace by ID (alias for get_trace_with_steps).
async def get_trace(trace_id: UUID | str) -> ReasoningTrace | None: ...
| Parameter | Description |
|---|---|
|
Trace ID to retrieve (UUID or string) |
get_trace_with_steps
Get a complete trace with all steps and tool calls.
async def get_trace_with_steps(trace_id: UUID) -> ReasoningTrace | None: ...
| Parameter | Description |
|---|---|
|
Trace ID to retrieve |
get_session_traces
Get all traces for a session.
async def get_session_traces(session_id: str, *, limit: int=100) -> list[ReasoningTrace]: ...
| Parameter | Description |
|---|---|
|
Session identifier |
|
Maximum traces to return |
list_traces
List reasoning traces with filtering and pagination.
async def list_traces(
*,
session_id: str | None=None,
success_only: bool | None=None,
since: datetime | None=None,
until: datetime | None=None,
limit: int=100,
offset: int=0,
order_by: Literal['started_at', 'completed_at']='started_at',
order_dir: Literal['asc', 'desc']='desc',
) -> list[ReasoningTrace]: ...
| Parameter | Description |
|---|---|
|
Filter by session (optional) |
|
Filter by success status (None for all, True for successful, False for failed) |
|
Only traces started after this time |
|
Only traces started before this time |
|
Maximum traces to return |
|
Number of traces to skip (for pagination) |
|
Field to order by ('started_at' or 'completed_at') |
|
Sort direction ('asc' or 'desc') |
There are no public get_traces or delete_trace methods. Use get_session_traces or list_traces to list traces. get_trace_with_steps loads steps and their tool calls; list_traces returns trace metadata without loading steps. Clearing a bolt session with clear_session does not delete its traces; see clear_session for a query that removes a session’s traces, steps, and tool calls.