Actions25
- Database Actions
- Memory Actions
- Query Actions
- Query Builder Actions
- Table Actions
- Table Management Actions
Memory → Get Chat History
AI-generatedSummary
Retrieve chat history for a session
Inputs
- databaseId (required) — The unique identifier of your Cloudflare D1 database.
- sessionId (required) — The session ID to retrieve messages for.
- messageTypes — Types of messages to include in the history (human, ai).
- memoryLimit — Maximum number of messages to return.
- sortOrder — Order to return messages in (oldest first or newest first).
Output shape
An array of chat message objects
Each message typically includes fields such as id, role, content, and timestamp; the array may be empty; no pagination is provided.
Examples
Example 1: Fetch full chat history using default settings
databaseId=
Example 2: Retrieve only AI messages in descending order with a limit of 20
databaseId=
Example 3: Search messages containing a term across sessions
databaseId=