Melaya · Build and run AI agents across your business tools, browser, desktop apps and Android phone. Seven connected products on one governed platform: Agents, Assistant, Device Control, Browser Control, Computer Control, MCP Server, and Marketing. Bring your own AI and keep human approval on every consequential action.

Melaya Blog

AI Execution Traces: What to Record and How to Read Them

AI execution traces record every model call, tool call and approval in an agent run. Learn what to capture, how to debug with traces, and how to store them safely.

AI Execution Traces: What to Record and How to Read Them

An AI execution trace is the step-by-step record of one agent run: every model call, tool call, retrieval, approval and handoff, linked in order with timing, status and outcome. A transcript shows what the agent said. A trace shows what it did. If your agents touch browsers, devices, business apps or money, the trace is how you debug a failure, prove what happened and test the next release. In Melaya, every run is traceable and replayable, and every consequential action (publishing, sending, paying, writing to connected apps) runs behind human approval, so the approval itself lands in the record.

TL;DR

  • A trace links every step of one run into a parent-child tree. A log line is a standalone event with no such link.
  • Record run identity, model calls, tool calls with arguments, retrieval, approval status, cost and a final status label.
  • Debug by walking the trace from the top to the first wrong step, not the step that threw the error.
  • Turn fixed failures into regression cases, one representative per failure cluster.
  • Redact prompts, documents and tool arguments before traces leave the application.

What an AI execution trace is

NiCE defines agent tracing as reconstructing the execution path across every system the agent touches: model calls, retrieved context, tool calls, workflow steps, subagent handoffs, latency, errors and outcomes. A transcript only shows the visible conversation. That gap matters when an agent says "done" and the invoice was never created.

The unit is the span. The OpenTelemetry data model describes a trace as a collection of spans sharing a TraceId. Each span records identity, parent, timing and descriptive data such as attributes, events, links and status. The trace is the view you get by grouping spans and following the parent-child relationships.

For an agent, that tree looks like this: the top-level run, a model call beneath it, a tool execution beneath that, a memory read next to it. MongoDB's observability team notes the OpenTelemetry GenAI conventions define span types such as invoke_agent and execute_tool, and that they were still in Development status as of mid-2026. Pin your schema version.

Trace hierarchy linking model, tool, and memory spans

Traces versus logs

A log line carries a timestamp and a message. When several users hit one agent at once, entries from different runs interleave in the same stream, and nothing ties a line to the retrieval step, model turn and tool call that produced one answer. Traces keep those relationships.

Logging also stops short of quality. Braintrust separates the two: logs capture prompts, responses, duration, tokens and error codes, while observability asks whether the response met a quality bar and where in the chain it failed.

What to record in every run

The Agentic AI Foundation's day-one schema is a good floor. Use it as a checklist:

Layer Fields
Run identity run ID, parent run ID, session, user or workspace, environment, agent and prompt version
Model calls provider, model, latency, input, output and cached tokens, error status
Tool calls tool and schema version, redacted arguments, result status, duration, retries, side-effect flag, approval status
Context receipt prompt and tool-catalog versions, retrieved document IDs, context token count, cache status
Cost rolled up per run
Final status completed, failed, canceled, timed out, partial or blocked

Two fields do most of the work.

Tool arguments. Uncoil's schema guide calls them the highest-leverage field: without them, a wrong-tool failure and a right-tool-bad-arguments failure look identical. It also recommends a side_effect boolean for real-world effects such as sending an email or issuing a refund.

Retrieval. Arize's guide says retrieval spans should keep the query, document identifiers, content, metadata and relevance scores. Much of what looks like a reasoning failure starts upstream, in a memory read that returned the wrong fragment or nothing usable. If memory access is not in the trace, you will blame the model for a bad lookup.

Keep related runs connected

Apply a shared session.id across related turns and propagate trace context into background processes, remote services and subagents. Skip this and a handoff shows up as an unrelated trace. In multi-agent pipelines, a failure in agent B is often caused by what agent A passed along, so the trace must span the whole coordination chain.

Why computer and browser agents need more than a transcript

An agent that only answers questions can fail quietly. An agent that clicks, types and writes to systems fails with side effects. For those runs you want to answer four questions after the fact:

  1. Which tool did the model pick, and with which arguments?
  2. What came back, and what did the model see next?
  3. Which steps changed something outside the agent?
  4. Who approved those steps, and when?

Melaya is built around that last question. It is bring-your-own-model: it works with any cloud or local model, including Claude, GPT, Gemini, DeepSeek, Mistral, Qwen, Ollama and LM Studio, and the same runs are traceable and replayable whichever model you switch to. Browser Control, Mobile Agents (Android only) and Computer Control (which runs through the Melaya desktop app) give approved models hands on websites, Android apps and desktop software. Permissions are granular, and execution traces and approval history are part of the platform. Your model is the brain; Melaya is the controlled pair of hands, with a record of every move. Our governance guide covers how permissions and approvals fit together.

How to debug a failed run from its trace

A trace-first method works in a fixed order:

  1. Freeze the run. Save the exact inputs, tool responses and model version so you can reproduce it.
  2. Walk from the top. Find the first divergence. Later steps are usually consequences.
  3. Check what the model saw. This separates a reasoning error from a bad observation or a bad tool result.
  4. Shrink it. Strip the run to a minimal reproduction and save it as a regression case.

Blame the earliest span whose output was already wrong, not the step that raised the error. A timeout on step nine may trace back to a malformed argument on step three.

Do not judge a path by step count. Arize's point is that the question is whether each step changed the task state: repeated calls that return the same evidence add motion, not progress.

Manual reading has limits. The TRAIL benchmark found that long-context models are poor at trace debugging, with the best model scoring 11%, and its authors argue that human analysis of long traces does not scale. Structure helps both people and tools: clean span trees, typed fields and a failure label per run.

One more design rule from the Agentic AI Foundation: keep the builder and the checker separate. An agent that builds and validates its own work tends to trust itself, which makes the recorded validation signal unreliable.

Turn traces into regression tests

Replay is where traces pay back. Architecting Agentic Systems recommends a golden trace set: curated traces of routine successes, near-failures, escalations, refusals and incidents that a new release must reproduce within an agreed behavioral envelope. It catches drift between model, policy and memory versions.

Do not promote every bad trace. Dubrov warns that this builds a large, expensive, narrow dataset. Instead:

  • Cluster similar bad traces.
  • Keep one representative per cluster, plus variants with different permissions, arguments or recovery states.
  • Store linked trace IDs in access-controlled metadata.
  • If a cluster recurs after the fix, the case did not generalize.

This matters most when you swap models. With a bring-your-own-model setup, you can change providers or move to a local model through Ollama or LM Studio without rebuilding tools and workflows, then replay your golden set against the new model and compare traces. For a QA-heavy version of this loop, see our web and mobile QA agents use case.

Store traces without leaking data

Prompts, documents, tool arguments and stored memory can hold private data. Arize advises masking and redaction before traces leave the application. Practical rules:

  • Redact arguments at capture, not at query time.
  • Keep preview fields short and role-restricted.
  • Set retention by data class, and keep incident traces longer than routine ones.
  • Restrict who can open golden-set trace IDs.

If you share traces publicly, treat anonymization as best-effort. The Trace Commons dataset of coding-agent sessions warns its scrubbing is not certified anonymous under GDPR guidance and is a voluntary, biased sample. For enterprise teams that need private, provider-independent automation, see our enterprise agent platform page.

Public trace datasets for research

If you are benchmarking rather than operating agents, public data exists but is limited. The llm-d survey lists WEKA/AgentX (391 traces, content hashed), SWE-smith (5,017 traces, no token counts or timing), TraceLab (4,265 sessions, content stripped) and Mooncake (23,608 timed requests, no session IDs). Content stripping is irreversible and rules out diagnosing failures semantically. AgentLogs offers 635,886 sessions, but nearly all come from one cloud agent platform. Your own traces will always be the best test set for your own workflows.

What this looks like in Melaya

In the visual Agent Builder you combine a model, tools, memory, schedules, approvals, triggers and multi-agent pipelines, and each run is traceable and replayable. Approvals are controls inside the workflow: publishing, sending, paying and writing to connected apps all wait for a human. Permissions are granular, and the platform has independent security audits. Native integrations include Odoo. For data teams, the public data pipelines use case shows a multi-step run in practice.

Promo

Start with the Agent Builder and bring the model you already use. Plans are published on the pricing page: Sandbox is $0 per month, Outpost is $20 per month, Forge is $49 per month or $469 per year, Bastion is $129 per month or $1,239 per year, and Citadel starts from $490 per month. Single-product plans for Browser Agents, Mobile Agents and Melaya Assistant are $9.99 per month each.

Melaya Agents (AI Agent Builder)

If your use case is device work on Android, Melaya Device Control gives approved models controlled access to apps, with approvals on consequential actions.

Perspective

We build Melaya on one premise: an AI that can act needs a record that a person can read.

Most agent failures we care about are not wrong sentences. They are wrong actions: the wrong field, the wrong site, an email sent too early. A transcript cannot settle those. A trace can, because it ties the model's choice, the tool arguments, the result and the approval into one run.

That is why approvals and traces belong in the same system as the tools. When publishing, sending, paying and writing to connected apps all wait for a human, the trace shows who said yes. When you swap Claude for a local Qwen model, the trace is how you compare the two on the same task.

Your model is the brain. We provide the controlled hands, and the history of everything they did.

Melaya Team

FAQ

What is the difference between an AI agent trace and an execution trace?

They are used interchangeably. Both mean the linked record of one agent run: model calls, tool calls, retrievals and outcomes as a tree of spans. "Agent trace" simply stresses that the run was driven by an agent.

Do I need OpenTelemetry to trace AI agents?

No, but it helps. OpenTelemetry gives you a standard span model that many tools can read. Its GenAI conventions were still in Development status as of mid-2026, so pin the version you use and expect changes.

What is the single most important field to capture?

Tool-call arguments. Without them you cannot tell whether the agent chose the wrong tool or used the right tool badly. Add a side-effect flag and approval status so you can find every action that changed something outside the agent.

Can I see which actions a human approved?

In Melaya, consequential actions such as publishing, sending, paying and writing to connected apps run behind human approval, and approval history is part of the platform's observable record.

Sources

Recommended

Frequently asked questions

What is the difference between an AI agent trace and an execution trace?

They are used interchangeably. Both mean the linked record of one agent run: model calls, tool calls, retrievals and outcomes as a tree of spans. "Agent trace" simply stresses that the run was driven by an agent.

Do I need OpenTelemetry to trace AI agents?

No, but it helps. OpenTelemetry gives you a standard span model that many tools can read. Its GenAI conventions were still in Development status as of mid-2026, so pin the version you use and expect changes.

What is the single most important field to capture?

Tool-call arguments. Without them you cannot tell whether the agent chose the wrong tool or used the right tool badly. Add a side-effect flag and approval status so you can find every action that changed something outside the agent.

Can I see which actions a human approved?

In Melaya, consequential actions such as publishing, sending, paying and writing to connected apps run behind human approval, and approval history is part of the platform's observable record.