Memory Graph

by gregorydickson

Not rated
GitHub

Description

A graph-based Model Context Protocol (MCP) server that gives AI coding agents persistent memory. Originally built for Claude Code, MemoryGraph works with any MCP-enabled coding agent. Store development patterns, track relationships, and retrieve contextual knowledge across…

About

A graph-based Model Context Protocol (MCP) server that gives AI coding agents persistent memory. Originally built for Claude Code, MemoryGraph works with any MCP-enabled coding agent. Store development patterns, track relationships, and retrieve contextual knowledge across sessions and projects.

Details

Author
gregorydickson
Categories
Productivity, Other, AI

Setup

Install Memory Graph in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/gregorydickson/memory-graph

Follow the installation instructions in the repository README, then restart your MCP client.

Graph-based Memory CLI for AI Coding Agents

A graph-based memory system that gives AI coding agents persistent memory.
Store patterns, track relationships, retrieve knowledge across sessions.

Coding agents already execute shell commands, so they can use MemoryGraph directly. Two steps: install globally, then add instructions.

cd memory-graph/ts && bun install && bun link # or: bun build src/cli.ts --compile --outfile ~/.local/bin/memorygraph memorygraph stats # verify

memorygraphis now available from any directory. Data persists in~/.memorygraph/.

Paste this into your agent's instruction file (~/.claude/CLAUDE.md,.cursorrules,.windsurfrules, orAGENTS.md):

## Memory memorygraph CLI is installed. Use it for persistent memory across sessions. Before work: memorygraph recall --query "<task>" --limit 10 and memorygraph briefing On decisions/fixes: memorygraph store --type solution --title "<title>" --content "<what>" --tags "<component>,fix" On errors: memorygraph store --type error --title "<error>" --content "<details>" --tags "<component>,error" Link: memorygraph link <from-id> <to-id> SOLVES --strength 0.8 Session end: memorygraph store --type conversation --title "Session: <topic>" --content "<summary>" --tags "<tags>" Types: solution | problem | code_pattern | fix | error | workflow | command | technology Tags: lowercase, hyphenated, include component (auth, database, cli), 2-5 per memory Do NOT wait to be asked. Store automatically on triggers.
# Start: load context memorygraph recall --query "authentication redis" --limit 10 memorygraph briefing # Fix a bug: store problem + solution, link them memorygraph store --type problem --title "Auth token expiry too short" --content "Tokens expiring after 1h" --tags "auth,bug" # → abc-123 memorygraph store --type solution --title "Extend token expiry to 24h" --content "Changed JWT expiry, added refresh rotation" --tags "auth,fix" --importance 0.8 # → def-456 memorygraph link def-456 abc-123 SOLVES --strength 0.9 # End: store summary memorygraph store --type conversation --title "Session: auth token fix" --content "Fixed token expiry, added refresh rotation" --tags "auth,session-summary"

All projects share~/.memorygraph/falkordblite.dbby default. To isolate per project:

export MEMORY_FALKORDBLITE_PATH=~/.memorygraph/my-project.falkor # or tag memories with project name and filter: memorygraph search --query "auth" --tags my-project

- Agent not using commands: Use "REQUIRED"/"MUST" in instructions, include exact commands
- Command not found:bun linkfromts/, or ensure~/.local/binis on PATH
- Memories not persisting:memorygraph configto check path,memorygraph healthto verify

Flat storage (CLAUDE.md, vector stores) keeps memories as isolated entries. Graph storage connects them:

[timeout_fix] --CAUSES--> [memory_leak] --SOLVED_BY--> [connection_pooling] | | +------------------SUPERSEDED_BY------------------------+

Query: "What happened with retry logic?" returns the full causal chain, not just individual memories.

# Use FalkorDBLite (default, zero-config) bun run src/cli.ts stats # Use SQLite MEMORY_BACKEND=sqlite bun run src/cli.ts stats # Use FalkorDB (client-server) MEMORY_BACKEND=falkordb MEMORY_FALKORDB_HOST=localhost MEMORY_FALKORDB_PORT=6379 bun run src/cli.ts stats # Use Memgraph MEMORY_BACKEND=memgraph MEMORY_MEMGRAPH_URI=bolt://localhost:7687 bun run src/cli.ts stats # Use Cloud MEMORY_BACKEND=cloud MEMORYGRAPH_API_KEY=mg_your_key bun run src/cli.ts stats
# Start of session: recall recent context bun run src/cli.ts recall --query "recent work" --limit 10 # During work: store decisions and patterns bun run src/cli.ts store \ --type solution \ --title "Use JWT for auth" \ --content "JWT tokens with 24h expiry, refresh token rotation" \ --tags "auth,security,api" \ --importance 0.8 # Link it to a prior decision bun run src/cli.ts link <new-id> <prior-id> BUILDS_ON --strength 0.9 # End of session: store summary bun run src/cli.ts store \ --type conversation \ --title "Session: auth refactor" \ --content "Refactored auth middleware, added JWT, fixed token refresh bug" \ --tags "auth,session-summary" # Export backup bun run src/cli.ts export --format json --output session-backup.json
## Memory Protocol ### REQUIRED: Before Starting Work You MUST use recall before any task. Query by project, tech, or task type. ### REQUIRED: Automatic Storage Triggers Store memories on ANY of: - Git commit: what was fixed/added - Bug fix: problem + solution - Architecture decision: choice + rationale - Pattern discovered: reusable approach ### Memory Fields - Type: solution | problem | code_pattern | fix | error | workflow - Title: Specific, searchable - Content: Accomplishment, decisions, patterns - Tags: project, tech, category (required) - Importance: 0.8+ critical, 0.5-0.7 standard, 0.3-0.4 minor - Relationships: Link related memories when they exist
memory-graph/ ├── ts/ │ ├── src/ │ │ ├── cli.ts # CLI entry point (35+ commands) │ │ ├── index.ts # Library exports │ │ ├── config.ts # Configuration management │ │ ├── database.ts # Database interface │ │ ├── models.ts # Data models and schemas │ │ ├── backends/ # Backend implementations │ │ │ ├── falkordb-shared.ts # Shared FalkorDB base class │ │ │ ├── falkordblite.ts # Embedded FalkorDBLite │ │ │ ├── falkordb.ts # Client-server FalkorDB │ │ │ ├── bolt-shared.ts # Shared Bolt protocol base │ │ │ ├── memgraph.ts # Memgraph (Bolt protocol) │ │ │ ├── sqlite.ts # SQLite fallback │ │ │ ├── cloud.ts # Cloud REST API │ │ │ └── factory.ts # Backend factory │ │ ├── tools/ # CLI tool handlers │ │ ├── intelligence/ # Entity extraction, pattern recognition, context retrieval │ │ ├── analytics/ # Graph visualization, similarity, learning paths │ │ ├── proactive/ # Session briefing, predictions, outcome learning │ │ ├── integration/ # Context capture, project analysis, workflow tracking │ │ ├── migration/ # Backend-to-backend migration │ │ ├── sdk/ # Cloud API client SDK │ │ └── utils/ # Export/import, validation, helpers │ ├── tests/ # 97 tests │ └── package.json ├── docs/ # Documentation └── CLAUDE.md # Agent instructions
cd ts bun install bun test # Run tests npx tsc --noEmit # Type check bun build src/cli.ts --compile --outfile memorygraph # Compile binary
# Import from JSON export bun run src/cli.ts import --input backup.json --skip-duplicates # Migrate between backends bun run src/cli.ts migrate --to sqlite --to-path ./local.db bun run src/cli.ts migrate --to falkordblite --to-path ./graph.falkor --no-verify bun run src/cli.ts migrate --to memgraph --to-uri bolt://localhost:7687

The TypeScript SDK provides a client for the MemoryGraph Cloud API:

import { MemoryGraphClient } from "memorygraph/sdk"; const client = new MemoryGraphClient({ apiKey: "mg_..." }); const memory = await client.createMemory({ type: "solution", title: "Fixed timeout issue", content: "Used exponential backoff with retries", tags: ["redis", "timeout"], });

Start simple. Upgrade when needed. Never lose context again.

Persistent memory for any AI assistant. Zero token cost until recall. Stores memories in local SQLite, ranks by 6-factor scoring, returns results 79% smaller than JSON. Works with Claude, ChatGPT, Grok, Cursor, Windsurf, and any MCP client.

After Effects MCP is a full-featured automation bridge that connects AI clients (like VS Code, Claude Desktop, and Claude Code) to Adobe After Effects through MCP, enabling scripted control of compositions, layers, effects, keyframes/graph easing, presets, markers, audio levels, waveform analysis, and effect discovery via a live bridge panel.

Project management your AI can actually run — connect Claude, ChatGPT, Cursor & Codex to one board over MCP.

AIOProductOS spine over MCP — customers, revenue, feedback, work, analytics on one typed record.

The memory layer for AI coding tools. Local-first, semantic, 9 MCP tools with consolidation and project scoping. Works with Claude Code, Cursor, Windsurf & any MCP client.

One MCP server for Claude, ChatGPT & Gemini — wraps your ERPs, CRMs, APIs and knowledge base into a single governed endpoint.

Run your field service business from Claude: answer calls, book and dispatch jobs, build estimates, chase invoices. Built for HVAC, plumbing, electrical, roofing and pest control.

Complete Swiss accounting integration for Bexio via MCP. Works with Claude Desktop, n8n, and any MCP client. 221 tools for invoices, contacts, projects & more.

Persistent memory MCP server for Claude Desktop — remembers context, time, and topics across sessions

An MCP extension for the Claude Desktop application that enables automation and integration.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.