MegaMemory

From public sources

Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer.

MCP serverCategory: MCP Servers · AI & memory · Search & knowledgeOpen sourcedata checked Oct 15, 2026

Overview

  • agentic-coding
  • ai
  • ai-agents
  • claude-code
  • code-context
  • coding-agent
  • embeddings
  • knowledge-graph
  • llm
  • mcp

Installation

Commands are shown, never run by the marketplace. Check them against the official documentation.
  • Language package registrynodejsFrom public sourcesfrom the package manifest — publication on the registry is not verified
    npm install -g megamemory

    Not verified: check that this package in the registry belongs to this project before installing.

    www.npmjs.com/package/megamemory ↗
  • Build from sourceFrom public sourcesfrom catalog metadata

    Build from source: no validated build recipe — follow the repository instructions.

    github.com/0xK3vin/MegaMemory ↗

Compatibility

Unknown means no evidence was found — not that the product is incompatible.
PlatformStatusArchitectureEvidenceConfidence
Claude (web & desktop)Unknown———
Claude CodeUnknown———
CursorUnknown———
VS CodeUnknown———
WindsurfUnknown———
ChatGPTUnknown———
Node.jsCompatible—package manifest: package.json name0.60

Releases

checked Oct 29, 2026
v1.6.2LatestMay 3, 2026Official source ↗

Files in 1.6.2

This release has no attached files.

Release history

Quality profile

algorithm quality-v1.0 · assessed Oct 15, 2026
Quality Score86
Risk Score0
Confidence 1.00
Quality Score and Risk Score are different measures. A high score does not guarantee safety.

Score components

Maintenance · 2012
last activity 166 days ago
Documentation · 1515
README 9017 chars, description present
Ready to use · 1515
install instructions: yes; releases: yes
Metadata · 108
3/4 of description, homepage, license, topics
Releases · 1010
10 release(s), latest 166 days ago
Category confidence · 1010
classifier confidence 0.97
Adoption · 107
725 stars (log-dampened, 10k = max)
License clarity · 55
SPDX MIT
Community · 55
issues enabled, 75 forks

License

MIT
Known licensefrom the repository host

This is the catalog policy status, not legal advice.

Sources

github.com/0xK3vin/MegaMemoryPrimary★ 725 starslast activity May 3, 2026Primary repository · Confidence 1.00

Reviews

Sign in to write a review

No reviews yet.

Alternatives

code-graph-ragSimilar
The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphsMIT · MCP Servers
ffmpeg-skillSimilar
Local video editor for coding agents: 42 FFmpeg tools with a machine-readable contract and an MCP server, for Claude Code, Cursor and Codex. Cut, captions, reframe, loudness, platform exports. No cloud, no API keys.MIT · MCP Servers
ECCSimilar
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.MIT · MCP Servers
crwSimilar
Fast, lightweight Firecrawl/Tavily alternative in Rust. Web scraper, crawler & search API with MCP server for AI agents. Drop-in Firecrawl-compatible API (/scrape, /crawl, /search). 2.3x faster than Tavily, 1.5x faster than Firecrawl in 1K-URL benchmarks. 6 MB RAM, single binary. Self-host or use maAGPL-3.0 · MCP Servers
hippo-memorySimilar
Stop re-teaching your agent. Make your agent's memory work like a brain. Hippo is long-term memory for coding agents. It's a critical layer for your AI harness that connects across your different tools (Cursor, Claude Code, Codex). It keeps your proprietary data completely local, and it actually leaMIT · MCP Servers
octocodeSimilar
Structural code intelligence for AI agents — semantic search, knowledge graphs, and a built-in MCP server in one Rust binary. Give Claude, Cursor, and any MCP client a deep understanding of your codebase.Apache-2.0 · MCP Servers

README

From 0xK3vin/MegaMemory · license MIT · fetched Oct 29, 2026

An MCP server that lets your coding agent build and query a graph of concepts, architecture, and decisions — so it remembers across sessions.

The LLM is the indexer. No AST parsing. No static analysis. Your agent reads code, writes concepts in its own words, and queries them before future tasks. The graph stores concepts — features, modules, patterns, decisions — not code symbols.

The Loop

understand → work → update

  1. Session start — agent calls list_roots to orient itself
  2. Before a task — agent calls understand with a natural language query (or get_concept for exact ID lookup)
  3. After a task — agent calls create_concept or update_concept to record what it built

Everything persists in a per-project SQLite database at .megamemory/knowledge.db.


Installation

npm install -g megamemory

[!NOTE] Requires Node.js >= 18. The embedding model (~23MB) downloads automatically on first use.

Quick Start

megamemory install

Run the interactive installer and choose your editor:

[!NOTE] The installer only updates config files after a successful read/merge, and it will not overwrite existing plugin/command files unless they are already marked as MegaMemory-managed.

With opencode
megamemory install --target opencode

One command configures:

  • MCP server in ~/.config/opencode/opencode.json
  • Workflow instructions in ~/.config/opencode/AGENTS.md
  • Skill tool plugin at ~/.config/opencode/tool/megamemory.ts
  • Bootstrap command /user:bootstrap-memory for initial graph population
  • Save command /user:save-memory to persist session knowledge

Restart opencode after running install.

With Claude Code
megamemory install --target claudecode

Configures:

  • MCP server in ~/.claude.json
  • Workflow instructions in ~/.claude/CLAUDE.md
  • Commands in ~/.claude/commands/
With Antigravity
megamemory install --target antigravity

Configures:

  • MCP server in ./mcp_config.json (workspace-level)
With Codex
megamemory install --target codex

Configures:

  • MCP server in ~/.codex/config.toml
  • Workflow instructions in ~/.codex/AGENTS.md
With other MCP clients

Add megamemory as a stdio MCP server. The command is just megamemory (no arguments). It reads/writes .megamemory/knowledge.db relative to the working directory, or set MEGAMEMORY_DB_PATH to override.

{
  "megamemory": {
    "type": "local",
    "command": ["megamemory"],
    "enabled": true
  }
}

MCP Tools

ToolDescription
understandSemantic search over the knowledge graph. Returns matched concepts with children, edges, and parent context.
get_conceptLook up a concept by its exact ID. Returns full context including children, edges, incoming edges, and parent.
create_conceptAdd a new concept with optional edges and file references.
update_conceptUpdate fields on an existing concept. Regenerates embeddings automatically.
linkCreate a typed relationship between two concepts.
remove_conceptSoft-delete a concept with a reason. History preserved.
list_rootsList all top-level concepts with direct children.
list_conflictsList unresolved merge conflicts grouped by merge group.
resolve_conflictResolve a merge conflict by providing verified, correct content based on the current codebase.

Concept kinds: feature · module · pattern · config · decision · component

Relationship types: connects_to · depends_on · implements · calls · configured_by

Knowledge Graph


Web Explorer

Visualize the knowledge graph in your browser:

megamemory serve
  • Nodes are colored by kind and sized by edge count
  • Dashed edges show parent-child links; solid edges show relationships
  • Click any node to inspect summary, files, and edges
  • Search supports highlight/dim filtering
  • If port 4321 is taken, you'll be prompted to pick another
megamemory serve --port 8080   # custom port

How It Works

src/
  index.ts       CLI entry + MCP server (9 tools)
  tools.ts       Tool handlers (understand, get_concept, create, update, link, remove, list_conflicts, resolve_conflict)
  db.ts          SQLite persistence (libsql, WAL mode, schema v3)
  embeddings.ts  In-process embeddings (all-MiniLM-L6-v2, 384 dims)
  merge.ts       Two-way merge engine for knowledge.db files
  merge-cli.ts   CLI handlers for merge, conflicts, resolve commands
  types.ts       TypeScript types
  cli-utils.ts   Colored output + interactive prompts
  install.ts     multi-target installer (opencode, Claude Code, Antigravity, Codex)
  web.ts         HTTP server for graph explorer
plugin/
  megamemory.ts  Opencode skill tool plugin
commands/
  bootstrap-memory.md  /user command for initial population
  save-memory.md       /user command to save session knowledge
web/
  index.html     Single-file graph visualization (d3-force + Canvas)
  • Embeddings — In-process via Xenova/all-MiniLM-L6-v2 (ONNX, quantized). No API keys, and no network calls after the first model download.
  • Storage — SQLite with WAL mode, soft-delete history, and schema migrations (currently v3).
  • Search — Brute-force cosine similarity over node embeddings; fast enough for graphs with <10k nodes.
  • Merge — Two-way merge with conflict detection by concept ID, with AI-assisted conflict resolution via MCP tools.

CLI Commands

CommandDescription
megamemoryStart the MCP stdio server
megamemory installConfigure editor/agent integration
megamemory serveLaunch the web graph explorer
megamemory mergeMerge two knowledge.db files
megamemory conflictsList unresolved merge conflicts
megamemory resolveResolve a merge conflict
megamemory --helpShow help
megamemory --versionShow version

Merging Knowledge Graphs

When branches diverge, each may update .megamemory/knowledge.db independently. Since SQLite files cannot be auto-merged by git, megamemory provides dedicated merge commands.

Merge two databases
megamemory merge main.db feature.db --into merged.db

Concepts are compared by ID: identical nodes are deduplicated, and conflicting nodes are kept as ::left/::right variants under one merge group UUID. Use --left-label and --right-label to replace default side labels with branch names.

megamemory merge main.db feature.db --into merged.db --left-label main --right-label feature-xyz
View conflicts
megamemory conflicts            # human-readable summary
megamemory conflicts --json     # machine-readable output
megamemory conflicts --db path  # specify database path
Resolve conflicts manually
megamemory resolve <merge-group-uuid> --keep left    # keep the left version
megamemory resolve <merge-group-uuid> --keep right   # keep the right version
megamemory resolve <merge-group-uuid> --keep both    # keep both as separate concepts
AI-assisted resolution

When an AI agent runs /merge, it calls list_conflicts, verifies both versions against current source files, then calls resolve_conflict with resolved: {summary, why?, file_refs?} plus a verification reason. It does not pick a side blindly; it resolves to what the codebase currently reflects.


License

MIT

Open the repository ↗