Agent configuration. Deferred fields are reported at construction.
Voice is applied only through an explicit voice.session binding and the
returned voiceSession() method. Ordinary generate/stream/session calls
remain text calls. The full runtime does not apply the voice flag.
An Agent instance with generate, stream, session, and close methods.
With runtime: 'gmi', at construction, naming an option the GMI path
cannot honour (see gmi); without it, when agencies.launch is set, which only
the GMI path runs.
const myAgent = agent({ provider: 'openai', model: 'gpt-4o', instructions: 'You are a helpful assistant.' });
const session = myAgent.session('user-123');
const reply = await session.send('Hello!');
console.log(reply.text);
Creates a lightweight stateful agent backed by in-memory session storage.
The agent wraps generateText and streamText with a persistent system prompt built from
instructions,name, andpersonalityfields. Multiple independent sessions can be opened viaAgent.session().With
runtime: 'gmi',agent(opts)returnsgmi(opts): the sameAgentsurface, with every session served by a Generalized Mind Instance built from these options, and the construction checks and diagnostics of that path.