Knowledge

Read a search's trace

GET
/api/v1/knowledge/queries/{query_id}

The request, every leg's candidates with their ranks and scores, the cuts and the hits. Kept 30 days.

More in Knowledge API.

apiKey
headerAuthorizationBearer <token>

An API key, sk-syn- and 32 characters. On SynapseOrch Cloud an owner or admin makes it under Settings → Developer; on a self-hosted install, under Settings → API Keys.

query_id*string

Response Body

Successful Response

application/json
  1. response
trace_version?integer
Default1
query_id*string
created_at*string
origin*
request*
pipeline?
index?|null
degraded?array<>
legs?array<>
fusion?|null
rerank?|null
cuts?array<>
hits?array<>
costs?
timings_ms?
replay?
curl -X GET "https://api.synapseorch.com/api/v1/knowledge/queries/kq_01a1107d9f1b3d5f7b9d1f3b5d7f9b1d" \  -H "Authorization: Bearer sk-syn-..."
{  "trace_version": 1,  "query_id": "string",  "created_at": "string",  "origin": {    "surface": "tool",    "run_id": "string",    "session_id": "string",    "agent_id": "string",    "step_id": "string",    "turn": 0,    "api_key_id": "string"  },  "request": {    "query": "string",    "rewritten_query": "string",    "kb_ids": [      "string"    ],    "filters": {},    "path_prefix": "string",    "top_k": 0,    "rerank": true,    "score_threshold": 0,    "neighbors": 0,    "mode": "hybrid",    "pinned_snapshots": {      "property1": "string",      "property2": "string"    }  },  "pipeline": {    "property1": {      "snapshot_id": "string",      "embed_model": "string",      "embed_dims": 0,      "chunker_version": "string",      "fusion": {        "method": "rrf",        "k": 60,        "weights": {          "property1": 0,          "property2": 0        }      },      "overfetch": 50,      "rerank_model": "string",      "top_k": 0,      "score_threshold": 0,      "parent_expansion": "off"    },    "property2": {      "snapshot_id": "string",      "embed_model": "string",      "embed_dims": 0,      "chunker_version": "string",      "fusion": {        "method": "rrf",        "k": 60,        "weights": {          "property1": 0,          "property2": 0        }      },      "overfetch": 50,      "rerank_model": "string",      "top_k": 0,      "score_threshold": 0,      "parent_expansion": "off"    }  },  "index": {    "name": "string",    "version": "string",    "capabilities": {}  },  "degraded": [    {      "code": "string",      "detail": "string"    }  ],  "legs": [    {      "leg": "lexical",      "scopes": [        {}      ],      "requested": 0,      "returned": 0,      "filtered": true,      "exact": true,      "latency_ms": 0,      "candidates": [        {          "chunk_id": "string",          "rank": 1,          "score": 0        }      ]    }  ],  "fusion": {    "method": "rrf",    "params": {      "method": "rrf",      "k": 60,      "weights": {        "property1": 0,        "property2": 0      }    },    "candidates": [      {        "chunk_id": "string",        "score": 0,        "ranks": {          "property1": 0,          "property2": 0        }      }    ]  },  "rerank": {    "model": "string",    "cost_source": "string",    "input_count": 0,    "latency_ms": 0,    "results": [      {        "chunk_id": "string",        "rank": 1,        "score": 0      }    ]  },  "cuts": [    {      "stage": "threshold",      "dropped": [        "string"      ],      "dropped_count": 0,      "rule": ""    }  ],  "hits": [    {      "label": "string",      "chunk_id": "string",      "doc_id": "string",      "doc_sha256": "string",      "doc_version": 0,      "snapshot_id": "string",      "kb_id": "string",      "path": "string",      "page_start": 0,      "page_end": 0,      "heading_path": [        "string"      ],      "snippet": "",      "score": 0,      "scores": {        "property1": 0,        "property2": 0      },      "ranks": {        "property1": 0,        "property2": 0      }    }  ],  "costs": {    "total_est_usd": 0,    "total_charged_microusd": 0,    "rows": [      {        "stage": "string",        "model": "string",        "cost_source": "string",        "units": 0,        "unit": "tokens",        "input_tokens": 0,        "est_usd": 0,        "charged_microusd": 0      }    ]  },  "timings_ms": {    "rewrite": 0,    "embed": 0,    "lexical": 0,    "vector": 0,    "fuse": 0,    "rerank": 0,    "total": 0  },  "replay": {    "query_vector_sha256": "string",    "exact_possible": false,    "notes": [      "string"    ]  }}