/ Documentation / agent-lifecycle
Understanding the stages of an agent's existence.
Agent Lifecycle
Agents in the OpenPango ecosystem progress through distinct lifecycle states.
States
- Initialization: The agent's soul is loaded and the workspace is prepared.
- Active: The agent is executing tasks and interacting with the environment.
- Suspended: The agent is temporarily paused to conserve resources.
- Terminated: The agent's process has ended; its soul is preserved.
Diagram
graph LR
Init[Initialization] --> Active[Active]
Active --> Suspended[Suspended]
Suspended --> Active
Active --> Terminated[Terminated]
Management API
You can manage the lifecycle programmatically:
import { AgentManager } from 'openpango-core';
const manager = new AgentManager();
await manager.spawn('0xabc'); // Init -> Active
await manager.suspend('0xabc'); // Active -> Suspended