Skip to content

TechBedouin/MOG-memory-system

Repository files navigation

mog-memory

Git for agent memory. No vectors. No API keys. No amnesia.

Compile your coding agent's brain into markdown — then diff it like code.

MIT npm no vector db cursor


Your agent forgets everything when the chat ends. You paste context. You pay for tokens. You still get wrong answers.

MOG (Markdown Object Graph) fixes that by making memory a relational graph of markdown files in your repo — with a hot RAM layer, semantic pointers, and a CLI that lints what your agent wrote.

npx mog init .
mog lint
mog graph

~400 tokens to boot the next session instead of re-uploading your entire life story.


Why stars flock here (and not to another Mem0 wrapper)

Everyone else MOG
Embeddings + hosted DB Files in your git repo
"Remember what I said" Compile what is true now
Opaque memory API git diff on active_state.md
Hope the agent updates memory mog lint in CI
Similarity search Graph edges + TL;DR pointers

Memory is compiled state, not recalled conversation.


60-second start

# 1. Scaffold memory in any repo
npx mog init .

# 2. Agent reads soul.md + active_state.md every session (Cursor rule included)

# 3. After each task, agent updates active_state.md:
#    - **Active Thread:**
#    - **Immediate Next Step:**
#    - **[path.md]** : TL;DR -> one sentence

# 4. Validate
mog lint
mog graph --out docs/memory-graph.mmd
mog weave          # backlink index → memory/GRAPH_INDEX.md
mog query "relates_to:*"

Architecture

soul.md              ← L0 identity (cold, small)
active_state.md      ← L2 RAM (hot — current thread + pointers)
knowledge/*.md       ← entity nodes (bugs, ADRs, features)
     ↑
     └── [Relates_To] / [Blocked_By] graph edges

Boot: soul → RAM → follow pointers only if TL;DR isn't enough.

Write: agent edits entity files + RAM after every milestone.

Full spec: spec/MOG-1.0.md · Deep dive: docs/ARCHITECTURE.md


CLI reference

Command What it does
mog init [dir] Scaffold soul, RAM, Cursor rule, CI workflow
mog lint [dir] Broken pointers, missing TL;DR, bad edges
mog graph [dir] Export GRAPH.mmd (Mermaid)
mog weave [dir] Generate memory/GRAPH_INDEX.md backlinks
mog query "relates_to:*" Search graph edges without vectors

Exit code 1 on lint errors — wire it into CI.


Live demo: 3 sessions, 1 bug

See examples/three-session-bugfix — an agent discovers OAuth 401s, fixes auth.js, and closes the loop. Only markdown diffs prove continuity.

cd examples/three-session-bugfix && mog lint && mog graph

Cursor / Claude / Cline

mog init drops .cursor/rules/mog.mdc with boot + RAM mandate.

Works the same with CLAUDE.md, AGENTS.md, or .clinerules — point them at soul.md + active_state.md.


Comparison

MOG Mem0 / Zep Single AGENTS.md
Storage Git markdown Cloud vectors One growing file
Audit git diff Opaque Merge pain
Boot cost ~400–1.5k tokens API + retrieval Bloats forever
Best for Coding agents, solo/team repos Chatbots Tiny projects

Full comparison →


Publish checklist

git init
git add .
git commit -m "feat: MOG v1.0 — vectorless agent memory"
gh repo create TechBedouin/mog-memory --public --source=. --push
npm publish --access public

Contributing

PRs welcome. Run npm test before submitting.


License

MIT © TechBedouin


Built for agents that ship code, not chat logs.
If MOG saved your context window, ⭐ star the repo.

About

Markdown Object Graph — vectorless agent memory for Cursor & Claude. Compile state into git, boot in ~400 tokens, lint with mog. No Pinecone. No Mem0 API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors