Synthetic traces are JSON files synthesized and replayed during refine. Each trace simulates one or more agent interactions.
{
"trace_id": "string — unique identifier (e.g. trace_id_mypath_overflow)",
"eval_mode": "qa",
"category": "normal | edge_case | multi_session | adversarial | high_noise",
"description": "One-sentence summary of what this trace exercises",
"turns": [
{
"role": "user | agent | tool | system",
"content": "string — the raw message or output",
"used_for_evaluation": "boolean — whether this turn should count as evaluation-bearing context when the Critic designs questions and judges recall",
"metadata": {
"tool_name": "optional — name of the tool called",
"tool_input": "optional — what was passed to the tool",
"tool_output": "optional — what the tool returned",
"session_id": "optional — for multi-session traces",
"retention_flush": "optional bool — mark a turn that causes retention-window eviction"
}
}
],
"recall_queries": [
{
"query": "string — the follow-up question or recall prompt",
"expected_information": [
{
"value": "string — atomic fact or information item required to answer the query correctly",
"matcher": "substring | regex | semantic",
"threshold": "optional float in [0,1]; count as matched iff matcher score >= threshold"
}
]
}
]
}For cache-like components where the goal is to verify write-then-read correctness rather than recall quality.
{
"trace_id": "string — unique identifier (e.g. trace_id_cache_basic)",
"eval_mode": "hit_rate",
"category": "normal | edge_case | adversarial",
"description": "One-sentence summary of what this trace exercises",
"checks": [
{
"description": "string — what this check verifies",
"write_input": "object — arguments passed to the component's write method",
"read_input": "object — arguments passed to the component's read method",
"expected_output": {
"value": "string — expected content in the read result",
"matcher": "substring | regex | exact",
"description": "string — what should match"
}
}
]
}eval_modedefaults to"qa"if omitted.- Traces with
eval_mode: "qa"useturns+recall_queries. - Traces with
eval_mode: "hit_rate"usechecks. - A trace MUST NOT mix both formats.
turnsis ordered chronologically.- For multi-session traces, include a system turn with
"content": "--- session boundary ---"between sessions. recall_querieslists follow-up questions where the memory system should provide enough support to answer correctly.used_for_evaluation=truemeans the turn is fair game for the Critic when deciding what the memory system should have retained or answered from. It does not mean "this turn should be extracted into memory verbatim." A tool call, a short user instruction, or a structured result may all be evaluation-bearing even if they are not directly memorizable.expected_informationshould be a flat list of the information items needed to answer the query correctly.- Each
expected_informationitem is scored as a binary match:1if the configured matcher passes0otherwise
- String items default to
substringmatching. - Object items may override the matcher with:
substring: direct lexical containmentregex: regex match against memory/recall outputsemantic: semantic similarity or LLM-based judge
thresholdis only used to convert matcher output into a boolean match. If the matcher score is greater than or equal to the threshold, the item counts as matched; otherwise it counts as unmatched.support_coverageis computed per query as the fraction ofexpected_informationitems that match.query_successis computed per query as a binary result: success only if all items inexpected_informationmatch.- Recall queries should use the vocabulary a real user would naturally use, which may differ from how the information was originally stated or stored.
- Each
checkis a write-then-read verification: write known content via the component's write method, then read and verify the content is returned. - Each check is scored as binary:
1(hit) if the matcher passes,0(miss). hit_rateis computed ashits / total_checksfor the trace.- Matchers for hit_rate checks:
substring: read output contains the expected value (case-insensitive)regex: read output matches the regex patternexact: read output equals the expected value exactly
- Checks should cover: basic write-then-read, overwrite/update, cache invalidation or expiry, and key-miss (read for content never written should return empty/null).
- Mark evaluation-bearing turns explicitly with
used_for_evaluation. - Use
metadata.retention_flush=truewhen you want to show a turn that causes retention-window pressure or eviction. - For multi-session traces, include a clear session boundary turn.
- Keep
expected_informationatomic and concrete. Split compound requirements into separate items instead of encoding weights or "critical vs optional" distinctions. - Prefer simple string items unless you specifically need regex or semantic matching for a query.
- Include at least some queries that are not trivial surface-form restatements of the original evidence, especially for agents expected to support indirect retrieval.
Place traces in worktraces/traces/:
trace_id_<path>_<issue>.json— per-path tracestrace_id_e2e_<issue>.json— end-to-end traces
All trace ids start with trace_id_, followed by the path name (or
e2e), then the targeted issue.