mema overview

Understand mema end to end

Core benefits, judging design, write quality, onboarding paths, and security boundaries — in one page.

Core benefits

Three things change once mema is in place

Dramatically better model results

Key facts, project conventions, and user preferences stay recallable, so the Agent guesses less and stays on track.

Dramatically lower token waste

Stop pasting the same background into every prompt. Recall only the memory that matters for the current task.

Dramatically less handoff cost

Switch windows, tools, or days. The Agent still knows who you are and where the project left off.

mini-clash · self-trained judging core

A judge for your memory — one we trained ourselves.

mema 0.17.1 replaces write-time conflict judging: instead of asking a generative model to write prose and then parsing fields out of it, a mini-clash-trained three-class classifier decides. Faster, sharper, cheaper — and it never leaves your machine.

1

We wrote the exam and trained the model

mini-clash trained from a cold start with knowledge distillation, then graded it on 462 human-adjudicated conflict pairs: argmax accuracy 0.9004; at the high-confidence gate it recalls 185 of 227 true conflicts with only 3 false alarms.

2

Discriminative, not generative

No JSON to generate, no fields to extract. It reads two raw texts and returns probabilities. Per-pair latency dropped from 0.68s to about 0.1s, and the per-write judging window grew from 10 pairs to 500 — the same write now checks 50× more candidates.

3

12 conflict mechanisms, with reasons

Beyond the three classes, a mechanism head labels why: numeric values, time/version, obligations, definitions, references, and more. You do not just learn that two facts conflict — you learn what kind of conflict it is.

4

Fully local, no network, no prompt engineering

A 1.1GB checkpoint resident on CPU in fp32. The model sees two raw texts — no metadata, no prompts, no outbound calls. Your memory never leaves the machine to be judged.

Public benchmark

LoCoMo-Refined: 65.6% text-only, second place

Official judge Qwen3-14B, all 1,382 questions, methodology and ablations fully public.

Overall Text-only
mema + writer-agent (cheapest model tier + public rules) 61.00% 65.62%
mema verbatim (zero LLM in the write path) 43.13% 49.48%
Reference: Mem0 full pipeline (re-scored by benchmark authors) 48.91% 48.91%

The write path also detected 552 semantic conflicts — no other system on the leaderboard detects conflicts at write time.

Full report & reproduction ↗
Write quality · recall precision

Remembering is not enough — it has to be clean and findable.

Most memory layers only store and search. mema gates at write time: is this new fact a conflict, a duplicate, or genuinely new? And recall does not hand you whole documents — it hands you the sentence.

Write gate · conflict

Contradictions stopped on arrival

When a new fact contradicts an existing memory, the write funnel runs deterministic screens first, then the self-trained judge returns a three-class verdict plus mechanism. Nothing is overwritten or silently dropped — you decide.

Write gate · similarity

Duplicates called out immediately

Near-duplicates, paraphrases, the same fact said a different way — a two-axis gate (subject similarity + content overlap) raises a similar_active_memory hint at write time, so parallel copies never pile up in the first place.

Recall · sentence level

Recall lands on the sentence

You get the matched sentence (or table row) as an exact source slice with start_offset/end_offset, retrievable verbatim via read(span). If merged hits cover half the record it upgrades to full text — the server never picks "the important part" for you.

Recall · multi-channel

Literal and semantic, in parallel

FTS5 full-text, subject/tag LIKE, and vector evidence recall independently, then fuse per memory with reciprocal-rank fusion, plus trust, recency, and workspace adjustments. No vectors? A degradation chain keeps recall working.

mema ecosystem

One memory core, a growing ecosystem

mema makes Agents remember — credibly. The open-source projects growing around this core make Agents work like you, plan with discipline, and collaborate with structure.

Built on mema Apache-2.0

mema-twin

Your work self, compiled into a prompt — every Agent starts the day as you.

Templates, metrics, tone, taboos: twin recognises them in your everyday output, stores them in mema, and compiles them overnight into a versioned persona prompt. Bad compile? Roll back one version — history stays, provenance stays. Plans get set before work begins, steps get checked off, and lessons feed back in, so your way of working compiles in too. Deliverables come back looking like you wrote them.

  • versioned persona
  • nightly compile
  • one-click rollback
  • playbook feedback loop
View on GitHub →
Two editions, one memory core

Personal vs Team

Same memory core. Different deployment boundaries and governance scope.

Personal

For individual developers and single Agents: local-first memory in one SQLite, so AI keeps understanding you and the project.

  • Local-first
  • Your own memory
  • Local governance

Team

For teams and companies: sharing is authorization, not copying. Team Agents inherit shared context within clear boundaries.

  • Own memory + team shared
  • owner + grant
  • Member self-service

Sharing isn't a tag — it's an authorization chain.

Why mema makes Agents stronger

Not more notes — usable, trusted, governable memory.

Plain context makes you explain everything again. Plain RAG only asks “can we find it?” mema helps Agents know what to remember, when to use it, and what wins when facts conflict.

Carry project context across sessions

Project background, decisions, preferences, and constraints survive closed windows. Agents recall long-term facts before starting the next task.

Reduce token waste

Stop pasting README fragments, chat history, and project briefs into every prompt. mema selects relevant memories first, then brings only necessary facts into context.

Every memory stays governable and traceable

Four tools cover the memory lifecycle: memory to store, memory_review to inspect, memory_govern to change authorization, memory_repair to rebuild indexes. The source text is stored once; vectors and search are rebuildable derived indexes, and every change leaves an audit trail.

Agent onboarding

Two paths, one memory core

Install locally for Personal, use a Key for Team. Any MCP-compatible client works.

Path A · Personal

Install the MCP Server locally

Install mema locally and configure the MCP Server. Any MCP-compatible client works — Claude Code, Cursor, Codex, ZCode.

  • Local SQLite; data stays on your machine
  • Works with Claude Code, Cursor, Codex, ZCode
  • Install commands live in “Get started”
Path B · Team

Call with an Agent Key

Admins create a team and invite members. Each member self-generates an Agent Key in the Team Portal, bound to their identity. The Agent calls MCP via the Key; default search scope: own memory + this team's shared memory.

  • Agent Key binds member identity
  • Default scope: own memory + team shared memory
  • Sharing uses grants, not copied team records
Honest limits

Where it can't help

Capability boundaries, written down — memory does not solve these, and we refuse to oversell it.

LIMIT_01

Not a substitute for model capability

Reasoning or coding shortfalls stay. On a hard algorithm problem, a 60-point model with memory still loses to an amnesiac 95 — everywhere outside the work you do together.

LIMIT_02

Doesn't provide tool calls

What an Agent can do depends on the tools it has. mema is one MCP tool, not the source of tools.

LIMIT_03

Doesn't manage your context

In-session context compression is the host Agent’s job; mema owns the cross-session persistence layer.

LIMIT_04

Governance needs a human now and then

Conflict rulings and expiry confirmations are deliberately left to you — not a flaw, but "knowing when to ask a human" made concrete. Nobody can honestly claim fully hands-off memory today.

Team security boundaries

Sharing isn't a tag — it's an authorization chain.

The Team edition security model rests on three principles.

owner + grant

Personal memory remains owned by the individual. Team sharing only records who is allowed to use it; once revoked, Team Agents can no longer see it.

Project labels are not permission boundaries

Projects, workspaces, and fact domains organize memory. Visibility still comes from explicit authorization, not from putting memory into a category.

Identity comes from the Agent Key

Team requests do not trust client-supplied identity or team scope. The server resolves access boundaries from the Key.

Get started

One prompt. Let your Agent install it.

Paste the task below into Codex, Claude Code, Cursor, OpenClaw, WorkBuddy, DeepSeek Harness, or another Agent with terminal access. mema supports both local stdio and HTTP MCP servers: use stdio for a single Agent and HTTP for multiple Agents.

Recommended

Copy the task and paste it into your Agent

It will detect your OS, Python environment, and current MCP client, then choose the transport for your setup: stdio for one Agent or HTTP for multiple Agents. Existing config and databases stay intact, and installation ends with a doctor check.

  1. 01Copy the install task
  2. 02Paste it into your Agent
  3. 03Review the doctor result
Install task for your Agent
Read the latest instructions at https://github.com/billy12151/memory-arbiter-mcp#install-with-your-ai-agent. Install and configure the latest mema release for my operating system and current AI client.
Confirm how many Agents I need to connect and choose the appropriate MCP transport: prefer local stdio for a single Agent and an HTTP MCP server for multiple Agents.
Preserve any existing config and database; do not overwrite or delete existing data. Ask me before choosing between materially different install modes, changing existing config, or performing any destructive or privileged action.
When finished, run mema doctor and report the install method, config path, database path, client integration, and verification result.

The Agent uses the GitHub README as its source of truth and asks before changing existing config, choosing a material install mode, or performing a sensitive action.

Installing by hand? Expand the manual commands
02

Enhanced: self-trained mDeBERTa judge

Optionally install the mdeberta extra (torch + transformers) and download the 1.1GB checkpoint to upgrade write-time conflict judging to the mini-clash-trained three-class model: three classes, 12 mechanisms, calibrated probabilities. Without it the core still works, with conflict discovery falling back to scheduled scans.

bash macOS / Linux · mdeberta judge
python3.11 -m venv .venv && source .venv/bin/activate
pip install -U pip
pip install "memory-arbiter-mcp[vec]"
pip install "memory-arbiter-mcp[mdeberta]"
# Then point semantic_conflict.mdeberta_ckpt at the downloaded 1.1GB checkpoint (configured = enabled)
# Then ask your Agent to read README first: https://github.com/billy12151/memory-arbiter-mcp#readme
03

Minimal: PyPI core install

No vector and no judge model: just the core package plus local setup. Use this to verify the MCP Server starts or for lower-performance machines.

bash macOS / Linux · PyPI minimal
python3.11 -m venv .venv && source .venv/bin/activate
pip install -U pip
pip install memory-arbiter-mcp
# Optional: run only when you need to generate MCP config
# mema setup
# Then ask your Agent to read README first: https://github.com/billy12151/memory-arbiter-mcp#readme
04

Source install: debug / extension work

Source install is now a separate last option, only for debugging, code changes, or manual dependency control.

bash macOS / Linux · Source install
git clone https://github.com/billy12151/memory-arbiter-mcp.git
cd memory-arbiter-mcp
python3.11 -m venv .venv && source .venv/bin/activate
pip install -U pip
pip install -e .
# Optional: run only when you need to generate MCP config
# mema setup
# Then ask your Agent to read README first: https://github.com/billy12151/memory-arbiter-mcp#readme

Contact: memarbiter@sina.com