Skip to main content
Multi-agent trajectory analysis turns a hosted workflow or remote execution stream into one versioned, queryable evidence graph. Use it when outcome scores alone cannot explain which agent acted, why control changed hands, which tool or model call was responsible, or where cost accumulated. Open Evaluation → Trajectories at /trajectory-analysis to inspect runs. The workspace keeps partial evidence visible, but marks it incomplete or malformed until the contract is satisfied. It never creates placeholder model calls, costs, tool evidence, parents, or participants.

What the contract records

The version 2 contract normalizes these event classes: Participants have stable keys, display names, roles, optional framework identifiers, and metadata. Events have stable keys, source timestamps, optional source sequence numbers, explicit parent keys, and typed evidence references.

Ingest a trajectory

Send batches to POST /api/trajectory-analysis with runs:write. One batch accepts up to 5,000 events and 10 MiB. Reuse the trajectory key across late batches; use a new idempotency key for each distinct batch.
The response contains the run, normalized participants, ordered events, scores, and reports. If a referenced participant or parent arrives later, EvalGate retains the raw key and repairs the durable relationship when the missing object is ingested.

Idempotency and conflicts

  • Replaying the same idempotency key and identical body returns the existing trajectory.
  • Reusing an idempotency key with different content returns 409 CONFLICT.
  • Reusing an event key with different content returns 409 CONFLICT.
  • A trajectory key cannot switch its source run or hosted/remote variant.
  • Evidence IDs from another organization return 403 CROSS_ORG_REFERENCE.
These rules apply to large streams and late events. A batch is committed atomically: no participant, event, receipt, or completion state is partially accepted.

Understand completion states

complete means the run is finalized and every event class, participant, parent, target participant, tool evidence item, Model Gateway call, and cost record is present. incomplete is a valid persisted state. The response lists exact missing parts such as:
malformed indicates a structural contradiction such as a duplicate participant identity or self-parent event. Malformed runs remain inspectable for diagnosis but cannot be scored or reported.
EvalGate does not estimate or synthesize a missing price, gateway call, evidence item, participant, or parent. Ingest the durable source record and then send a late trajectory batch that references it.

Inspect the explorer

The Timeline tab separates named agent lanes from the event stream. Events are ordered by source timestamp, then source sequence, then stable event key. Each row exposes its parent and participant so concurrency, handoffs, loops, and premature termination remain visible. The Evidence tab counts exact Model Gateway, cost, and tool-evidence references. A complete run shows zero orphaned parent or participant relationships. Incomplete runs list each unresolved contract part next to the affected workflow. The Quality tab displays versioned trajectory scorer results and evidence reports. The Compare tab compares a selected baseline against another hosted or remote variant without merging their provenance.

Use the SDK clients

Both clients also provide list, get, score, createReport / create_report, and compare. Structured API failures preserve the HTTP status and EvalGate error code so callers can distinguish incomplete evidence from identity conflicts or authorization failures.

Score a complete trajectory

Call POST /api/trajectory-analysis/{trajectoryId}/score with runs:write:
Scoring uses the platform’s authoritative trajectory scorer. The stored input hash binds the normalized trajectory content hash, scorer identity/version, and ideal specification. Identical scoring requests are idempotent. Incomplete and malformed runs fail closed with 409 INCOMPLETE or 409 MALFORMED.

Build an evidence report

After scoring, call POST /api/trajectory-analysis/{trajectoryId}/reports with reports:write:
The report freezes:
  • trajectory identity, source variant, source run, and content hash;
  • participant identities and roles;
  • every event ID, parent ID, and participant ID;
  • exact model-call, cost-record, and evidence-item references;
  • scorer identity, version, metrics, failures, and score;
  • an evidence hash over the complete report payload;
  • an empty orphan list, enforced before report creation.
If evidence becomes incomplete, report generation stops instead of emitting a partial certificate.

Compare hosted and remote variants

Use GET /api/trajectory-analysis/compare?baselineId={hostedId}&candidateId={remoteId} with runs:read. The comparison returns source variant, completion state, latest score, event count, cost-evidence count, and score/event deltas for each side. The comparison never treats two variants as interchangeable. Each side preserves its own source run, content hash, participants, events, and durable evidence references.

Retention

Each trajectory sets a retention period from 1 to 3,650 days. Organization administrators can run POST /api/trajectory-analysis/retention with admin:org to delete expired trajectories. Cascades remove normalized participants, ingestion receipts, events, score results, and reports together; referenced gateway, cost, and platform evidence records remain governed by their own retention policies.

Operational checklist

  1. Create Model Gateway calls, cost records, and tool evidence before referencing them.
  2. Use stable participant and event keys from the source system.
  3. Preserve source timestamps and explicit parents; do not infer order from arrival time.
  4. Use one idempotency key per distinct batch and retain it through retries.
  5. Send late participants or parents under the same trajectory key.
  6. Finalize only after the source believes streaming is terminal.
  7. Require complete and zero orphans before scoring or reporting.
  8. Compare hosted and remote variants as separate evidence graphs.
  9. Review retention periods against organization policy.

Failure handling

Authorization