@relevanceai/sdk is the official JavaScript and TypeScript SDK for the Relevance AI platform. Use it to start conversations with agents, trigger workforces, stream responses in real time, and handle file attachments — all from your own application code.
What’s in the box
Universal runtime support
Works in Node.js, Deno, Bun, Cloudflare Workers, and the browser. Zero dependencies — built on web standards.
Event-driven
Real-time updates through the native
EventTarget API. No custom event system to learn.Type-safe
Full TypeScript definitions across agents, tasks, messages, and workforces. Type guards narrow message kinds automatically.
Streaming by default
Thinking and typing tokens arrive through the same event stream as final messages — no extra configuration.
When to use the SDK
- Embedding chat into a web or mobile app
- Triggering agents from a backend service, worker, or cron job
- Running workforces from a server-side pipeline
- Building custom dashboards on top of agent output
Where to next
Quickstart
Install, authenticate, and send your first message in under a minute.
Authentication
API keys for server code, embed keys for the browser, and region selection.
Agents
Load agents, send messages, and list tasks.
Workforces
Trigger multi-agent workforces and handle handover messages.

