Two fundamental processes in AgentTest are Variant Assignment (determining which version a user sees) and Result Logging (recording what happened).
trafficPercent
you define for each variant within an active experiment. When your application calls the assignment endpoint, the system uses this distribution to pick a variant.POST /experiment/:slug/assign
endpoint. Your application sends a userId
and optional context
, and AgentTest responds with the key
and payload
of the assigned variant./assign
is typically independent.key
and payload
for a specific userId
for a certain duration or until the session ends.payload
, it’s crucial to log the outcome.
POST /experiment/:slug/log
endpoint.variantKey
that was used.input
provided to the agent/workflow (e.g., user query).output
generated by the agent/workflow (e.g., LLM response).metrics
you define (e.g., latency in milliseconds, token count, user rating, conversion event).context
(e.g., session ID, environment).