Skip to documentation
Docs navigation
Docs/getSessionId()
MemoGrafterAgent

getSessionId()

Read the stable session identifier used by the agent.

What it does

Read the stable session identifier used by the agent.

When to use it

Use when logging, correlating storage records, or integrating the agent with application-owned session metadata.

Signature

TypeScript
getSessionId(): string

Result

The current session ID.

Behavior

Returns the stable session identifier assigned to this agent instance.

Side effects and completion

Read-only and synchronous.

Example

example.ts
const sessionId = agent.getSessionId();