saved

Trajectory: A Standard Format for Agent Experience Data

by LettaLettapublished

gist

Letta introduces Trajectory, an open-source format that converts sessions from Codex, Claude Code, Letta Code, and other agent harnesses into a common sequence of messages, reasoning, tool calls, and results. It is optimized for agents learning from prior work, so it removes harness bookkeeping and can truncate large outputs. That consumer-specific tradeoff makes cross-harness memory practical while using substantially fewer tokens than native logs or replay-oriented formats.

ideas

  • The consumer should determine the format. Full-fidelity replay needs metrics and structured payloads, while an agent forming memory needs the smallest record that still explains what happened.
  • Normalization removes incidental variation. A shared record schema lets agents process experience from different harnesses without first interpreting each vendor’s envelopes, event streams, and duplicated fields.
  • Compression is a practical constraint. Letta reports roughly fivefold token reductions on sampled coding sessions, with default truncation cutting both Claude Code and Codex logs further than the untruncated format.
  • Portable experience enables portable learning. Listing and normalizing sessions across harnesses supports shared indexing, memory bootstrapping, search, and background consolidation.

quotes

Learning across harnesses requires first creating a standard data format for the experience each harness produces.

Letta, stating the prerequisite for learning from agent experience across harnesses.

The format keeps only the information needed to understand the agent's experience.

Letta, stating Trajectory’s compression rule for agent-readable session history.

On sessions we sampled, this results in a ~5x reduction in token counts compared to native session formats.

Letta, reporting sampled compression versus native formats.

Agents can also search through trajectory files to find information from past sessions, even if they were from another harness.

Letta, describing how normalized trajectories make past work retrievable across harnesses.