Skip to content
/ memorix Public

Cross-Agent Memory Bridge Persistent memory for AI coding agents across Cursor, Windsurf, Claude Code, Codex, Copilot, Kiro via MCP. Never re-explain your project again.

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

76 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Memorix Logo

Memorix

Cross-Agent Memory Bridge โ€” Your AI never forgets again

ไธญๆ–‡ๆ–‡ๆกฃ | English

npm version npm downloads License GitHub stars Tests

Cursor Windsurf Claude Code Codex Copilot Kiro Antigravity

Why โ€ข Quick Start โ€ข Scenarios โ€ข Features โ€ข Compare โ€ข Full Setup Guide


๐Ÿ˜ค Stop Re-Explaining Your Project

Your AI assistant forgets everything when you start a new chat. You spend 10 minutes re-explaining your architecture. Again. And if you switch from Cursor to Claude Code? Everything is gone. Again.

Without Memorix With Memorix
Session 2: "What's our tech stack?" Session 2: "I remember โ€” Next.js with Prisma and tRPC. What should we build next?"
Switch IDE: All context lost Switch IDE: Context follows you instantly
New team member's AI: Starts from zero New team member's AI: Already knows the codebase
After 50 tool calls: Context explodes, restart needed After restart: Picks up right where you left off
MCP configs: Copy-paste between 7 IDEs manually MCP configs: One command syncs everything

Memorix solves all of this. One MCP server. Seven agents. Zero context loss.


โšก Get Started in 30 Seconds

Add this to your agent's MCP config file, restart โ€” done:

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

๐Ÿ“– Where is my config file? โ†’ Full setup guide for all 7 agents Windsurf โ€ข Cursor โ€ข Claude Code โ€ข Codex โ€ข VS Code Copilot โ€ข Kiro โ€ข Antigravity

That's it. No API keys. No cloud accounts. No dependencies. Just works.

โš ๏ธ Antigravity users: extra config required

Antigravity sets its working directory to its own install path (e.g., G:\Antigravity) instead of your project directory, and does not support the MCP roots protocol. You must add MEMORIX_PROJECT_ROOT:

{
  "mcpServers": {
    "memorix": {
      "command": "npx",
      "args": ["-y", "memorix@latest", "serve"],
      "env": {
        "MEMORIX_PROJECT_ROOT": "E:/your/project/path"
      }
    }
  }
}

You'll need to update MEMORIX_PROJECT_ROOT when switching projects. All other IDEs work without this.


๐ŸŽฌ Real-World Scenarios

Scenario 1: Cross-Session Memory

Monday morning โ€” You and Cursor discuss auth architecture:
  You: "Let's use JWT with refresh tokens, 15-minute expiry"
  โ†’ Memorix auto-stores this as a ๐ŸŸค decision

Tuesday โ€” New Cursor session:
  You: "Add the login endpoint"
  โ†’ AI calls memorix_search("auth") โ†’ finds Monday's decision
  โ†’ "Got it, I'll implement JWT with 15-min refresh tokens as we decided"
  โ†’ Zero re-explaining!

Scenario 2: Cross-Agent Collaboration

You use Windsurf for backend, Claude Code for reviews:

  Windsurf: You fix a tricky race condition in the payment module
  โ†’ Memorix stores it as a ๐ŸŸก problem-solution with the fix details

  Claude Code: "Review the payment module"
  โ†’ AI calls memorix_search("payment") โ†’ finds the race condition fix
  โ†’ "I see there was a recent race condition fix. Let me verify it's correct..."
  โ†’ Knowledge transfers seamlessly between agents!

Scenario 3: Gotcha Prevention

Week 1: You hit a painful Windows path separator bug
  โ†’ Memorix stores it as a ๐Ÿ”ด gotcha: "Use path.join(), never string concat"

Week 3: AI is about to write `baseDir + '/' + filename`
  โ†’ Session-start hook injected the gotcha into context
  โ†’ AI writes `path.join(baseDir, filename)` instead
  โ†’ Bug prevented before it happened!

Scenario 4: Workspace Sync Across IDEs

You have 12 MCP servers configured in Cursor.
Now you want to try Kiro.

  You: "Sync my workspace to Kiro"
  โ†’ memorix_workspace_sync scans Cursor's MCP configs
  โ†’ Generates Kiro-compatible .kiro/settings/mcp.json
  โ†’ Also syncs your rules, skills, and workflows
  โ†’ Kiro is ready in seconds, not hours!

Scenario 5: Auto-Generated Project Skills

After 2 weeks of development, you have 50+ observations:
  - 8 gotchas about Windows path issues
  - 5 decisions about the auth module
  - 3 problem-solutions for database migrations

  You: "Generate project skills"
  โ†’ memorix_skills clusters observations by entity
  โ†’ Auto-generates SKILL.md files:
    - "auth-module-guide.md" โ€” JWT setup, refresh flow, common pitfalls
    - "database-migrations.md" โ€” Prisma patterns, rollback strategies
  โ†’ Syncs skills to any agent: Cursor, Claude Code, Kiro...
  โ†’ New team members' AI instantly knows your project's patterns!

Scenario 6: Session Lifecycle (v0.8.0)

Morning โ€” Start a new session in Windsurf:
  โ†’ memorix_session_start auto-injects:
    ๐Ÿ“‹ Previous Session: "Implemented JWT auth middleware"
    ๐Ÿ”ด JWT tokens expire silently (gotcha)
    ๐ŸŸค Use Docker for deployment (decision)
  โ†’ AI instantly knows what you did yesterday!

Evening โ€” End the session:
  โ†’ memorix_session_end saves structured summary
  โ†’ Next session (any agent!) gets this context automatically

Scenario 7: Topic Key Upsert โ€” No More Duplicates (v0.8.0)

You update your architecture decision 3 times over a week:

  Day 1: memorix_store(topicKey="architecture/auth-model", ...)
  โ†’ Creates observation #42 (rev 1)

  Day 3: memorix_store(topicKey="architecture/auth-model", ...)
  โ†’ Updates #42 in-place (rev 2) โ€” NOT a new #43!

  Day 5: memorix_store(topicKey="architecture/auth-model", ...)
  โ†’ Updates #42 again (rev 3)

  Result: 1 observation with latest content, not 3 duplicates!

๐Ÿง  What Memorix Can Do

Smart Memory (24 MCP Tools)

What You Say What Memorix Does
"Remember this architecture decision" memorix_store โ€” Classifies as ๐ŸŸค decision, extracts entities, creates graph relations, auto-associates session
"What did we decide about auth?" memorix_search โ†’ memorix_detail โ€” 3-layer progressive disclosure, ~10x token savings
"What auth decisions last week?" memorix_search with since/until โ€” Temporal queries with date range filtering
"What happened around that bug fix?" memorix_timeline โ€” Shows chronological context before/after
"Show me the knowledge graph" memorix_dashboard โ€” Opens interactive web UI with D3.js graph + sessions panel
"Which memories are getting stale?" memorix_retention โ€” Exponential decay scores, identifies archive candidates
"Start a new session" memorix_session_start โ€” Tracks session lifecycle, auto-injects previous session summaries + key memories
"End this session" memorix_session_end โ€” Saves structured summary (Goal/Discoveries/Accomplished/Files) for next session
"What did we do last session?" memorix_session_context โ€” Retrieves session history and key observations
"Suggest a topic key for this" memorix_suggest_topic_key โ€” Generates stable keys for deduplication (e.g. architecture/auth-model)
"Clean up duplicate memories" memorix_consolidate โ€” Find & merge similar observations by text similarity, preserving all facts
"Export this project's memories" memorix_export โ€” JSON (importable) or Markdown (human-readable for PRs/docs)
"Import memories from teammate" memorix_import โ€” Restore from JSON export, re-assigns IDs, deduplicates by topicKey

Cross-Agent Workspace Sync

What You Say What Memorix Does
"Sync my MCP servers to Kiro" memorix_workspace_sync โ€” Migrates configs, merges (never overwrites)
"Check my agent rules" memorix_rules_sync โ€” Scans 7 agents, deduplicates, detects conflicts
"Generate rules for Cursor" memorix_rules_sync โ€” Cross-format conversion (.mdc โ†” CLAUDE.md โ†” .kiro/steering/)
"Generate project skills" memorix_skills โ€” Creates SKILL.md from observation patterns
"Inject the auth skill" memorix_skills โ€” Returns skill content directly into agent context

Knowledge Graph (MCP Official Compatible)

Tool What It Does
create_entities Build your project's knowledge graph
create_relations Connect entities with typed edges (causes, fixes, depends_on)
add_observations Attach observations to entities
search_nodes / open_nodes Query the graph
read_graph Export full graph for visualization

Drop-in compatible with MCP Official Memory Server โ€” same API, more features.

9 Observation Types

Every memory is classified for intelligent retrieval:

Icon Type When To Use
๐ŸŽฏ session-request Original task/goal for this session
๐Ÿ”ด gotcha Critical pitfall โ€” "Never do X because Y"
๐ŸŸก problem-solution Bug fix with root cause and solution
๐Ÿ”ต how-it-works Technical explanation of a system
๐ŸŸข what-changed Code/config change record
๐ŸŸฃ discovery New insight or finding
๐ŸŸ  why-it-exists Rationale behind a design choice
๐ŸŸค decision Architecture/design decision
โš–๏ธ trade-off Compromise with pros/cons

Visual Dashboard

Run memorix_dashboard to open a web UI at http://localhost:3210:

  • Interactive Knowledge Graph โ€” D3.js force-directed visualization of entities and relations
  • Observation Browser โ€” Filter by type, search with highlighting, expand/collapse details
  • Retention Panel โ€” See which memories are active, stale, or candidates for archival
  • Project Switcher โ€” View any project's data without switching IDEs
  • Batch Cleanup โ€” Auto-detect and bulk-delete low-quality observations
  • Light/Dark Theme โ€” Premium glassmorphism design, bilingual (EN/ไธญๆ–‡)

Auto-Memory Hooks

Memorix can automatically capture decisions, errors, and gotchas from your coding sessions:

memorix hooks install    # One-command setup
  • Implicit Memory โ€” Detects patterns like "I decided to...", "The bug was caused by...", "Never use X"
  • Session Start Injection โ€” Loads recent high-value memories into agent context automatically
  • Multi-Language โ€” English + Chinese keyword matching
  • Smart Filtering โ€” 30s cooldown, skips trivial commands (ls, cat, pwd)

๐Ÿ“Š Comparison with Alternatives

Mem0 mcp-memory-service claude-mem Memorix
Agents supported SDK-based 13+ (MCP) Claude Code only 7 IDEs (MCP)
Cross-agent sync No No No Yes (configs, rules, skills, workflows)
Rules sync No No No Yes (7 formats)
Skills engine No No No Yes (auto-generated from memory)
Knowledge graph No Yes No Yes (MCP Official compatible)
Hybrid search No Yes No Yes (BM25 + vector)
Token-efficient No No Yes (3-layer) Yes (3-layer progressive disclosure)
Auto-memory hooks No No Yes Yes (multi-language)
Memory decay No Yes No Yes (exponential + immunity)
Visual dashboard Cloud UI Yes No Yes (web UI + D3.js graph)
Privacy Cloud Local Local 100% Local
Cost Per-call API $0 $0 $0
Install pip install pip install Built into Claude npx memorix serve

Memorix is the only tool that bridges memory AND workspace across agents.


๐Ÿ”ฎ Optional: Vector Search

Out of the box, Memorix uses BM25 full-text search (already great for code). Add semantic search with one command:

# Option A: Native speed (recommended)
npm install -g fastembed

# Option B: Universal compatibility
npm install -g @huggingface/transformers

With vector search, queries like "authentication" also match memories about "login flow" via semantic similarity. Both run 100% locally โ€” zero API calls, zero cost.


๐Ÿ”’ Project Isolation

  • Auto-detected โ€” Project identity from git remote URL, zero config needed
  • MCP roots fallback โ€” If cwd is not a project (e.g., Antigravity), Memorix tries the MCP roots protocol to get your workspace path from the IDE
  • Per-project storage โ€” ~/.memorix/data/<owner--repo>/ per project
  • Scoped search โ€” Defaults to current project; scope: "global" to search all
  • Zero cross-contamination โ€” Project A's decisions never leak into project B

Detection priority: --cwd โ†’ MEMORIX_PROJECT_ROOT โ†’ INIT_CWD โ†’ process.cwd() โ†’ MCP roots โ†’ error


โ“ Frequently Asked Questions

How do I keep context when switching between Cursor and Claude Code? Install Memorix in both IDEs. They share the same local memory directory โ€” architecture decisions made in Cursor are instantly searchable in Claude Code. No cloud sync needed.

How do I prevent my AI from forgetting previous sessions? Use memorix_session_start at the beginning of each session โ€” it automatically injects previous session summaries and key observations (gotchas, decisions, discoveries). Use memorix_session_end to save a structured summary before leaving. All observations persist on disk and are searchable via memorix_search anytime.

How do I sync MCP server configs between IDEs? Run memorix_workspace_sync with action "migrate" and your target IDE. It scans source configs and generates compatible configs for the target โ€” merges, never overwrites.

How do I migrate from Cursor to Windsurf / Kiro / Claude Code? Memorix workspace sync migrates MCP configs, agent rules (.mdc โ†” CLAUDE.md โ†” .kiro/steering/), skills, and workflows. One command, seconds to complete.

Is there an MCP server for persistent AI coding memory? Yes โ€” Memorix is a cross-agent memory MCP server supporting 7 IDEs with knowledge graph, 3-layer progressive disclosure search, workspace sync, and auto-generated project skills.

How is this different from mcp-memory-service? Both are great memory servers. Memorix adds: cross-agent workspace sync (MCP configs, rules, skills), auto-generated project skills from memory patterns, 3-layer token-efficient search, and session-start memory injection hooks.

Does it work offline / locally? Yes, 100%. All data stored in ~/.memorix/data/. No cloud, no API keys, no external services. Optional vector search also runs locally via ONNX/WASM.

๐Ÿ“– For AI systems: see llms.txt and llms-full.txt for machine-readable project documentation.


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

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

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

๐Ÿ“š Documentation: Architecture โ€ข API Reference โ€ข Modules โ€ข Design Decisions โ€ข Setup Guide โ€ข Known Issues


๐Ÿ™ 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!