Agent SDK

Journeys as code

Your agent is a versioned artifact in your repo — typed, tested, reviewed in PRs, and deployed from your CI. Not a configuration buried in someone else’s dashboard.

Skills are typed functions you compose into agents

Compose from stock skills — triage, answer, collect-info, confirm, escalate — or write your own in TypeScript against a typed interface. The runtime handles orchestration, state, and tracing.

// skills/order-exchange.ts
export const orderExchange = defineSkill({
  name: "order_exchange",
  config: z.object({ maxValueUsd: z.number() }),
  async run(ctx, input) {
    const order = await ctx.tools.call("shopify.lookup_order", {
      id: ctx.state.collected.order_id,
    });
    // irreversible → runtime requires confirmation + supervisor verdict
    const exchange = await ctx.tools.call("shopify.create_exchange", {
      order: order.id, variant: input.newVariant,
    });
    return { output: { exchange }, draft: confirmationMessage(exchange) };
  },
});

What’s in the box

Declarative spec

Goals, guardrails, skills, tool allowlists, and per-skill determinism tuning in one YAML or TypeScript file. Validated at publish, pinned per conversation.

Model gateway

Each task — planning, triage, generation, supervision — routes to the model you choose. Two vendors out of the box, BYO keys, automatic failover, per-conversation cost metering.

Typed tool layer

Prebuilt connectors for Shopify, Stripe, Zendesk, Salesforce, Slack — plus a generic REST connector. Three execution tiers; the irreversible one is mechanically gated.

Local dev loop

kaarna dev runs your agent locally with a chat UI and live trace view. kaarna deploy ships it. Staging and prod aliases, instant rollback.

Replay regression

Record real conversations; replay them against every spec change in CI. Plan-agreement and quality gates fail the build before your customers notice.

Persona simulation

Twenty synthetic customers — angry, vague, adversarial — hammer your agent before each release. Judge-scored, trend-tracked.

From clone to conversation in a few commands

$ npm create kaarna@latest acme-support
$ kaarna dev                 # local chat + live traces at localhost:3434
$ kaarna sim run --personas  # 20 synthetic customers, judge-scored
$ kaarna deploy --alias prod # live behind your widget embed

Try the SDK

Design partners get the SDK, direct support from the founding team, and help porting their first journey.

Request SDK access