# MegaMemory

> Persistent project knowledge for coding agents.

- **URL**: https://followmcp.com/en/servers/megamemory
- **Category**: Dev Tools
- **Origin**: Community
- **Stars**: 929
- **FMRS Score**: 44/100 (Grade D)
- **Source**: https://github.com/0xK3vin/MegaMemory
- **Transports**: stdio (local process)
- **Runtimes**: Node.js 18+
- **Auth**: No credential needed

## Overview
MegaMemory is an MCP server that helps coding agents build and query a project knowledge graph of concepts, architecture, and decisions across sessions. It stores data in SQLite and provides semantic search and a browser-based graph explorer.

## Best for
- Projects where coding agents need to retain context across sessions.
- Developers or teams using an MCP-capable coding environment who want to maintain a project knowledge graph.

## Not for
- Use cases that require indexing code symbols through AST parsing or static analysis; the README says concepts are written by the agent rather than generated through those methods.
- Large graphs that require a stated performance guarantee; the README describes brute-force cosine similarity search as fast enough for graphs with fewer than 10,000 nodes.

## Required permissions
- Needs to read and write `.megamemory/knowledge.db` in the working directory; `MEGAMEMORY_DB_PATH` can select another database path.
- The installer configures files for the selected editor or agent, including settings and workflow instructions.
- The embedding model, about 23 MB, must be downloaded on first use; the README says there are no network calls after that download.

## Risks
- Knowledge is written by the agent after reading code, so it may be incomplete or inaccurate; the conflict-resolution workflow calls for checking content against the current codebase.
- The database is a SQLite file. Git cannot automatically merge independent branch changes to it, so the provided merge commands are needed.
- The README describes semantic search as brute-force cosine similarity and gives fewer than 10,000 nodes as its stated performance range.

## Client config (JSON)
```json
{"megamemory":{"type":"local","command":["megamemory"],"enabled":true}}
```

## Tools (9)
- `understand`: Search the knowledge graph semantically and return matched concepts with children, edges, and parent context.
- `get_concept`: Look up a concept by exact ID and return its children, edges, incoming edges, and parent context.
- `create_concept`: Add a concept, optionally with edges and file references.
- `update_concept`: Update fields on an existing concept and regenerate its embeddings automatically.
- `link`: Create a typed relationship between two concepts.
- `remove_concept`: Soft-delete a concept with a reason while preserving history.
- `list_roots`: List all top-level concepts with their direct children.
- `list_conflicts`: List unresolved merge conflicts grouped by merge group.
- `resolve_conflict`: Resolve a merge conflict using content verified against the current codebase.
