Skip to main content

The sessions module groups multi-turn activity under a project and supports retrieval, annotations, and cleanup.

List Sessions#

Each session includes cumulative prompt, completion, and total token counts across all of its spans. The fields may be undefined when using a Phoenix server that does not return session token usage.

Pass a filter expression to narrow the results. The language is documented on the Filter Expressions page.

Empty expressions do not filter. Invalid expressions return HTTP 400; older servers are rejected before sending an expression.

Retrieve A Session And Its Turns#

getSession() and getSessionTurns() only need sessionId. They do not take a project selector.

Annotate Sessions#

Session annotations are covered in depth in Session Annotations. Quick example:

Add a Note to a Session#

Use addSessionNote to append a free-text note to a session. Multiple notes can be added to the same session; each receives a unique UUIDv4 identifier.

Requires Phoenix server >= 14.17.0.

Cleanup#

Use deleteSession or deleteSessions when you need to remove session records by identifier.