A validated export config object.
A new Agent instance constructed from the config.
If the config is invalid or missing required fields.
const config = JSON.parse(fs.readFileSync('agent.json', 'utf-8'));
const agent = importAgent(config);
const reply = await agent.generate('Hello!');
Imports an agent from an AgentExportConfig object.
For
type: 'agent', calls theagent()factory with the stored config. Fortype: 'agency', calls theagency()factory with the stored config plus the sub-agent roster and strategy.The imported agent is a fully functional instance with
generate,stream,session, andclosemethods.