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
- Stop any agent session that is writing to the store.
- Run
rm -rf .index/ && mem rebuildinside the store directory. - Run
mem recall "why files instead of a database"to confirm search returns results again. - Run
lsandgrepon 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.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for tigerless-labs/agent-memory and "Rebuild a broken memory index from the Markdown files"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer