Skip to content

Kernel

The central orchestrator. All operations go through the kernel.

Constructor

typescript
const kernel = new Kernel({
  name: 'my-app',
  debug: false,
  memoryBackend: backend,
  maxProcesses: 100,
  on: { 'process:spawned': (e) => console.log(e) },
});

Agent Management

MethodDescription
register(...agents)Register one or more agents
getAgent(name)Get a registered agent by name
agentsArray of all registered agents

Process Lifecycle

MethodReturnsDescription
spawn(name, options?)ProcessCreate a running process
execute(processId, input)ExecutionResultRun a task
pause(processId)voidPause a process
resume(processId)voidResume a paused process
terminate(processId)voidTerminate a process
getProcess(id)ProcessGet process by ID

Infrastructure

Property / MethodDescription
memoryMemoryBus instance
toolsToolRouter instance
brokerMessageBroker instance
registerTool(def)Register a tool
createChannel(config)Create a message channel
stats()Aggregate stats (async)
shutdown()Terminate all processes

ExecutionResult

FieldTypeDescription
processIdstringProcess that ran
agentNamestringAgent name
outputunknownHandler return value
durationnumberWall-clock ms
tokensUsednumber?LLM tokens used
eventsKernelEvent[]Events emitted

Released under the MIT License.