Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.svantic.com/llms.txt

Use this file to discover all available pages before exploring further.

Quickstart

This guide takes you from an empty directory to a live, connected agent that another Svantic agent can call. Total time: about five minutes.

Prerequisites

  • Node.js 20 or later.
  • A Svantic account with a client credential pair. In the dashboard, go to Settings → API Credentials and create one. Export:
    export SVANTIC_CLIENT_ID=...
    export SVANTIC_CLIENT_SECRET=...
    

1. Install

mkdir hello-agent && cd hello-agent
npm init -y
npm install @svantic/sdk
npm install -D typescript tsx @types/node

2. Write the agent

Create hello.ts:
import { Agent } from '@svantic/sdk';

const agent = new Agent({
  name: 'hello-agent',
  description: 'Greets people by name.',
  mesh: {
    client_id: process.env.SVANTIC_CLIENT_ID!,
    client_secret: process.env.SVANTIC_CLIENT_SECRET!,
  },
});

agent.define_capability({
  name: 'greet',
  description: 'Return a friendly greeting for the given name.',
  parameters: {
    type: 'object',
    properties: {
      name: { type: 'string', description: 'Name to greet' },
    },
    required: ['name'],
  },
  handler: async ({ name }) => {
    return { message: `Hello, ${name}!` };
  },
});

await agent.start();
console.log('hello-agent is live.');

3. Run it

npx tsx hello.ts
The first line of output will be the agent announcing itself. It’s now registered with Svantic over an outbound WebSocket — no public URL, no port forwarding. Stop with Ctrl-C; the SDK deregisters cleanly on SIGINT.

4. Call it

From the Svantic dashboard, open the Playground, pick hello-agent, and call greet with { "name": "world" }. You should see { "message": "Hello, world!" }. You can also call it from another agent:
import { RemoteAgent } from '@svantic/sdk';

const hello = await RemoteAgent.connect('https://api.svantic.com/agents/hello-agent');
const result = await hello.invoke_capability('greet', { name: 'world' });
console.log(result); // { message: 'Hello, world!' }

Where next