Try gptel-mode - your chats are in org buffers, and you can save/restore sessions easily. Also plays nicely with mcp.el for more tooling access.

gptel-mode (I have it at C-c L) is great!