MCP Hub
Back to servers

memorix

Cross-Agent Memory Bridge — Universal memory layer for AI coding agents via MCP

npm2.0k/wk
Stars
1
Updated
Feb 14, 2026

Quick Install

npx -y memorix

Memorix — Cross-Agent Memory Bridge

Universal memory layer for AI coding agents via MCP

npm version License

What is Memorix?

Memorix is a lightweight local MCP server that acts as a universal memory layer across AI coding agents. Your knowledge from Windsurf, Cursor, Claude Code, Codex, and VS Code Copilot is stored once and shared everywhere.

The Problem

  • claude-mem only serves Claude Code
  • mcp-memory-service has no cross-agent workspace sync
  • Your architecture decisions in Cursor are invisible to Claude Code
  • Bug fix knowledge in Windsurf doesn't transfer to Codex
  • No one bridges memory AND workspace configs across agents

The Solution

Memorix stores and indexes project knowledge (architecture decisions, bug fixes, code style preferences) and exposes it via MCP — so any MCP-supporting agent can access it. It also syncs MCP configs, rules, skills, and workflows across all your agents automatically.

Features

P0 — Core (Current)

  • Knowledge Graph: Entity-Relation model (MCP Official Memory Server compatible)
  • 3-Layer Progressive Disclosure: Token-efficient search (claude-mem pattern)
    • L1: Compact index (~50-100 tokens/result)
    • L2: Timeline context
    • L3: Full details on demand (~500-1000 tokens/result)
  • 9 Observation Types: 🎯🔴🟡🔵🟢🟣🟠🟤⚖️
  • Full-text Search: Powered by Orama
  • Per-project Isolation: Auto-detected via Git remote
  • MCP Compatible: All 9 official Memory Server tools + 5 Memorix extensions

P1 — Smart Search

  • Hybrid Search: Full-text (BM25) + Vector (semantic) via Orama
  • Vector Embeddings: Optional fastembed (local ONNX, zero API calls)
  • Graceful Degradation: No fastembed? Falls back to BM25 fulltext automatically
  • Token Budget: maxTokens parameter trims results to fit context windows

P2 — Cross-Agent Workspace Sync

  • 5 Agent Adapters: Windsurf, Cursor, Claude Code, Codex, VS Code Copilot
  • MCP Config Sync: Detect and migrate MCP server configs across agents (merges into existing files — never overwrites)
  • Rules Parser: 4 format adapters (Cursor .mdc, Claude Code CLAUDE.md, Codex SKILL.md, Windsurf .windsurfrules)
  • Rules Syncer: Scan → Deduplicate → Conflict detection → Cross-format generation
  • Skills Sync: Scan .codex/skills/, .cursor/skills/, .windsurf/skills/, .claude/skills/ → copy entire skill folders across agents
  • Sync Advisory: On first memorix_search, auto-detects available configs/skills from other agents and prompts the user
  • Selective Sync: Sync specific items by name (e.g. items=["figma-remote-mcp-server", "create-subagent"])
  • Apply with Safety: Backup → Atomic write → Auto-rollback on failure

P3 — Auto-Memory Hooks

  • Hook Events: user_prompt, post_response, post_edit, post_command, post_tool, session_end
  • Agent Normalizer: Maps Windsurf/Cursor/Claude Code/Codex native events to unified hook events
  • Pattern Detection: Auto-detects decisions, errors, gotchas, configurations, learnings, implementations
  • Cooldown Filtering: Prevents duplicate storage within configurable time windows
  • Noise Filtering: Skips trivial commands (ls, cat, pwd, etc.)
  • Agent Rules: Auto-installs .windsurf/rules/memorix.md (or equivalent) to guide agents in proactive memory management
  • One-Command Install: memorix hooks install sets up hooks + rules for your agent

Context Continuity

  • Session Start: Agent rules instruct AI to search memories before responding
  • During Session: Auto-capture decisions, bugs, gotchas via hooks + agent-driven memorix_store
  • Session End: Agent stores a "handoff note" summarizing progress and next steps
  • Result: Start a new session and your AI already knows everything — no re-explaining needed

P5 — Intelligence (Competitor-Inspired)

  • Access Tracking: accessCount + lastAccessedAt on every search hit (from mcp-memory-service)
  • Memory Decay: Exponential decay scoring score = importance × e^(-age/retention) × accessBoost (from mcp-memory-service)
  • Retention Lifecycle: Active → Stale → Archive-candidate with immunity rules (from MemCP)
  • Entity Extraction: Auto-extract files, modules, URLs, CamelCase identifiers from narratives (from MemCP)
  • Auto-Enrichment: memorix_store automatically enriches concepts and filesModified
  • Causal Detection: Detects "because/due to/caused by" patterns for typed relations
  • Auto-Relations: Implicit Knowledge Graph relation creation on store (causes/fixes/modifies)
  • Typed Relations: Recommended types: causes, fixes, supports, opposes, contradicts, depends_on

Quick Start

Install

npm install -g memorix

Configure in your agent

Windsurf (~/.codeium/windsurf/mcp_config.json):

{
  "mcpServers": {
    "memorix": {
      "command": "memorix",
      "args": ["serve"]
    }
  }
}

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "memorix": {
      "command": "memorix",
      "args": ["serve"]
    }
  }
}

Claude Code (~/.claude.json):

{
  "mcpServers": {
    "memorix": {
      "command": "memorix",
      "args": ["serve"]
    }
  }
}

Codex (~/.codex/config.toml):

[mcp_servers.memorix]
command = "memorix"
args = ["serve"]

VS Code Copilot (VS Code settings.json or .vscode/mcp.json):

{
  "mcp": {
    "servers": {
      "memorix": {
        "command": "memorix",
        "args": ["serve"]
      }
    }
  }
}

Available MCP Tools

Memorix Extensions (Progressive Disclosure)

ToolLayerDescriptionTokens
memorix_storeWriteStore observation with auto-enrichment
memorix_searchL1Compact index search (hybrid if fastembed)~50-100/result
memorix_timelineL2Chronological context~200/group
memorix_detailL3Full observation details~500-1000/result
memorix_retentionAnalyticsMemory decay & retention status
memorix_rules_syncRulesScan, dedup, convert rules across agents
memorix_workspace_syncWorkspaceScan/migrate MCP configs, workflows, and skills across agents

MCP Official Compatible

ToolDescription
create_entitiesCreate knowledge graph entities
create_relationsCreate relations between entities
add_observationsAdd observations to entities
delete_entitiesDelete entities (cascades relations)
delete_observationsDelete specific observations
delete_relationsDelete relations
search_nodesSearch knowledge graph
open_nodesGet entities by name
read_graphRead entire graph

Architecture

┌─────────────────────────────────────────────┐
│                 MCP Clients                  │
│ Windsurf│Cursor│Claude Code│Codex│Copilot │
└──────────────────┬──────────────────────────┘
                   │ stdio
┌──────────────────▼──────────────────────────┐
│              Memorix MCP Server              │
│                                              │
│  ┌────────────┐  ┌─────────────────────┐    │
│  │ Knowledge  │  │  Compact Engine     │    │
│  │ Graph Mgr  │  │  (3-layer search)   │    │
│  └─────┬──────┘  └──────────┬──────────┘    │
│        │                    │                │
│  ┌─────▼────────────────────▼──────────┐    │
│  │           Orama Store               │    │
│  │    (full-text + vector search)      │    │
│  └─────────────────┬──────────────────┘    │
│                    │                        │
│  ┌─────────────────▼──────────────────┐    │
│  │         Persistence Layer           │    │
│  │   (JSONL + JSON per project)        │    │
│  └─────────────────────────────────────┘    │
│                                              │
│  ┌────────────────────────────────────┐     │
│  │      Rules & Skills Syncer        │     │
│  │  Cursor│Claude Code│Codex│Windsurf│Copilot│ │
│  │  rules: scan→dedup→conflict→gen   │     │
│  │  skills: scan→copy (no convert)   │     │
│  └────────────────────────────────────┘     │
│                                              │
│  ┌────────────────────────────────────┐     │
│  │       Auto-Memory Hooks           │     │
│  │  normalize→detect→filter→store    │     │
│  │  + agent rules (context cont.)    │     │
│  └────────────────────────────────────┘     │
└──────────────────────────────────────────────┘

Tech Stack

ComponentLibrarySource
MCP Server@modelcontextprotocol/sdkOfficial SDK
Search@orama/oramaFull-text + Vector + Hybrid
Embeddingsfastembed (optional)Local ONNX, zero API calls
Token countinggpt-tokenizer
Data modelEntity-Relation-ObservationMCP Official Memory Server
Compact strategy3-layer Progressive Disclosureclaude-mem
Memory decayExponential decay + retentionmcp-memory-service + MemCP
Entity extractionRegex patternsMemCP
Rule parsinggray-matter
Buildtsup
Testvitest219 tests

Optional: Enable Vector Search

Install fastembed for hybrid (BM25 + semantic) search:

npm install fastembed

Without it, Memorix uses BM25 full-text search (already very effective for code memories). With it, queries like "authentication" will also match observations containing "login flow".

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests (219 tests)
npm test

# Type check
npm run lint

# Watch mode
npm run dev

Acknowledgements

Memorix stands on the shoulders of these excellent projects:

  • mcp-memory-service — Hybrid search, exponential decay, access tracking
  • MemCP — MAGMA 4-graph, entity extraction, retention lifecycle, token budget
  • claude-mem — 3-layer Progressive Disclosure, lifecycle hooks
  • Mem0 — Memory layer architecture patterns

License

Apache 2.0 — see LICENSE

Reviews

No reviews yet

Sign in to write a review