Agents
An agent is a service that exposes capabilities to the Svantic mesh. Your ticket system, your billing API, your monitoring service — wrap it with the SDK and it becomes an agent that the mesh can discover, invoke, and orchestrate.How Agents Work
- Your agent registers with the mesh, publishing its capabilities
- Users or triggers send requests to the mesh
- The mesh plans which agents and capabilities to call
- Your agent executes the capability and returns the result
- The mesh returns the final response
Capabilities
A capability is a single thing your agent can do. Each has:- Name — What the mesh calls it (
get_ticket,create_order) - Description — The LLM reads this to decide when to use it
- Parameters — JSON Schema defining the inputs
- Handler — Your async function that does the work
For a comprehensive guide on defining capabilities, MCP servers, builtin integrations, and bidirectional execution, see Tools & Capabilities.
Where Agents Run
Agents run on your infrastructure — your cloud, your VPC, your laptop. The mesh coordinates them but never sees your raw data. Your code, credentials, and databases stay with you. This is what makes Svantic usable in regulated industries. The mesh sees capability names and results, not the underlying data or logic.Multiple Agents Together
The mesh can orchestrate multiple agents in a single workflow:“Check if customer acme-123 has overdue invoices and create a support ticket if they do.”The mesh might:
- Call billing-agent →
get_overdue_invoices - Call ticket-agent →
create_ticket - Call slack-agent →
send_notification
Connectivity
Every dispatch the mesh sends must reach your agent. Svantic supports two connectivity modes:- Connected (default) — your agent dials Svantic over a persistent WebSocket. Works anywhere outbound HTTPS/WSS works — behind firewalls, NATs, corporate networks, laptops, CI runners, or ephemeral containers.
- Hosted — your agent exposes a public HTTPS surface the mesh calls into. Opt in when your agent already runs as an HTTP service that can accept inbound traffic.
instance_id. Two instances of the same agent type can use different modes.
Connected mode (default)
new MeshConnector(agent, { svantic_url, client_id, client_secret }) with no public_url. The SDK dials a WebSocket and keeps it open. The mesh pushes dispatch frames down the socket; your agent pushes dispatch_result frames back.
When it’s right (almost always):
- Behind a firewall, NAT, or corporate proxy
- Developer laptop, CI runner, ephemeral container
- Zero inbound exposure — outbound-only is a compliance win
- Easiest onboarding: no ingress, no TLS cert, no reverse proxy
Hosted mode
public_url at registration. Every dispatch is an HTTPS POST from the mesh to {public_url}/send.
When to pick it:
- Your agent already runs as a long-lived HTTP service with inbound traffic
- You have an existing ingress, LB, or API gateway
- You prefer request/response and control the infra on both sides
/.well-known/agent-card.json served at the root, TLS terminated by you.
Quick guide
| You have… | Pick |
|---|---|
| A public HTTPS service | hosted |
| Corporate firewall, egress-only | connected |
| Ephemeral containers (Fly, Vercel CI) | connected |
| Kubernetes pod with Ingress | hosted |
| Developer laptop | connected |
Health & Capacity
Svantic monitors two independent signals for every registered agent instance: routing status and connection status.Routing Status
Determines whether Svantic will send tasks to an agent instance:| Status | Routable? | Meaning |
|---|---|---|
available | Yes | Healthy and has capacity |
unknown | Yes | Newly registered, not yet confirmed |
busy | No | Reached concurrent session limit |
unhealthy | No | Missed heartbeats or failed recent dispatches |
offline | No | Explicitly marked down |
unhealthy and stops routing. After repeated failures, it’s automatically deregistered.
Capacity
Each agent can declare amax_concurrent_sessions limit at registration:
- 0 (default): unlimited
- N > 0: Svantic tracks active sessions and stops routing new work once the limit is reached
available again. Among available agents, Svantic prefers the least-loaded instance.
Connection Status
Reflects the transport link health — drives dashboard indicators:| Status | Meaning |
|---|---|
unknown | Newly registered |
online | Live WebSocket connection open |
healthy | Recent dispatch succeeded |
degraded | At least one recent dispatch failed |
offline | Agent is unreachable |
Health Events
| Event | When |
|---|---|
agent.registered | New instance registered |
agent.connected | WebSocket connection established |
agent.disconnected | WebSocket connection closed |
agent.health_changed | Routing status changed |
agent.deregistered | Instance removed |
Registration
Registration tells Svantic what your agent can do. Once registered, the mesh can discover your capabilities and route work to your agent.Quick Start (SDK)
Registration Policies
Configurable in the dashboard under Settings → Agent Policy:| Mode | Behavior |
|---|---|
| Open (default) | Any agent type can register |
| Allow-list | Only pre-approved agent types can register |
| Audit | All types register, but unknown types are flagged for review |
Agent Card
Every agent publishes an Agent Card at/.well-known/agent-card.json. The SDK generates this from your define_capability calls.
Manual Registration (non-SDK)
If you’re not using the SDK (e.g. Python, Go): 1. Authenticate:"public_url" and "deployment_mode": "hosted" only if your agent is publicly reachable.
Managing Agents
Environment Variables
| Variable | Purpose | Required |
|---|---|---|
SVANTIC_CLIENT_ID | API client ID | Yes |
SVANTIC_CLIENT_SECRET | API client secret | Yes |
SVANTIC_INSTANCE_ID | Stable instance ID (for containers/k8s) | No (defaults to hostname-port) |
