Skip to content

Report context telemetry

context.report tells Vectadyne what your context window actually contained. It is the only way to get an honest answer to is the retrieved memory earning its place, because only your side knows what you finally sent to the model.

LabelWhat
system_promptYour system prompt
personalityPersona or style
resolved_guidesTopic guides from Vectadyne
retrieved_memoryMemory from Vectadyne
working_stateScratchpad, plan, intermediate results
tool_defsTool definitions

An unreported label is stored absent, never zero. “Not measured” and “measured zero” stay distinguishable, and that distinction is the difference between a gap in your instrumentation and a real finding.

So: omit a label you did not measure. Do not send 0 to fill the shape — that claims a measurement you did not make, and it will look like a finding to whoever reads the dashboard.

meter := client.NewMeter("release-bot", 128_000).
ObserveAssemble(assembled). // fills in what Vectadyne contributed
Set(wire.SegmentLabelSystemPrompt, 1_200).
Set(wire.SegmentLabelWorkingState, 3_400)
if _, submitted, err := meter.Submit(ctx); err != nil {
log.Printf("telemetry: %v", err)
} else if !submitted {
log.Print("nothing to report") // no segments set — not an error
}
from vectadyne import ContextMeter
meter = ContextMeter(agent="release-bot", window_total=128_000)
meter.observe_assemble(assembled)
meter.set("system_prompt", 1_200)
meter.submit(vd.client)

ObserveAssemble / observe_assemble fills in what Vectadyne contributed, so you only measure your own segments.

Submit returns a submitted flag: with no segments set there is nothing to report, and that is not an error. Check it rather than assuming a call happened.

There is no meter in the TypeScript SDK. Use callTool with the same validated shape:

await client.callTool("context.report", {
agent: "release-bot",
window_total: 128_000,
segments: {
system_prompt: 1_200,
resolved_guides: 2_100,
retrieved_memory: 4_800,
},
});

Omit labels you did not measure. See SDK parity.

Three questions you cannot answer otherwise:

  • Is retrieved memory earning its tokens? If retrieved_memory is 30% of the window and the citations rarely appear in the output, tune top_k or your filters.
  • What is actually filling the window? Usually not what people guess. Tool definitions and working state are the common surprises.
  • Is context growing? A slow creep is invisible per run and expensive per month.

Counts, not content. No memory text, no prompt content, no prompt_block — the report is token accounting.

After the model call, once you know what you actually sent:

assembled = vd.assemble(...)
prompt = build_prompt(assembled)
response = model.generate(prompt)
meter = ContextMeter(agent="release-bot", window_total=MODEL_WINDOW)
meter.observe_assemble(assembled)
meter.set("system_prompt", count(SYSTEM_PROMPT))
meter.set("working_state", count(state))
meter.submit(vd.client)

Reporting before the model call measures your intent rather than your spend.