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

Relevant Source Files

  • src/sessions/listSessions.ts for the exact project selector shape
  • src/sessions/getSessionTurns.ts for how turns are derived from root spans

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.

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.

Source Map

  • src/sessions/listSessions.ts
  • src/sessions/getSession.ts
  • src/sessions/getSessionTurns.ts
  • src/sessions/addSessionAnnotation.ts
  • src/sessions/addSessionNote.ts
  • src/sessions/deleteSession.ts
  • src/sessions/deleteSessions.ts