Grok Bot: prune/compact an agent’s context without creating a new Bot

Hey @hidden_whale, thanks for the screenshots. They made the picture clearer. First, I want to correct part of my previous reply.

Where memory is stored. Your bots’ memory is no longer stored as files on the bot’s computer. It is stored on our side. That’s why the bot says the memory is “kept off this computer”, and why searching the disk finds nothing. memory/profile.md for Signal Monitor is left over from the old storage setup. So the advice to “open the memory files” does not apply to the other bots. Sorry for the confusion.

~/.grok/config.toml and 13-memory.md. These belong to a separate Grok command-line tool on that computer. They do not control Grok Bot’s memory. You do not need to add the key, and it will not affect the bots.

How to view all of a bot’s memory. Right now, the bot can only search memory, and one search returns a limited number of results. There is no “show everything” command. The most reliable way is what you’re already doing: have the bot search by topic, save what it finds into a file, and then tell it which entries to delete.

How memory is added and cleaned up. Part of what you noticed is correct:

  • The bot saves facts not only when you ask it to. After most exchanges, the app also saves what it thinks is useful in the background, and it may delete entries it considers outdated. These changes do not appear in the bot’s actions, and that may be how that extra entry disappeared during your cleanup.
  • One entry can hold up to 500 characters. Longer entries are currently cut off when saved.
  • The memory the bot sees at the start of a chat gets refreshed in a new chat and after summary. So an entry saved in the middle of a chat may show up there later, but the bot can find it by search right away.

Description. The bot reads it on every turn, but as a description of itself, not as a rule it must follow. For things that should always be enforced, approvals and Auto-review rules are better: Work with Grok Bot | Cursor Docs. On desktop and mobile, editing the description is not available for all bots right now, so that’s why you only found it on the web. There is also a separate thread about this: Grok Bot: show and edit Bot role description in the info pane (match docs)

Memory deletion and the safety check. I can’t investigate those two cases without specific details. So they don’t get lost in this thread, please create a separate thread in Bug Reports and include:

  • which bot it was, the date, the approximate time, and the time zone when 17 entries were deleted and the 18th one disappeared
  • a screenshot of the safety check directly in the post, plus the approximate time

I passed along the example of memory carrying over between bots, and your posts on X, to the team.

@dotstijn, thanks for the theory. I passed it along with the report.

I’ll post here when there’s an update.