Skip to main content
Glama

memfix

License: MIT Python 3.10+

The memory layer that can be corrected.

Agent memory leaders store facts they cannot update, cannot source, and cannot delete. A community audit of 10,134 mem0 entries found 97.8% junk, produced by the architecture: no provenance (once a fact is extracted, the link to the source conversation is severed), no UPDATE path (contradictions are stored forever), and unmeasured recall.

memfix is provenance-first memory: every fact is a versioned claim with a source pointer, timestamps, and supersession links. Corrections are real operations, not wishes. Nothing is ever hard-deleted.

  • Provenance on every fact — conversation/run ID, turn, origin. The severed link, fixed.

  • Real corrections API — assert / retract / supersede with tombstones. "Forget that I prefer tea" compiles to a deterministic invalidation.

  • Contradiction detection — the materialized current-truth view flags facts that disagree, instead of storing both forever.

  • Recall instrumentation — every injection is logged (what, tokens, which query). The metric nobody measures, measured.

  • memfix audit: the wedge — point it at a memory store and get the junk report: duplicates, contradictions, orphans, stale facts. Then --fix tombstones them.

  • Migration importers — pull in mem0, claude-mem, or JSONL stores, then audit their junk on your machine.

  • Namespaces + per-tenant encryption — multi-agent isolation; SQLite by default, Postgres via MEMFIX_DATABASE_URL.

  • MCP server — memory tools for any agent host.

The audit

$ memfix import --format mem0 ./mem0-export.json
imported 10134 facts from ./mem0-export.json (format mem0)

$ memfix audit
audited 10134 active facts in namespace 'default'
junk: 9911 (97.8%)
  contradiction: 312
  duplicate: 4210
  orphan: 5389

$ memfix audit --fix --yes
fixed: {"duplicates": 4210, "orphans": 5389, "stale": 0, "contradictions_flagged": 312}

Contradictions are flagged, never auto-fixed. Picking the true fact needs a human or a newer assertion.

Related MCP server: loreweave

Quick start

pip install memfix
from memfix import Memory

mem = Memory()  # ~/.memfix/memfix.db

fid = mem.assert_fact("the user prefers tea",
                      source={"conversation_id": "c1", "turn": 4})

mem.search("what does the user like to drink")
# [{'id': 'mem_...', 'fact': 'the user prefers tea'}]

# the user changes their mind: no duplicate, no contradiction stored forever
mem.supersede(fid, "the user prefers coffee", reason="user corrected")

# natural language, deterministic result
mem.correct_nl("forget that I prefer coffee")

# every recall is instrumented
mem.stats()
# {'active': 0, 'retracted': 1, 'superseded': 1, 'recalls': 2, 'tokens_injected': 14, ...}
memfix add "the deploy key expires Friday" --source run-42
memfix search "deploy key"
memfix correct "forget about the deploy key"
memfix history --id mem_9f3a...
memfix audit --fix

How it compares

mem0

claude-mem

hindsight

memfix

Provenance (source pointer per fact)

No

Partial

No

Yes

Real UPDATE / corrections API

No (ADD-only v2)

No

Delete is a no-op

assert / retract / supersede

Tombstones (nothing hard-deleted)

No

No

No

Yes

Contradiction detection

No

No

No

Yes

One-command junk audit

No

No

No

memfix audit

Recall instrumentation

No

No

No

Yes

Importers from rivals

n/a

n/a

n/a

mem0 / claude-mem / JSONL

Per-tenant namespaces

Broken (#4126)

Manual merges

ID collisions

Yes

MCP server

memfix-mcp  # or: python -m memfix.mcp_server

Tools: memory_assert, memory_search, memory_correct, memory_retract, memory_audit.

Layout

File

Job

memfix/ledger.py

Provenance-first ledger, corrections API, search, recall logging

memfix/audit.py

Junk detection: duplicates, contradictions, orphans, stale

memfix/corrections.py

Deterministic NL correction parsing

memfix/importers.py

mem0 / claude-mem / JSONL migration

memfix/crypto.py

Per-namespace encryption (with MEMFIX_MASTER_KEY)

memfix/db.py

SQLite default, Postgres via MEMFIX_DATABASE_URL

memfix/cli.py

add search get retract supersede correct history stats audit import

memfix/mcp_server.py

MCP server for any agent host

Set MEMFIX_MASTER_KEY to encrypt fact payloads per namespace. Set MEMFIX_DATABASE_URL=postgresql://... for Postgres.

MIT licensed. Not affiliated with mem0, Anthropic, or hindsight.

Available Tools

5 tools
memory_assertC

Store a fact with provenance. Returns the fact id.

NameRequiredDescriptionDefault
factYes
sourceNo
namespaceNodefault

Output Schema

NameRequiredDescription
resultYes

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations at all, the description bears full behavioral burden and does not carry it: it never says whether duplicates are deduplicated, whether an assert on an existing fact overwrites or errors, whether it is idempotent, or what provenance means operationally. Only the return value is disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, front-loaded with the action and ending with the return value; nothing is padded. The terseness is efficient, though it reflects under-specification rather than disciplined editing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema covers the return value, but for a mutation tool with three 0%-documented parameters and zero annotations, the description omits too much: write behavior, idempotency, namespace semantics, and relationship to the correct/retract siblings are all missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so all three parameters (fact, source, namespace) are undocumented in the schema. The description hints that "provenance" maps to source, but never explains the fact format or what namespace scopes or defaults to, leaving the caller to guess.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Store a fact with provenance" gives a specific verb and resource, and "Returns the fact id" sets expectations. It implicitly separates the tool from memory_search and memory_retract, but never names a sibling or states the write semantics explicitly, so it stops short of full differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to assert versus when to use memory_correct or memory_retract, and no mention of preconditions or ordering (e.g. search first to avoid duplicates). The agent must infer all routing from the tool names.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_auditC

Junk report: duplicates, contradictions, orphans, stale facts.

NameRequiredDescriptionDefault
namespaceNodefault

Output Schema

NameRequiredDescription
resultYes

TDQS

C2.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It implies a report (non-destructive detection) rather than mutation, which is useful, but it says nothing about whether detected junk is altered, what permissions are needed, scope of cost/latency, or whether results are paginated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is short, but this is under-specification rather than conciseness: a single noun-phrase fragment with no front-loaded statement of action, scope, or result. Nothing is wasted, but very little is delivered.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, but for a no-annotation tool the description should cover the namespace scope and the read-only/non-destructive nature of the audit. Both are absent, leaving the definition too thin to call confidently.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for the single 'namespace' parameter, and the description never mentions namespace at all. Its only clue is the default 'default', so the agent gets no meaning, format, or scoping guidance for the one input it must supply.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The fragment 'Junk report: duplicates, contradictions, orphans, stale facts' tells an agent this surfaces memory quality defects, which distinguishes it from the mutating siblings memory_correct/memory_retract and from memory_search. But there is no verb and no explicit statement that this is an audit/diagnostic read, so the purpose is inferred rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use guidance, no mention of alternatives, and no prerequisites. The agent must guess whether this runs before or after corrections, and nothing routes it against memory_search or the correction tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_correctC

Natural-language correction, e.g. 'forget that I prefer tea'.

NameRequiredDescriptionDefault
namespaceNodefault
instructionYes

Output Schema

NameRequiredDescription
resultYes

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are supplied, so the description carries the full burden. It never states whether the correction is destructive, irreversible, requires confirmation, or what happens to conflicting existing memories; the 'forget' example only weakly implies removal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single short sentence with the core purpose front-loaded and no filler. It is efficient, though the fragmentary phrasing provides no structure beyond the one example.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need not be described, but for a mutation tool with no annotations the definition is thin: no safety/irreversibility notes, no sibling routing, and an unexplained namespace default. More is needed for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. The example ('forget that I prefer tea') usefully illustrates the expected natural-language form of the required instruction parameter, but the namespace parameter is left completely unexplained in both schema and description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a recognizable verb+resource ('correction' of memory) and gives a concrete example, so the agent knows roughly what it does. However, it does not differentiate from the close sibling memory_retract, which plausibly also removes/alters memory, leaving the boundary ambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement of when to use this tool versus memory_retract, memory_assert, or memory_search. The example hints at a removal-style correction but no exclusions or selection criteria are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_retractB

Tombstone a fact. It is never hard-deleted.

NameRequiredDescriptionDefault
reasonNo
fact_idYes
namespaceNodefault

Output Schema

NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose one genuinely important trait: this is a soft delete ('never hard-deleted'), which tells the agent the record is retained and searchable state may change rather than data vanishing. However, it says nothing about permissions, reversibility/undo, or effects on existing references, leaving substantial behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no filler, with the core operation stated first and the retention guarantee second. Nothing wastes the agent's attention.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained. Still, for a mutation tool with zero annotations and no parameter documentation, the description is thin — it does not say what a tombstoned fact does to future searches or whether the retraction can be reversed, both of which materially affect how an agent uses it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description would need to compensate for all three undocumented parameters. It does not: 'reason' and 'namespace' carry no explanation of format, expected values, or whether reason is required for audit purposes, and only fact_id is self-evident from its name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

'Tombstone a fact' gives a specific verb and resource, and 'tombstone' is a precise technical term that distinguishes this from memory_search or memory_assert. It does not explicitly contrast itself with the closest sibling, memory_correct, so an agent must infer the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description offers no when-to-use guidance and never mentions the alternatives (memory_correct, memory_assert) that an agent would weigh against it. A reader cannot tell from this text whether retraction is preferable to correction in a given situation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observedmemory_assert
    • First observedmemory_audit
    • First observedmemory_correct
    • First observedmemory_retract
    • First observedmemory_search

TDQS

B3.1/5.0

Scored across 5 tools

Disambiguation4/5

Each tool targets a distinct action on memory facts: search reads, assert creates, retract tombstones, audit reports quality, correct applies natural-language fixes. The only mild overlap is between memory_correct and memory_retract, since a natural-language correction may imply a retraction, but the descriptions distinguish them (NL correction vs. explicit tombstone).

Naming Consistency5/5

All five tools use a consistent memory_verb snake_case pattern with clear, distinct verbs. No mixing of conventions or verb styles.

Tool Count5/5

Five tools is well-scoped for a memory/fact-management server, covering the essential lifecycle operations without redundancy or bloat. Each tool earns its place.

Completeness4/5

The surface covers create (assert), read (search), update/delete (correct, retract), and quality (audit), which is solid lifecycle coverage. A direct fetch-by-id or explicit fact update tool is missing, though assert returning an id partially mitigates this.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    MCP server that gives coding agents persistent, verified memory of codebase decisions, conventions, and skills, with evidence-based claims that are re-checked via git hooks and human-gated review. Enables memory search, propose/approve, chat harvesting, and critique across MCP-compatible tools.
    21
    112 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server for coding agents that stores facts in HydraDB, links them to entities, detects revisions, and propagates trust decay through provenance. It provides scoped recall with transparent scoring and abstains when evidence is missing.
    1
    MIT