Agent configuration including model, instructions, and optional tools.
All BaseAgentConfig fields are accepted; advanced fields (rag, discovery,
permissions, emergent, voice, guardrails, etc.) are stored but not actively
wired in the lightweight layer — they are consumed by agency() and the full runtime.
An Agent instance with generate, stream, session, and close methods.
const myAgent = agent({ model: 'openai: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().