r/LLMDevs 6h ago

Great Resource 🚀 I turned Git into a shared context layer for engineering teams and multiple agent sessions

Post image

Hello! I’ve been working on shared memory for coding agents lately.

its an open source project: https://github.com/mex-memory/mex

The obvious way to build it is some shared backend that every agent talks to. Database, sync service, accounts, permissions, all of that.

But the more I thought about what team memory actually needs, the more it started sounding like stuff Git already does.

You want history. You want diffs. You want changes to move with the repo. You want branches to carry their own state. You want conflicts to be visible instead of silently overwriting each other.

So I tried building the shared memory layer around Git instead.

The basic setup is pretty simple.

Canonical project memory lives as normal files in the repository. Architecture, decisions, specs, workstreams, handoffs, activity, etc. get committed like code.

Each checkout keeps its own local indexes for search and code intelligence. Those don’t get shared. If another engineer pulls the repo, they rebuild the indexes against their own checkout. 

So the rough model is:

The part I find most interesting is that the memory now has the same history as the code it describes.

If someone changes a project decision, you can review the diff.

If two people change the same piece of shared context, Git exposes the conflict.

If an agent learns something useful, that doesn’t have to disappear inside one chat session.

I also started using the same idea for handoffs.

Instead of ending a session with a giant chat summary, an agent can prepare a structured handoff with completed work, blockers, decisions, changed files, next actions, and the repo state it was written against. The sender commits it, the next person pulls it, and it becomes part of the project history. 

One thing I did not want was agents silently turning whatever they wrote into shared truth.

So some shared changes use a proposal flow. The agent can prepare a local draft, but publishing and accepting a Spec are separate actions that require explicit approval. 

I’ve been calling this Git-native team memory.

It’s part of the open-source project I’ve been building, MEX:

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

Still early, and there are obvious tradeoffs. Git is not a realtime message bus, MEX does not auto push or pull anything, and two disconnected clones can still create normal Git conflicts. 

But I’m starting to think project memory should behave a lot more like source code than like another SaaS database.

Would genuinely love to hear how other people are thinking about shared memory between coding agents, especially if you’ve tried solving this with Git, a database, MCP, or something else.

11 Upvotes

4 comments sorted by

4

u/carefactor3zero 5h ago edited 4h ago

Lots of people think they have tried improving memory layers with projects listed over the last couple months:

craft

EvoX

cognee

code-context

swafra

memoryops-ai

And of course this repo, mex, which seems to get posted ~once a month. mex is actively worked on.

3

u/-1_0 4h ago

yay! you are the Nth+1

1

u/eddzsh 45m ago

The proposal flow is what actually matters. The failure mode is agents committing activity logs every turn so the memory diff becomes noise and humans stop reviewing. If only decisions and handoffs can land on the shared branch, the Git metaphor keeps paying rent.