The metadata field is a free-form JSON object on each decision. Use it for filtering, analytics, and richer evaluation context.

Example

h.observe(
    input=messages,
    output=response,
    agent_id="support-bot",
    metadata={
        "user_id": "usr_123",
        "channel": "web",
        "escalated": False,
        "resolved": True,
        "tags": ["billing", "refund"],
        "model": "gpt-4o",
    },
)
KeyPurpose
user_idCorrelate decisions per end user
channelweb, slack, api, phone
escalatedDid the agent escalate?
resolvedWas the issue resolved?
tagsDomain tags for filtering
modelModel version for A/B analysis
prompt_versionTrack prompt iterations

Privacy

Do not send PII, secrets, or raw credentials in metadata unless your compliance review allows it. Prefer opaque IDs over emails or account numbers.