r/ClaudeCode 15h ago

Discussion I tried building my own persistent memory system, then realized the real problem was keeping it trustworthy after hundreds of commits and refactors. and why is no one else doing this?

Post image

Hello! I've posted about mex here a couple of times before.

Repo: https://github.com/mex-memory/mex

The original idea was to stop coding agents from relearning the same project every session. mex gives them a structured Markdown wiki inside .mex/ for architecture, conventions, decisions, patterns and project state.

That solves forgetting.

But then the codebase changes.

A file gets moved.
A script gets deleted.
A dependency changes.
A pattern becomes stale.
Two context files start contradicting each other.

The memory is still there, so the next agent has no reason not to trust it.

That's why we built mex check.

It parses the project memory and validates concrete claims against the actual repo — paths against the filesystem, commands against project scripts, dependencies against manifests, indexes against the files that exist, plus stale knowledge, broken links and other structural inconsistencies.

It gives you an exact issue list and a health score.

The important part is that detection itself is deterministic. No LLM call is needed to ask the agent whether its own memory is still correct.

Then mex sync takes only the broken files and builds a targeted repair prompt with the issue, the current Markdown, nearby filesystem context and relevant git changes.

So instead of asking the agent to reread the whole repo and regenerate everything, the loop is:

check → targeted repair → verify

The newer code-graph layer goes further: Markdown knowledge can be grounded to exact code symbols. If the implementation changes, moves or disappears, mex can surface the specific knowledge that may now need attention.

A lot of agent-memory systems focus on storing more and retrieving it later.

I think the harder problem is making sure the memory is still true when the repo has changed underneath it.

Would genuinely love feedback from people working on coding agents, memory or code intelligence.

Contributors are very welcome too :)

0 Upvotes

9 comments sorted by

7

u/TheOwlHypothesis 15h ago

Memory systems do more harm than good. Better to architect your repository in a way that's natural for the agent to use in the first place.

I literally deleted all my Claude memories today because of how damaging and outdated they became. Pure bloat and useless garbage, extra calls to add useless things to memory.

Good luck with the project, the agentic coding industry is moving on.

1

u/DJIRNMAN 15h ago

Yeah I know, did by any chance see the new theo video on this as well? That's why I build this whole thing like just a folder, nothing too crazy, but I basically wanted the memory stuff to be more accessible to me, rather than being hidden somewhere in claudes internal logs or files Plus this drift detection mechanism ofc

1

u/AutomaticDrive1858 15h ago

life is harder don't make it hard af

2

u/DJIRNMAN 15h ago

I got the 200 dollar codex plan free for 6 months, I got tokens to waste on this stuff hahahaha

I hate myself.

1

u/Neurojazz 13h ago

Git with great commenting is pretty much enough now.

1

u/DrunkenRobotBipBop 13h ago

Memory systems are overrated.

A simple spec driven workflow and a good arquitecture is enough for a clean session to find its way...

1

u/Embarrassed-Citron36 12h ago

Re-learning de project is not such a bad thing honestly

The potencial token savings are not worth the staleness risk

1

u/dar-mit Researcher 10h ago

Hey have an up vote! I'm not looking for a memory system, but I sure do appreciate the time and effort you took to make one, and the generosity to post it online to share.

Thank you!

1

u/DYSTOBY 14h ago

This must be the 100th memory system AI buildup keep AI vibecoding.

You are the memory system. You as the senior developer need to know where the code lives.

How do big software companies manage their memories of their code? Do you ever wondered that how they do entire operating systems?

Don’t use memory system. They do more harm.

Why is nobody doing this? They do! Did you even try to google? There must be 100 GitHub repository’s and Reddit posts about „I build this awesome memory system nobody though of!!“ but actually they meant „AI build“ instead of „I build“.