Skip to content

Quick Start

Terminal window
pnpm add minions-sdk
import { Minions } from 'minions-sdk';
const minions = new Minions();
const agent = minions.create('agent', {
title: 'Research Assistant',
fields: {
role: 'researcher',
model: 'gpt-4',
systemPrompt: 'You are a research assistant.',
tools: ['web-search', 'summarize'],
},
});
console.log(agent.data.id); // generated UUID
import { Minions } from 'minions-sdk';
const minions = new Minions();
// Create an agent and a skill
const agent = minions.create('agent', { title: 'Agent' });
const skill = minions.create('note', { title: 'Skill' });
// Link them
agent.linkTo(skill.data.id, 'parent_of');
const children = minions.graph.getChildren(agent.data.id);
const tree = minions.graph.getTree(agent.data.id);

If you need finer-grained control and tree-shaking, you can bypass the central client and use the underlying standalone functions:

import { TypeRegistry, createMinion, RelationGraph } from 'minions-sdk';
const registry = new TypeRegistry();
const agentType = registry.getBySlug('agent')!;
const { minion: agent } = createMinion({ title: 'Agent' }, agentType);
const graph = new RelationGraph();
graph.add({ sourceId: agent.id, targetId: 'skillId', type: 'parent_of' });
Terminal window
npx minions-cli validate my-agent.json