Recommended migration plan:

Phase 1 keeps the JSON files as source of truth and builds a SQLite mirror. The mirror should include conversations, messages, tool calls, and memory items. Every imported row stores the original file path and byte offset where possible, so debugging can still jump back to the old artifact.

Phase 2 changes reads to prefer SQLite while writes still update JSON first. A background verifier compares row counts, message counts, and content hashes. Any mismatch disables SQLite reads for that workspace.

Phase 3 moves writes to SQLite and exports periodic JSON snapshots for recovery. At that point the UI should include a long-cell inspector because prompts, responses, and memory bodies are no longer convenient to inspect as files.