DEDUPED Hot AI repos, turned into use cases Get 5 a day

How to rebuild a broken memory index from the Markdown files with Agent Memory

Delete the rebuildable index cache and regenerate it without losing any memory.

Who it is forAn engineer whose search results look wrong or stale after a crash or a copy of the store.

The problemSearch results may be out of date or broken, and the engineer fears the index holds data that cannot be recovered.

The outcomeThe index is regenerated from the files, and recall works again with no memory lost.

What you need first

  • Python environment able to install the agent-memory package, as described in the README
  • Claude Code or Codex CLI installed on the machine
  • A store directory set as AGENT_MEMORY_STORE
  • Shell access to run the mem commands

Steps

  1. Stop any agent session that is writing to the store.
  2. Run rm -rf .index/ && mem rebuild inside the store directory.
  3. Run mem recall "why files instead of a database" to confirm search returns results again.
  4. Run ls and grep on the store directory to confirm the Markdown files are still present.

Prompt for your agent

Inside the agent-memory store at <store path>, run `rm -rf .index/ && mem rebuild`, then run a recall for <known topic>. Expected output: a non-empty L0 list. Verify that the count of Markdown memory files is the same before and after the rebuild.

Caveat. The README says the rebuild loses no knowledge, but only files outside .index/ and .state/ hold memory, so runtime state in .state/ should be backed up separately if it matters.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page