Cross-Agent Memory Bridge โ Universal memory layer for AI coding agents via MCP
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.
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
npm install -g memorixThen use "command": "memorix" instead of "command": "npx" in your config.
| 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.
- 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
- 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)
- L1
- Hybrid Search โ Full-text (BM25) + Vector (semantic) via Orama
- Token Budget โ
maxTokensparameter auto-trims results to fit context windows
- 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
- 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 installsets up hooks + rules for your agent
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!
.cursor/mcp.json:
{
"mcpServers": {
"memorix": {
"command": "npx",
"args": ["-y", "memorix@latest", "serve"]
}
}
}~/.claude.json:
{
"mcpServers": {
"memorix": {
"command": "npx",
"args": ["-y", "memorix@latest", "serve"]
}
}
}~/.codex/config.toml:
[mcp_servers.memorix]
command = "npx"
args = ["-y", "memorix@latest", "serve"].vscode/mcp.json or VS Code settings.json:
{
"mcp": {
"servers": {
"memorix": {
"command": "npx",
"args": ["-y", "memorix@latest", "serve"]
}
}
}
}~/.gemini/antigravity/settings/mcp_config.json:
{
"mcpServers": {
"memorix": {
"command": "npx",
"args": ["-y", "memorix@latest", "serve"]
}
}
}| 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 | โ |
| 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 |
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)
๐ 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"]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
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
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)
projectIdis 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
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 buildsrc/
โโโ 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.
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
Apache 2.0 โ see LICENSE
Made with โค๏ธ by AVIDS2
If Memorix helps your workflow, consider giving it a โญ on GitHub!
