memory_import
Import memory data from JSON format to the Memora server. Choose import strategy: replace existing memories, merge with duplicates skipped, or append all new entries.
Instructions
Import memories from JSON format. Rate limited: 60s cooldown.
Args: data: List of memory dictionaries with content, metadata, tags, created_at strategy: "replace" (clear all first), "merge" (skip duplicates), or "append" (add all)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| strategy | No | append |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- memora/server.py:1606-1631 (handler)Implementation of the memory_import MCP tool.
async def memory_import( data: List[Dict[str, Any]], strategy: str = "append", ) -> Dict[str, Any]: """Import memories from JSON format. Rate limited: 60s cooldown. Args: data: List of memory dictionaries with content, metadata, tags, created_at strategy: "replace" (clear all first), "merge" (skip duplicates), or "append" (add all) """ # Validate inputs before consuming cooldown if strategy not in ("replace", "merge", "append"): return {"error": "invalid_input", "message": f"Unknown strategy: {strategy}"} if not data: return {"error": "invalid_input", "message": "No data provided"} if msg := _check_tool_cooldown("memory_import"): return {"error": "rate_limited", "message": msg} try: result = _import_memories(data, strategy) _schedule_cloud_graph_sync() return result except ValueError as exc: return {"error": "invalid_input", "message": str(exc)} finally: _finish_tool("memory_import")