The Memory Export feature allows you to create structured exports of memories using customizable Pydantic schemas. This process enables you to transform your stored memories into specific data formats that match your needs. You can apply various filters to narrow down which memories to export and define exactly how the data should be structured.
You can optionally provide additional instructions to guide how memories are processed and structured during export using the export_instructions parameter.
Copy
Ask AI
# Basic export requestfilters = {"user_id": "alice"}response = client.create_memory_export( schema=json_schema, filters=filters)# Export with custom instructions and additional filtersexport_instructions = """1. Create a comprehensive profile with detailed information in each category2. Only mark fields as "None" when absolutely no relevant information exists3. Base all information directly on the user's memories4. When contradictions exist, prioritize the most recent information5. Clearly distinguish between factual statements and inferences"""filters = { "AND": [ {"user_id": "alex"}, {"created_at": {"gte": "2024-01-01"}} ]}response = client.create_memory_export( schema=json_schema, filters=filters, export_instructions=export_instructions # Optional)print(response)