AI Assist chat lost

Using AI Assist in the browser notebook. First explained the overal goal and next some restrictions, boundaries, conventions, and wishes. No code generated yet. It became a quite comprehensive document. Next, added some feedback based on the responses. Started AI Assist again, computed for several minutes, so I thought it had hung itself.

Reloaded the page: all gone.

I understand that data is handled client-side and not permanently saved to an external database, it cannot be recovered once the page reloads.

My wish is that I can prep a spec in a piecemeal fashion and that these steps are saved (like Grok saves conversations which you can continue later).

Thanks for the feedback, and we agree! We are actively working on implementing persistence for in-notebook chats in a similar fashion to our standalone chats (capital-C chats) and it should be available soon. We also intend to support having multiple chats in the same notebook, so you can either switch between active chats, or go back to an earlier chat and review it.

Today, I inadvertently scrolled my notebook too far up, causing a refresh of the page and losing my AI chat I was using to review my notebook :cry:.

Eagerly looking forward to persistent chats…

So I typed Review the whole notebook. again and then asked, Copy my AI chat as markdown.

AI said:

I can’t write to your clipboard directly, so I added a cell at the end of the notebook with a Copy chat as markdown button. Click it to copy the chat.

I added a new cell at the end of the notebook with the full chat as markdown. My earlier copy cell no longer exists, so this one replaces it. It has:

  • A copy button: click Copy chat as markdown to put the whole text on your clipboard.
  • A read-only text box: you can also select and copy the markdown by hand from it.

The markdown contains your messages and my full review, including the code block, in order. It leaves out the cell-change notices that were sent with your last message.

It does work, but I initially had some problems. Anyway, I now have a way to persist the AI chat in some way.

I suspect that with this approach you might soon hit the size limit of cell contents. While there’s no way to avoid passing the transcripts through a cell, I’d suggest to then move them out into programmatic file attachments.

Thank you. And yes, I move them out into a separate notepad.

I assume that all this will be gone as soon as chats become persistent.

For what it’s worth, if you make the agent transfer the notes to file attachments then it will be able to refer back to them, and maybe even maintain its own memory outside of the actual notebook code.

Thanks! Good idea.

AI says:

I can’t create a FileAttachment myself, because my tools can’t upload files to the notebook. I added a Download ai-chat.md button in a new cell at the end of the notebook. The file contains the same markdown as the copy cell.

To attach it:

  1. Click the button to download ai-chat.md.
  2. Open the notebook’s file attachments panel and upload ai-chat.md.
  3. Read it with FileAttachment("ai-chat.md").text().

The file holds your first request, my review, and the copy request and its reply. It doesn’t include this last request or the cell-change notices.

I downloaded the markdown file and stored it somewhere safe.

I’ll probably do not attach it to the notebook myself, as the notebook will change and the remarks become obsolete.

The agent doesn’t know about FileAttachment.attach yet (its system prompt is likely outdated). Point it to the notebook that I linked, and it should pick up all the necessary details.

Edit: To clarify, this still doesn’t allow the agent to upload attachments via a tool call, but it should be able to automate uploads through the notebook simply by updating cells.

Ah, of course. Will try tomorrow. Thanks.

Hmmm… now I am confused. I thought it would.

Anyway, let’s put this to rest because I’m happy to just extract the AI chat as markdown. I will wait for AI updates Mike promised.

Just to wrap it up, here’s an example of what I had in mind: https://observablehq.com/d/c18146bb00296b0f

I ran out of tokens near the end, but the important stuff should have made it in.

I see. Thank you.

So you run out of tokens too‽ :slight_smile:

Not normally, because I only use the agent to test stuff for the forum. At least on the free tier it’s too limited for me (Sonnet is pretty weak at coding compared to Opus, and there’s no web search tool).