TypeScript / JavaScript SDK
Predict when production AI agents are degrading — before they visibly fail.
What AgentWatch does
AgentWatch watches your agent's traces and runs three analyses server-side to catch quality collapse before your error rate moves:
- Statistical change-point detection — CUSUM and EWMA hold a baseline for each agent and flag the point where behaviour shifted, rather than waiting for a threshold to be crossed.
- An LLM-judge correctness gate — outputs are scored for whether they actually answered the input, not just whether the call returned 200.
- Semantic-drift scoring — how far today's responses have moved from the ones the agent was shipping last week.
What this SDK is
A thin capture-and-POST client. It never adds latency to — or throws errors in — your agent's request path, and it ships none of the scoring engine. Everything above runs on our side, on traces this package sends.
Fire and forget
Traces are POSTed asynchronously and delivery failures are swallowed, so monitoring can never break your agent. See
Guarantees for exactly what that means in practice.The whole integration
One wrapper around the function your agent already runs. Same arguments, same return value.
agent.ts
import { watch } from '@agentwatch-beta/sdk'
const runAgent = watch(myAgentFn, {
apiKey: 'aw_live_...',
agentId: '<agent-uuid>',
})
const result = await runAgent(userQuery)behaviour unchanged · returns the same value
Requirements
- Node 18 or newer — both ESM (
import) and CommonJS (require) are supported. - An API key in the form
aw_live_..., from your project settings. - The UUID of an agent registered in your project.