MemKernel: shared, branchable memory for Cursor and other coding agents

I was curious about how agents will share memory and context at the OS level, and how that would operate. MemKernel is my experiment around that question.

Experimental library for testing agent capabilities. MemKernel explores how agents share memory and context. It can be risky in production or confidential workflows: incorrect or sensitive memories can persist and influence other agents’ decisions. Start with disposable projects and synthetic data, keep backups, and review what agents store and act on with human oversight.

The current implementation is a Python MCP server backed by one local SQLite database. Cursor and other cooperating coding agents can use it to share decisions, task context, and investigations across sessions.

The part I find interesting is branchable memory: fork an investigation, try a different assumption, compare it with the main branch, and roll back a decision while keeping an auditable event history.

Try it with Cursor (Python 3.11+):

uv tool install memkernel-mcp
# Run these from your project root:
memkernel attach cursor
memkernel doctor

Restart Cursor and enable the MemKernel MCP server. attach adds a project entry in .cursor/mcp.json; memkernel attach cursor --dry-run previews the changes.

An example to try: ask Cursor to record a database decision, fork an investigation to explore another option, then compare the branches and roll back an experimental decision. The repo also contains a recorded multi-agent run and its event history.

It is still experimental: storage is on one host, leases coordinate cooperating agents, and branch merges need an agent or a human. Leases do not enforce filesystem locks.

Code and setup docs: GitHub - varadganjoo/MemKernel · GitHub

MIT licensed; the PyPI distribution is memkernel-mcp (the unrelated memkernel package belongs to another author).

For people using Cursor alongside other coding agents: would shared decisions or branchable investigations be more useful in your workflow?

Disclosure: I maintain this project. This post was drafted with AI assistance using my notes and the repository.

branchable memory is a neat angle, especially the rollback with an event history. does the lease model work when the other agent is on someone else’s machine, or is this mostly same-host for now? the cross-owner case is where shared sqlite usually falls over for us.

yeah, same-host for now. each agent runs its own mcp process, but they all point at the same local sqlite db. haven’t built the cross-owner part yet, and sharing the sqlite file across machines isn’t supported.

i’d probably put an authenticated service in front of it for that. curious what your setup looks like though. are the agents sharing a workspace, or just passing context between separate projects?

oops, missed this. separate projects mostly. it’s me and a teammate on our own laptops with different tools, and what actually has to cross over is tiny, like “don’t touch the auth flow, i’m mid change”. we ended up with a small hosted room both agents post into over mcp so either of us can read along. if you do put a service in front of memkernel i’d be curious how forks map to people, feels like that’s where branching really pays off for you.

Your auth-flow example helped me pin down a useful first step. I’ve added coordination notices in 0.3.0, so an agent can flag something like “auth changes in progress” and clear it when done. An expired notice stays visible as stale rather than implying the work is finished.

I’m still working on sharing actual memories between laptops. The current release can exchange signed notices through a synced folder, but direct memory sync isn’t implemented yet. I’m leaning toward optional LAN sync, with everything private until you choose to share it.

For your setup, would you rather share individual decisions and facts, a whole investigation branch, or a separate shared space both agents can write to? Also, would same-LAN sharing be useful, or would you need it to work across different networks?

nice, showing it as stale instead of done is a smart call. for us it’d be individual decisions and facts, a whole branch is more than the other person wants to read. and it’d have to work across networks, we’re almost never on the same wifi. a shared space both can write to sounds cool but i’d only trust it if i could tell who wrote what