Skip to main content

Before you start

We generally recommend using the /docent plugin to ingest your traces. The plugin writes the SDK script for you from your existing logs. Use this page if you want to debug what /docent produced, have unusual data formats your coding agent can’t infer, or need fine-grained control. If you already have an Inspect .eval file, the fastest path is drag-and-drop upload. Otherwise, follow the steps below.

Setup

Install the SDK:
Go to the API keys page, create a key, and instantiate a client object with that key:

Create a collection

Convert your data

There are three end-to-end examples below; pick whichever matches your data.
If your messages are already in OpenAI chat format ({"role": ..., "content": ..., "tool_calls": ...}), use parse_chat_message to convert each one into a ChatMessage. All three examples below use this helper.
Say we have three simple agent runs.
We need to convert each input into an AgentRun object, which holds Transcript objects where each message needs to be a ChatMessage. We could construct the messages manually, but it’s easier to use the parse_chat_message function, since the raw dicts already conform to the expected schema.
Now we can create the AgentRun objects.

Upload the runs

If you navigate to the frontend URL printed by client.create_collection(...), you should see the run available for viewing.
Docent assigns the id field on AgentRun, Transcript, and TranscriptGroup automatically. You cannot set these IDs yourself — reassigning id after construction raises a ValueError, and the upload path rejects payloads whose IDs were set by the caller (for example, runs round-tripped through client.get_agent_run(...) or loaded from a JSON dump).To wire references between objects in the same upload, construct the parent first and read its assigned id:
To re-upload runs that already have IDs, regenerate them first with the clone helper:
A single-run variant, clone_agent_run_with_random_ids, is also exported from docent.

Tips and tricks

Including sufficient context

Docent can only catch issues that are evident from the context it has about your evaluation. For example:
  • If you’re looking to catch issues with solution labels, you should provide the exact label in the metadata, not just the agent’s score.
  • For software engineering tasks, if you want to know why agents failed, you should include information about what tests were run and their traceback/execution logs.