Before WhyOps can give you high-quality agent analytics, it needs to know what your agent is. That means registering:Documentation Index
Fetch the complete documentation index at: https://whyops.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
- the stable
agentNameyou send on requests - the current system prompt
- the tools the agent can call
- optional descriptive metadata
agentName.
TypeScript SDK Setup
@whyops/sdk wraps this flow and auto-initializes on first trace event unless you call initAgent() explicitly during boot.Python SDK Setup
whyops exposes init_agent_sync() and init_agent() so you can register on startup in sync or async services.Agent Init Reference
Request fields, response shape, direct analyse endpoint, auto-init fallback, and follow-up entity APIs.
SDK Packages
Compare the published integration packages before choosing your registration and tracing flow.
Why this exists
WhyOps uses agent registration for four things:- Versioning: when your system prompt or tool contracts change, WhyOps creates a new agent version.
- Trace binding: traces are attached to the latest version for the
agentNamein the current user/project/environment scope. - Sampling: default sampling rate is stored on agent versions and reused across traces.
- UI context: the dashboard can show prompt, tools, version history, and config diffs.
Recommended flow
Register the agent on deploy or startup
Call the init endpoint whenever you deploy a new prompt/tool configuration.
Proxy endpoint
If you are already usingwhyops-proxy, the easiest registration path is:
POST /v1/agents/init
This endpoint exists on the proxy and tunnels the request to whyops-analyse.
Auth
Request body
inputSchema and outputSchema are currently expected as strings by the backend, so send serialized JSON schema strings rather than nested JSON objects.What happens internally
When you call init:- WhyOps looks up an existing
AgentbyuserId + projectId + environmentId + agentName. - It computes a SHA-256-based hash from the
metadatapayload. - If the latest version already has the same hash, WhyOps returns the existing version with
status: "existing". - If the hash changed, WhyOps creates a new
Entityversion and carries forward the previous sampling rate.
When to call init
Use one of these patterns:- On deploy (Recommended)
- On service startup
- On agent build/publish
Call init once per deploy whenever your prompt or tool definitions change.