When debugging agent behavior or tracing conversation context, you need complete conversation records. Session history persists multi-turn conversations to Table Store (OTS) through AgentRun Server, letting you view, manage, and delete historical messages per session.
What is session history
Session history is a sub-feature of the memory store that preserves multi-turn conversations between agents and callers. When enabled, AgentRun Server automatically persists conversations to Table Store (OTS), where you can view, manage, and delete historical messages on a per-session basis.
Supported frameworks
Session history automatically records conversations generated through AgentRun Server, with no manual API calls required. The following frameworks are supported:
|
Framework |
Recording method |
Requirements |
|
LangChain |
Automatic recording |
Pass the |
|
Google ADK |
Automatic synchronization after setting |
You must initialize the OTS SessionStore and include the |
|
LangGraph |
Automatic synchronization after setting |
You must include the |
Prerequisites
-
You have created a memory store instance of the Table Store (OTS) type. If not, see Create and manage a memory store. Session history supports only the OTS type; RDS-type memory stores do not support this feature.
-
You have the necessary permissions to operate the memory store. If you are using a RAM user, the
AliyunAgentRunFullAccesspermission policy or a custom policy with read and write permissions for the memory store is required. -
Be aware that you cannot disable Session History after it is enabled because the action is irreversible. When you enable this feature, the Enable Session History? dialog box appears. Click Confirm Enable to complete the operation.
Manage session history in the console
The Session History tab contains two sub-tabs: Session History (to view the session list and details) and Code Integration (to view OTS SDK code samples).
View the session list
-
Log on to the AgentRun console, and in the left navigation bar, select Memory.
-
In the list of memory stores, click the name of the target memory store to go to its details page.
-
Switch to the Session History tab.
The session list is sorted by update time in descending order. Each session record displays the following information:
|
Field |
Description |
|
Session ID |
The unique identifier for the session. Long IDs are automatically truncated. You can hover over the ID to view the full value. |
|
Content preview |
A preview of the first 100 characters of the first message in the session. If a session has no messages, this field displays the update time. |
|
Metadata |
The format is |
|
Update time |
The time the session was last updated, displayed in your local time as YYYY-MM-DD HH:mm. |
Use the pagination controls at the bottom of the list to display 10, 20, or 50 records per page. Changing the page number or the number of items per page clears your selections.
View message details
-
Follow the steps above to go to the Session History tab.
-
In the list, click the View button to the right of the target session record.
-
A details panel slides out from the right, displaying the following information:
-
Basic Information: Session ID, agent ID, caller ID, and update time.
-
Metadata: A list of messages for the session. The
contentfield of each message is displayed in JSON format. The panel shows the first two messages by default. -
Related Session State: If the session has associated session state data, you can view it in this section and navigate to the session state details.
-
Delete a single session
-
In the Session History list, find the target session record.
-
Click the Delete button to the right of the record.
-
In the confirmation dialog box, click Confirm Delete.
Verify the deletion
-
A message appears at the top of the page: "Successfully deleted 1 session history record."
-
The list refreshes automatically. Confirm that the record has been removed from the list.
Delete sessions in bulk
-
In the session history list, select the checkboxes of the session records that you want to delete, or click the Select All checkbox at the top of the list.
-
The Batch Delete (N) button appears above the list, where N is the number of selected items. Click the button.
-
In the confirmation dialog box, click Confirm Delete.
Verify the deletion
-
A message appears at the top of the page: "Successfully deleted N session history records."
-
The list refreshes automatically. Confirm that all selected records have been removed from the list and that the selections are cleared.
Cross-reference session state
The message details panel in session history provides access to associated session state data:
-
Follow the steps above to open the message details panel.
-
In the Related Session State section, view the state Key-Value data associated with the session.
-
Click the view button for a status record to view its complete information in the details view on the Session State tab.
You can also navigate in the reverse direction from the session state details. In the session state details panel, click View Related Session History to switch to the session history tab and open the corresponding session details.
Limitations and notes
-
Session history is supported only for Table Store (OTS) memory stores. This feature is not supported for RDS-type memory stores, and the Session History tab is not displayed on the console details page.
-
Once Session History is enabled, it cannot be disabled. The switch becomes grayed out and inactive after enablement.
-
Session history does not support search and filtering. To filter by agent ID, caller ID, or Session ID, use the session state feature.
-
Delete operations are irreversible. All message data in the session will be permanently erased.
-
When using the Google ADK or LangGraph frameworks, you must set the
agent_idparameter in the request data. Otherwise, AgentRun Server will not automatically synchronize the session history. -
Session history stores conversation data in your Table Store instance. The cost is included in OTS resource fees for the memory store and is not billed separately.
FAQ
Disabling session history
No. Once session history is enabled, it cannot be disabled. The switch becomes grayed out and inactive after enablement.
Session history with RDS memory stores
No. Session history is supported only for memory stores of the Table Store (OTS) type. The details page for an RDS memory store does not display the Session History tab.
Searching and filtering session history
Session history does not support search or filtering. To filter by agent ID, caller ID, or Session ID, use the Session State feature.
Automatic recording for ADK and LangGraph
Ensure that you have set the agent_id parameter in your request data. The Google ADK and LangGraph frameworks require you to explicitly specify the agent_id in the session data or server configuration to enable automatic session history synchronization.