How do you build agent trajectory datasets for post-training? Building agent trajectory datasets for post-training should preserve failed attempts and dead ends as negative examples, since datasets of only "golden paths" produce brittle agents that cannot recover from errors, according to guidance recommending the OpenAI messages format as a baseline. The recommended structure extends the assistant message with a `tool_calls` list and adds a `tool_outputs` list to a subsequent `tool` role message, while tracking the original `task_description`, the full `tool_definitions`, and a final `outcome` status such as `success` or `failure`. The guidance cites the ToolBench dataset and its "ToolLLM" paper as a comprehensive reference for instruction generation, solver-model response generation and evaluation, and names the GAIA benchmark as an example of complex multi-step tasks requiring robust trajectories for training and evaluation. The OpenAI messages format is a solid baseline. It’s common to extend it by adding a tool calls list to the assistant message and a tool outputs list to a subsequent tool role message. For metadata, track the original task description , the full tool definitions available, and a final outcome status e.g., success , failure . This structure is flexible and maps well to most inference APIs. Definitely keep failed attempts and dead ends; they are your most valuable negative examples. A dataset of only “golden paths” produces brittle agents that can’t recover from errors. For generation, model-generated trajectories with human review and correction is the most scalable approach. Purely human-authored data is too slow and expensive for large-scale SFT or preference tuning. The ToolBench dataset and its accompanying paper “ToolLLM” are a comprehensive reference. They detail a full pipeline for instruction generation, response generation with a solver model, and evaluation. The GAIA benchmark is another good example of complex, multi-step tasks requiring robust trajectories for both training and evaluation.