Node ≥ 20 · TypeScript-first · zero runtime dependencies. Full reference on the desktop page.
npm install @nexusaiframework/runtime # or from source, to run tests + demo: git clone github.com/BULMKT/NexusAIAgentFramework npm install && npm test # 171 tests
const runtime = new NexusRuntime({ storage: new FileStorage('.nexus') }); runtime.register(defineAgent({ name: 'support', provider: new AnthropicProvider(), model: 'claude-sonnet-4-5', tools: [lookup, refund], // refund: requiresApproval budget: { maxUsd: 0.50 }, approvalPolicy: ({ arguments: a }) => a.amountUsd < 50 ? 'approve' : 'ask', }));
const run = await runtime.run('support', task); // waiting_approval? decide from anywhere: await runtime.approve(run.id); // crashed? halted at budget? await runtime.resume(run.id); // finished? regression-test it: const rep = await replayRun(run); // $0.00
const client = await McpClient.connect({ command: 'npx', args: ['-y', '@your/mcp-server'] }); const tools = await mcpTools(client, { requiresApproval: ['issue_refund'] });
attachWebhook(runtime, { url: SLACK_URL, format: 'slack' }); $ nexus serve # dashboard :3838 $ nexus runs --status waiting_approval $ nexus show run_x --steps $ nexus replay run_x
attachOtel(runtime, { endpoint: OTEL_ENDPOINT }); // GenAI spans over OTLP, zero deps await runtime.run('support', task, { tags: { customerId: 'acme-42' } }); await runtime.listRuns({ tags: { customerId: 'acme-42' } });
await runtime.approve(id, callId, { edited: { amountUsd: 50 } }); await runtime.respond(id, callId, 'handled by phone'); $ nexus mcp # expose Nexus as an MCP server
FileStorage (zero-dep default) · SqliteStorage (built-in node:sqlite, Node 22+) · PostgresStorage (multi-node, bring-your-own pg client) · MemoryStorage (tests). Four adapters, 5-method interface.
Runs persist as Open Agent Run documents (CC0, oar/0.2) with hosted JSON Schemas, plus zero-dep validators and a stdlib-only Python reader. Auditable and portable forever.