memfix
Allows memfix to use PostgreSQL as the backing database for memory storage, configured via the MEMFIX_DATABASE_URL environment variable, supporting multi-tenant namespaces and per-namespace encryption.
Provides a default embedded SQLite database backend for memfix, storing memory facts locally in ~/.memfix/memfix.db with no external service required.
memfix
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/supersedewith 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--fixtombstones 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: RE-call MCP Memory Server
Quick start
pip install memfixfrom 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 --fixHow 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 |
|
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_serverTools: memory_assert, memory_search, memory_correct, memory_retract, memory_audit.
Layout
File | Job |
| Provenance-first ledger, corrections API, search, recall logging |
| Junk detection: duplicates, contradictions, orphans, stale |
| Deterministic NL correction parsing |
| mem0 / claude-mem / JSONL migration |
| Per-namespace encryption (with |
| SQLite default, Postgres via |
|
|
| 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.
This server cannot be deployed
Related MCP Connectors
- memnodeOAuthdev.memnode
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Hosted agent memory with provenance, contradiction surfacing, and snapshot rollback.
- KogniteOAuthdev.kognite
Hosted agent memory: store, search, and recall facts across sessions from any MCP client.
Related MCP Servers
- AlicenseAqualityDmaintenanceMemory for AI agents that can't hallucinate — answers only from stored facts with a citation, or honestly abstains. Provable forgetting (GDPR), valid-time, Merkle proofs, deterministic. MCP server, CPU-only, zero dependencies.131MIT
- AlicenseAqualityAmaintenanceMCP server exposing memory search, index, and stats tools for agents, with honesty guards to prevent re-litigation of settled decisions.577 PyPI6AGPL 3.0
- AlicenseAqualityAmaintenanceAn MCP server that gives AI agents durable, temporal memory over local markdown vaults, with tools for searching, asserting facts, querying point-in-time state, and reinforcing useful knowledge.1577 npmMIT
- AlicenseAqualityAmaintenanceMCP 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.21294 npm1MIT