Examples

Code

The shape of an extension

The engine is one binary. Your logic lives in a separate program it starts and talks to over standard input and output. If your language can read a pipe, it can be an extension.

Receiving dock

You are putting AI into receiving. The engine is already running on the box. What you write is a separate program that tells it what it is allowed to do here.

Every extension does the same two things. It tells the engine what it provides, then it waits. The engine calls back when a person asks something, when a timer fires, when an inbound call arrives, or when the loop reaches a point you asked to intercept.

Nothing about that changes with the language. The SDKs are conveniences over a documented protocol, and the third tab is that protocol. A shop whose language has no SDK is still in the room.

agents/*.md + extension.ts
import { createIon } from 'ion-sdk'

const ion = createIon()

// Tell the engine what this extension provides.
ion.registerTool({
  name: 'open_po_lines',
  description:
    'Find out what is still expected on a purchase order and how ' +
    'much has already been received. Use when a delivery does not ' +
    'match its paperwork.',
  parameters: {
    type: 'object',
    properties: {
      poNumber: { type: 'string', description: 'PO number on the list' },
    },
    required: ['poNumber'],
  },
  execute: async ({ poNumber }) => ({
    content: await erp.openLines(poNumber),
  }),
})

Two things happen here: you declare what you provide, then you hand control to the engine. Everything after that is the engine calling you back.

What you can register

  • +Tools. Actions the model may take. It decides when; your code decides what.
  • +Schedules and webhooks. Work that starts on a timer, or because another system called.
  • +Agents. Specialists with their own instructions, tools and model.
  • +Hooks and commands. Points in the loop you intercept, and commands people type.

Start with the one you will write first