Skip to main content
A session is a named context that groups one or more agent runs together. Sessions provide short-term episodic memory: when an agent receives a new message in an existing session, the full message history from that session is reloaded and included in the prompt, allowing the agent to refer back to earlier turns in the conversation. Sessions are the mechanism behind multi-turn chat; without them, each run is stateless and isolated.

How sessions are created

Sessions are created automatically. When you submit a RunRequest without a sessionId, Agent Manager generates a new UUID and starts a fresh session. The sessionId is returned in the response so you can use it for follow-up requests. To continue an existing conversation, pass the same sessionId in subsequent RunRequest bodies:
Save the sessionId returned from your first run and pass it in all subsequent runs to maintain a coherent multi-turn conversation.

Listing sessions

GET /api/sessions returns a paginated list of sessions. Filter by user or agent using query parameters.
Response
string
Filter sessions to those belonging to a specific user.
string
Filter sessions to those involving a specific agent.

Getting session details

GET /api/sessions/{sessionId} returns the full AgentSession record, including the stored message history.
Response
Returns 404 Not Found if the session does not exist.

Getting run history for a session

GET /api/sessions/{sessionId}/runs returns all AgentRun records that occurred within a session. Use this to audit the individual executions—including tool calls, reasoning steps, and status—for a given conversation.
Response

Deleting a session

DELETE /api/sessions/{sessionId} permanently removes the session and its full message history.
Returns 204 No Content on success.
Deleting a session removes all message history for that conversation. The agent will have no memory of prior exchanges if you start a new run with the same session ID.

Multi-turn conversation example

The following example shows how to maintain a coherent conversation by passing the sessionId across three sequential requests.
1

Start the conversation

Submit your first message without a sessionId. Save the sessionId from the response.
2

Continue the conversation

Pass the sessionId in your follow-up message. The agent recalls the previous exchange.
3

Close the conversation

When the conversation is complete, delete the session to free storage or to comply with data retention policies.

Sessions vs. long-term memory

Sessions and long-term memory serve different roles in Agent Manager: Use sessions to give an agent memory within a conversation. Use long-term memory to give an agent knowledge about a user that should survive across conversations. For more details on long-term memory, see Long-Term Memory: Persistent User Facts.