Mitosis Labs

SDK

Offices and agents

Create an office, hire agents into it, and manage their lifecycle.

An office is one memory graph plus the agents that work against it. The API calls it an office and gives it an officeId; the product calls it a memory.

Offices

const office = await client.offices.create({ name: 'research' });
const all    = await client.offices.list();
const one    = await client.offices.get(officeId);
MethodSignature
createcreate(req: CreateOfficeRequest)
listlist()
getget(officeId)
getSettingsgetSettings(officeId)
updateSettingsupdateSettings(officeId, settings)
statusstatus(officeId), cluster status
suspendsuspend(officeId)
deletedelete(officeId)
transfertransfer(officeId, newOwnerId)
rotateSecretrotateSecret(officeId)
setSecretsetSecret(officeId, secretName, value)
kubeconfigkubeconfig(officeId)

Agents

Agents are employees in the API.

const agent = await client.employees.hire(officeId, {
  name: 'scout',
  role: 'research assistant',
  modelTier: 'standard',
  skills: ['search', 'summarize'],
});

HireRequest accepts name (required), plus role, modelTier, skills, channels, resources, storage, selfConfigure, autoUpdate, chromium, webTerminal and imageTag.

MethodSignature
hirehire(officeId, req)
listlist(officeId)
getget(officeId, name)
updateupdate(officeId, name, req)
deletedelete(officeId, name)
logslogs(officeId, name, { tail })
activityactivity(officeId, name, query)
presencepresence(officeId, name){ online, last_seen }
lastErrorlastError(officeId, name)
actionaction(officeId, name, action)
promotepromote(officeId, name, req)
setSkillssetSkills(officeId, name, req)

Agents are addressed by name within an office, not by an opaque id:

const logs = await client.employees.logs(officeId, 'scout', { tail: 200 });
const live = await client.employees.presence(officeId, 'scout');

Debugging a quiet agent

  1. Is it running?

    presence(officeId, name) returns online and last_seen.

  2. Did it fail?

    lastError(officeId, name) returns the most recent error and its timestamp.

  3. What did it do?

    activity(officeId, name, query) returns the activity feed; logs returns raw output.