Overview
The/export endpoint exports LongMem data including sessions, observations, and compressed summaries. It supports filtering by project and time range, with output in JSON or Markdown format.
Authentication
This endpoint requires a valid authentication token if configured:Request
Filter export to a specific project. If omitted, exports all projects.
Export data from the last N days. Must be between 1 and 365. If omitted, exports all data.
Output format:
"json": Structured JSON (default)"markdown": Human-readable Markdown
Whether to include raw tool inputs/outputs in JSON export. Only applies to JSON format.
Response (JSON Format)
ISO 8601 timestamp of when the export was generated.
Array of session objects with:
id: Database session IDcreated_at: ISO 8601 timestampcompleted_at: ISO 8601 timestamp or nullproject: Project namefirst_user_prompt: First prompt text- Additional session metadata
Array of observation objects with:
id: Database observation IDsession_id: Parent session IDcreated_at: ISO 8601 timestamptool_name: Tool that was executedcompressed_summary: LLM-generated summaryfiles_referenced: Comma-separated file pathstool_input,tool_output: Raw data (ifinclude_raw=true)- Additional observation metadata
Examples
JSON Export (Default)
JSON Export with Raw Data
Markdown Export
All Data Export
Status Codes
- 200 OK: Export completed successfully
- JSON:
Content-Type: application/json - Markdown:
Content-Type: text/markdown; charset=utf-8
- JSON:
- 400 Bad Request: Invalid
daysparameter (must be 1-365) - 401 Unauthorized: Missing or invalid authentication token
- 500 Internal Server Error: Export query failed
Use Cases
- Backup LongMem data periodically
- Migrate data between LongMem instances
- Generate human-readable session reports
- Analyze tool usage patterns programmatically
- Create documentation from observation history
- Export data for archival or compliance