Skip to content
/ memorix Public

Cross-Agent Memory Bridge Universal memory layer for AI coding agents via MCP. Supports Windsurf, Cursor, Claude Code, Codex, and VS Code Copilot.

License

Notifications You must be signed in to change notification settings

AVIDS2/memorix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

35 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Memorix Logo

Memorix

Cross-Agent Memory Bridge โ€” Universal memory layer for AI coding agents via MCP

npm version npm downloads License GitHub stars Tests

Quick Start โ€ข Features โ€ข Agent Config โ€ข How It Works โ€ข Development


One project, six agents, zero context loss.

Memorix is a cross-agent memory bridge โ€” it lets Cursor, Windsurf, Claude Code, Codex, Copilot, and Antigravity share the same project knowledge in real-time. Architecture decisions made in one IDE are instantly available in another. Switch tools, open new windows, start fresh sessions โ€” your context follows you everywhere via MCP. It also syncs MCP configs, rules, skills, and workflows across all your agents automatically.


โšก Quick Start

30-Second Setup (Zero Install)

Add Memorix to your agent's MCP config โ€” that's it. No global install needed.

Windsurf โ†’ ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "memorix": {
      "command": "npx",
      "args": ["-y", "memorix@latest", "serve"]
    }
  }
}

Restart your agent and Memorix is running! ๐ŸŽ‰

๐Ÿ’ก More agent configs: Cursor โ€ข Claude Code โ€ข Codex โ€ข VS Code Copilot โ€ข Antigravity

Or Install Globally

npm install -g memorix

Then use "command": "memorix" instead of "command": "npx" in your config.


๐Ÿค” The Problem

Situation Pain
Architecture decisions in Cursor Invisible to Claude Code
Bug fix knowledge in Windsurf Doesn't transfer to Codex
MCP server configs Manually copy-paste between agents
Agent rules & skills Stuck in one IDE
Start a new session Re-explain everything from scratch

No one bridges memory AND workspace configs across agents โ€” until now.


โœจ Features

๐Ÿง  Smart Memory

  • Knowledge Graph โ€” Entity-Relation model, MCP Official Memory Server compatible
  • 9 Observation Types โ€” ๐ŸŽฏ session-request ๐Ÿ”ด gotcha ๐ŸŸก problem-solution ๐Ÿ”ต how-it-works ๐ŸŸข what-changed ๐ŸŸฃ discovery ๐ŸŸ  why-it-exists ๐ŸŸค decision โš–๏ธ trade-off
  • Auto-Enrichment โ€” Automatically extracts file paths, module names, CamelCase identifiers from your narratives
  • Auto-Relations โ€” Detects causal language ("because", "due to", "fixed by") and auto-creates typed graph relations
  • Memory Decay โ€” Exponential decay scoring with immunity rules, so old memories fade while critical ones persist forever

๐Ÿ” Token-Efficient Search

  • 3-Layer Progressive Disclosure โ€” Based on claude-mem (~10x token savings)
    • L1 memorix_search โ†’ Compact index (~50-100 tokens/result)
    • L2 memorix_timeline โ†’ Chronological context
    • L3 memorix_detail โ†’ Full details on demand (~500-1000 tokens/result)
  • Hybrid Search โ€” Full-text (BM25) + Vector (semantic) via Orama
  • Token Budget โ€” maxTokens parameter auto-trims results to fit context windows

๐Ÿ”„ Cross-Agent Workspace Sync

  • 6 Agent Adapters โ€” Windsurf, Cursor, Claude Code, Codex, VS Code Copilot, Antigravity
  • MCP Config Migration โ€” Detect and migrate MCP server configs (merges โ€” never overwrites)
  • Rules Sync โ€” Scan โ†’ Deduplicate โ†’ Conflict detection โ†’ Cross-format generation
  • Skills & Workflows โ€” Copy skill folders and workflow files across agents
  • Apply with Safety โ€” Backup .bak โ†’ Atomic write โ†’ Auto-rollback on failure

๐Ÿช Auto-Memory Hooks

  • Implicit Memory โ€” Auto-captures decisions, errors, gotchas from agent activity
  • Multi-Language Pattern Detection โ€” English + Chinese keyword matching
  • Cooldown & Noise Filtering โ€” 30s cooldown, skips trivial commands (ls, cat, pwd)
  • One-Command Install โ€” memorix hooks install sets up hooks + rules for your agent

๐Ÿ” Context Continuity

Session 1: You and AI discuss auth architecture
  โ†’ Memorix auto-stores the decision

Session 2: New chat, same project
  โ†’ AI searches Memorix โ†’ "Ah, we decided on JWT with refresh tokens"
  โ†’ No re-explaining needed!

๐Ÿ”ง Agent Configuration

Cursor

.cursor/mcp.json:

{
  "mcpServers": {
    "memorix": {
      "command": "npx",
      "args": ["-y", "memorix@latest", "serve"]
    }
  }
}

Claude Code

~/.claude.json:

{
  "mcpServers": {
    "memorix": {
      "command": "npx",
      "args": ["-y", "memorix@latest", "serve"]
    }
  }
}

Codex

~/.codex/config.toml:

[mcp_servers.memorix]
command = "npx"
args = ["-y", "memorix@latest", "serve"]

VS Code Copilot

.vscode/mcp.json or VS Code settings.json:

{
  "mcp": {
    "servers": {
      "memorix": {
        "command": "npx",
        "args": ["-y", "memorix@latest", "serve"]
      }
    }
  }
}

Antigravity

~/.gemini/antigravity/settings/mcp_config.json:

{
  "mcpServers": {
    "memorix": {
      "command": "npx",
      "args": ["-y", "memorix@latest", "serve"]
    }
  }
}

๐Ÿ›  Available MCP Tools

Memorix Extensions

Tool Purpose Token Cost
memorix_store Store observation with auto-enrichment โ€”
memorix_search L1: Compact index search ~50-100/result
memorix_timeline L2: Chronological context ~100-200/group
memorix_detail L3: Full observation details ~500-1000/result
memorix_retention Memory decay & retention status โ€”
memorix_dashboard Launch visual web dashboard in browser โ€”
memorix_rules_sync Scan/deduplicate/generate rules across agents โ€”
memorix_workspace_sync Migrate MCP configs, workflows, skills โ€”

MCP Official Compatible (Drop-in Replacement)

Tool Purpose
create_entities Create knowledge graph entities
create_relations Create relations between entities
add_observations Add observations to entities
delete_entities Delete entities (cascades relations)
delete_observations Delete specific observations
delete_relations Delete relations
search_nodes Search knowledge graph
open_nodes Get entities by name
read_graph Read entire graph

๐Ÿงฉ How It Works

Data Flow

Agent โ”€โ”€memorix_storeโ”€โ”€โ–ถ Entity Extractor โ”€โ”€โ–ถ Auto-Relations โ”€โ”€โ–ถ Knowledge Graph
                         โ”‚                                        โ”‚
                         โ–ผ                                        โ”‚
                     Orama Index โ—€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Persistence Layer โ—€โ”€โ”€โ”€โ”˜
                     (BM25 + Vector)        (~/.memorix/data/<project>/)
                         โ”‚
Agent โ—€โ”€โ”€memorix_searchโ”€โ”€โ”˜  L1: Compact Index (~50-100 tokens)
Agent โ—€โ”€โ”€memorix_timelineโ”€  L2: Timeline Context
Agent โ—€โ”€โ”€memorix_detailโ”€โ”€โ”€  L3: Full Details (~500-1000 tokens)

Progressive Disclosure Example

๐Ÿ” Agent calls memorix_search("auth bug")

๐Ÿ“‹ L1 Response (compact โ€” agent scans IDs):
| ID  | Time    | T  | Title                    | Tokens |
|-----|---------|-----|--------------------------|--------|
| #42 | 2:14 PM | ๐ŸŸก | Fixed JWT refresh timeout | ~155   |
| #38 | 1:30 PM | ๐Ÿ”ต | How JWT refresh works     | ~220   |

๐Ÿ”Ž Agent calls memorix_detail([42])

๐Ÿ“„ L3 Response (full content):
# Observation #42 โ€” Fixed JWT refresh timeout
Type: ๐ŸŸก problem-solution | Entity: auth-module
Narrative: The JWT refresh token was timing out after 15 minutes
because the expiry was hardcoded. Fixed by reading from env...
Facts: ["Default timeout: 60s", "Fix: use REFRESH_TTL env var"]
Files: ["src/auth/jwt.ts", "src/config.ts"]

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    AI Coding Agents                           โ”‚
โ”‚  Windsurf โ”‚ Cursor โ”‚ Claude Code โ”‚ Codex โ”‚ Copilot โ”‚ Antigravity
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚ MCP Protocol (stdio)
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                 Memorix MCP Server (17 tools)                โ”‚
โ”‚                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚   Memory     โ”‚  โ”‚   Compact    โ”‚  โ”‚  Workspace Sync  โ”‚   โ”‚
โ”‚  โ”‚   Layer      โ”‚  โ”‚   Engine     โ”‚  โ”‚  (6 adapters)    โ”‚   โ”‚
โ”‚  โ”‚             โ”‚  โ”‚  (3-layer)   โ”‚  โ”‚                  โ”‚   โ”‚
โ”‚  โ”‚ โ€ข Graph     โ”‚  โ”‚              โ”‚  โ”‚ โ€ข MCP Configs    โ”‚   โ”‚
โ”‚  โ”‚ โ€ข Retention โ”‚  โ”‚              โ”‚  โ”‚ โ€ข Rules          โ”‚   โ”‚
โ”‚  โ”‚ โ€ข Entities  โ”‚  โ”‚              โ”‚  โ”‚ โ€ข Skills         โ”‚   โ”‚
โ”‚  โ”‚ โ€ข Relations โ”‚  โ”‚              โ”‚  โ”‚ โ€ข Workflows      โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚         โ”‚                โ”‚                                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Orama Store (BM25 + Vector) โ”‚ Persistence (JSONL)    โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Hooks System: Normalizer โ†’ Pattern Detector โ†’ Store  โ”‚  โ”‚
โ”‚  โ”‚  (Auto-captures decisions, bugs, gotchas from agents) โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”ฎ Optional: Vector Search

Install fastembed for hybrid (BM25 + semantic) search:

npm install -g fastembed
  • Without it โ€” BM25 full-text search (already very effective for code)
  • With it โ€” Queries like "authentication" also match "login flow" via semantic similarity
  • Local ONNX inference, zero API calls, zero privacy risk

๐Ÿ’พ Data Storage

All data is stored locally per project:

~/.memorix/data/<projectId>/
โ”œโ”€โ”€ observations.json      # Structured observations
โ”œโ”€โ”€ id-counter.txt         # Next observation ID
โ”œโ”€โ”€ entities.jsonl         # Knowledge graph nodes (MCP compatible)
โ””โ”€โ”€ relations.jsonl        # Knowledge graph edges (MCP compatible)
  • projectId is auto-detected from Git remote URL (e.g., user/repo)
  • Data is shared across all agents (same directory)
  • No cloud, no API keys, no external services

๐Ÿง‘โ€๐Ÿ’ป Development

git clone https://github.com/AVIDS2/memorix.git
cd memorix
npm install

npm run dev          # tsup watch mode
npm test             # vitest (274 tests)
npm run lint         # TypeScript type check
npm run build        # Production build

Project Structure

src/
โ”œโ”€โ”€ server.ts              # MCP Server entry (17 tools)
โ”œโ”€โ”€ types.ts               # All type definitions
โ”œโ”€โ”€ memory/                # Graph, observations, retention, entity extraction
โ”œโ”€โ”€ store/                 # Orama search engine + disk persistence
โ”œโ”€โ”€ compact/               # 3-layer Progressive Disclosure engine
โ”œโ”€โ”€ embedding/             # Optional fastembed vector provider
โ”œโ”€โ”€ hooks/                 # Auto-memory hooks (normalizer + pattern detector)
โ”œโ”€โ”€ workspace/             # Cross-agent MCP/workflow/skills sync
โ”œโ”€โ”€ rules/                 # Cross-agent rules sync (6 adapters)
โ”œโ”€โ”€ dashboard/             # Visual web dashboard (knowledge graph, stats)
โ”œโ”€โ”€ project/               # Git-based project detection
โ””โ”€โ”€ cli/                   # CLI commands (serve, hook, sync, dashboard)

๐Ÿ“š Full documentation available in docs/ โ€” architecture, modules, API reference, design decisions, and more.


๐Ÿ™ 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
  • claude-mem โ€” 3-layer Progressive Disclosure
  • Mem0 โ€” Memory layer architecture patterns

๐Ÿ“„ License

Apache 2.0 โ€” see LICENSE


Made with โค๏ธ by AVIDS2
If Memorix helps your workflow, consider giving it a โญ on GitHub!

About

Cross-Agent Memory Bridge Universal memory layer for AI coding agents via MCP. Supports Windsurf, Cursor, Claude Code, Codex, and VS Code Copilot.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published