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);
| Method | Signature |
|---|---|
create | create(req: CreateOfficeRequest) |
list | list() |
get | get(officeId) |
getSettings | getSettings(officeId) |
updateSettings | updateSettings(officeId, settings) |
status | status(officeId), cluster status |
suspend | suspend(officeId) |
delete | delete(officeId) |
transfer | transfer(officeId, newOwnerId) |
rotateSecret | rotateSecret(officeId) |
setSecret | setSecret(officeId, secretName, value) |
kubeconfig | kubeconfig(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.
| Method | Signature |
|---|---|
hire | hire(officeId, req) |
list | list(officeId) |
get | get(officeId, name) |
update | update(officeId, name, req) |
delete | delete(officeId, name) |
logs | logs(officeId, name, { tail }) |
activity | activity(officeId, name, query) |
presence | presence(officeId, name) → { online, last_seen } |
lastError | lastError(officeId, name) |
action | action(officeId, name, action) |
promote | promote(officeId, name, req) |
setSkills | setSkills(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
Is it running?
presence(officeId, name)returnsonlineandlast_seen.Did it fail?
lastError(officeId, name)returns the most recent error and its timestamp.What did it do?
activity(officeId, name, query)returns the activity feed;logsreturns raw output.