Skip to main content

Interface: AgentSessionOptions

Defined in: packages/agentos/src/api/agent.ts:526

Options for Agent.session.

Properties​

userId?​

optional userId: string

Defined in: packages/agentos/src/api/agent.ts:536

The user the session serves. With runtime: 'gmi' it scopes the session's cognitive memory: sessions opened with the same user id recall each other's facts, and a session opened without one has a scope of its own, its session id. The GMI also sends it with each model request as the end user's id (OpenAI's user or safety_identifier), so pass an opaque or hashed id, not an email address; a session opened without one sends none. Asking for an open session with another user id throws. The legacy runtime ignores it.