Create a structured export of memories based on a provided schema.
POST
/
v1
/
exports
/
Python
Copy
Ask AI
# To use the Python SDK, install the package:# pip install mem0aifrom mem0 import MemoryClientclient = MemoryClient(api_key="your_api_key", org_id="your_org_id", project_id="your_project_id")json_schema = {pydantic_json_schema}filters = { "AND": [ {"user_id": "alex"} ]}response = client.create_memory_export( schema=json_schema, filters=filters)print(response)
Copy
Ask AI
{ "message": "Memory export request received. The export will be ready in a few seconds.", "id": "550e8400-e29b-41d4-a716-446655440000"}
Submit a job to create a structured export of memories using a customizable Pydantic schema. This process may take some time to complete, especially if you’re exporting a large number of memories. You can tailor the export by applying various filters (e.g., user_id, agent_id, run_id, or session_id) and by modifying the Pydantic schema to ensure the final data matches your exact needs.