Mori

by fjwood69

Not rated
GitHub

About

Shared memory layer for AI coding agents with dream pipeline distillation, session grounding, and multi-instance coherence.

Details

Author
fjwood69
Categories
AI, Developer Tools, Knowledge Base

Setup

Install Mori in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/fjwood69/mori

Follow the installation instructions in the repository README, then restart your MCP client.

Mori (森) — a governed shared-memory layer for AI coding agents.

Mori gives an agent provenance-scoped memory: the decisions and patterns a human chose to keep, surfaced to every session — and only where they apply. It's the institutional memory your agents pull from, self-hosted and agent-neutral, so the knowledge outlives whichever model you're using this year.

What it doesn't do — and I tested this at length — iscontrolwhat an agent does. No memory layer can. Across a multi-model, multi-harness stress test (5,000+ runs, a dozen models), the most capable coding model broke the buildevery time; thesamemodel did the right thing, then the wrong thing, on identical input; and an agent handed a tool that flagged its own change as build-breakingread the warning and shipped the break anyway. Capability doesn't fix this, and neither does better retrieval. What holds isenforcement at a boundary the agent can't reach— and that's a separate piece of work.

📄The research behind this— the Promotion-Boundary Governance Framework: what can and can't actually be enforced on an AI coding agent, every null, every retraction.Read the whitepaper →

You're right to be sceptical of "memory systems" — most are a vector DB with a retrieval prompt bolted on. So I ran the experiments, published the nulls, and lead with the result that held up.

The failure mode mori fixes is cross-contamination.Curation decideswhat to keep;provenancedecideswhere it's valid— and across a team's many repos that's the line between a shared brain and a liability. A memory that's true in one repo, surfaced while you work another, makes the agent confidently reach for an API that doesn't exist here —retrieval interference. I reproduced it and the fix: with out-of-scope memory in the brief, agents chased phantom APIs in20/20 runs; with provenance-safe scoping (MORI_BRIEF_SCOPE, on by default),0/20— across two independent frontier-class models (Fisherp≈ 0). The memory was deliberately seeded from a prior repo, so it's a stress test of what canon-drift does over months, not a natural-incidence rate — but the mechanism is clean and model-independent.Ungated memory isn't shared memory — it's cross-contamination.

The other failure mode is obedience — and it's where mori is going, not where it is today.Provenance fixes what an agentknows; it doesn't fix what an agentdoes. In a pre-registered cross-repo benchmark, I gave frontier agents a tool to see downstream impactanda plain-language warning that a change would break a build — and they broke it anyway,15/15, across four models and three harnesses.Information without enforcement is fatal — you cannot govern an enterprise in token-space.That result is the thesis behind mori'snextlayer:governed playbooks— a deterministic, pre-compute gate that checks a repo's lockfiles against human-approved patterns and refuses an unsafe migrationbefore it runs, independent of prompt wording or model obedience.(Scope: pre-registered npm-dependency migrations; the gate is built and benchmarked,not yet a shipped product surface— I lead with what I proved, not what I hope. The full argument is thewhitepaper.)

If you run AI coding agents across multiple machines, profiles, or in a team — one focused on the API layer, another on the frontend, a third on infrastructure — you already know the problem: each instance is brilliant in isolation, but none of them know what the others decided.

Instance B doesn't know that Instance A just changed the auth contract. Instance C doesn't know that Instance B's deployment assumptions shifted. They find out the hard way, mid-task, when something breaks.

Mori gives every instance the sameshared picture. Every coding agent instance sends its session events to the shared Mori server; the dream pipeline distils those events fromall instancesinto a unified memory store, and/briefsurfaces them at the start of any session. Be clear about what that buys, though: a shared picture isvisibility, not coherence you can bank on. Surfacing what Instance A decided does not make Instance B act on it — a coding agent can read another instance's change and proceed against it anyway (I measured exactly that, 15/15). So this is real value for acooperativeteam — everyone opens a session knowing what the others changed — but it isawareness, not enforcement. Making one instance actually honour another's decision is the enforcement problem, and where it can be solved at all it's solved at the promotion boundary on the committed artifact — not by what any session was shown.

Every Mori instance is yours — deployed into your own account, never shared. Pick a path:

Fly.io (CLI):free persistent volume + SQLite, ~$3–5/mo — seeone-click-deploy.md.

Persistence note:SQLite needs a persistent disk or volume; stateless platforms (Railway, Cloud Run, Render free tier) lose data on restart without Postgres. The deploy script and guide walk through connecting a free Neon or Supabase database — the recommended $0 durable path. Codespaces are ephemeral by design — use them to evaluate Mori, then deploy to a persistent host when you're ready.

Full guide:docs/getting-started/one-click-deploy.md

brew tap fjwood69/mori brew install mori mori-setup # wizard: API key, LLM provider, start service
git clone https://github.com/fjwood69/mori.git cd mori cp deploy/homelab/.env.example deploy/homelab/.env # Edit .env: set MORI_API_KEY to your provider key (Novita, DeepInfra, OpenAI, …) # and MORI_BASE_URL to the provider's OpenAI-compatible endpoint. docker compose -f deploy/homelab/docker-compose.yml up -d
curl http://localhost:8968/health # {"status":"ok","service":"mori-advisor"}

Claude Code — install as a plugin (recommended).Inside Claude Code, run:

/plugin marketplace add fjwood69/mori /plugin install mori@mori

You'll be prompted for your Mori server URL and API key on enable (the key is stored in your OS keychain, not insettings.json). Then/reload-pluginsor restart.

The same plugin package (plugins/mori/) also targetsOpenCode,Codex,Cursor, andGoogle Antigravity— MCP connection and skills work across all five; client-specific hooks land per platform. See the platform guides.

Or use the legacy installer scripts(bespoke; superseded by the plugin):

./scripts/legacy/install-mori-claude.sh # Claude Code ./scripts/install-mori-cursor.sh # Cursor powershell -File scripts/legacy/install-mori-claude.ps1 # Windows

Full reference:docs/reference/slash-commands.md

Mori is your team'searnedmemory — not a docs cache.It remembers what your agents decided and learned across sessions and devices. It complements tools that supplylive external knowledge:

- Context7— up-to-date, version-specific library and framework documentation injected into the prompt. Where Mori remembers"we chose X, and why", Context7 supplies"here is X's current API."Different layer, complementary purpose.
- Your platform's own docs— for fast-moving tool and harness behaviour (hook schemas, config formats), consult the current official docs rather than training-data recall. See theRead the current manual, not your memorypractice in
[agent-working-practices.

Dream pipeline — the proposal half of the gate

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.