A self-hosted memory layer for AI agents that stores explicit facts with sources and shares one brain across agents, MCP clients and the CLI.
memory-graph/memory-graph
A graph-database-backed memory CLI that gives AI coding agents persistent memory with linked relationships across sessions.
- Stars
- 257
- Forks
- 85
- Open issues
- 1
- Last commit
- 2 months ago
What is it?
MemoryGraph is a command-line tool that stores knowledge from AI coding sessions, such as solutions, errors, fixes, and patterns, as nodes in a graph. Each memory can be linked to others with typed relationships like SOLVES, CAUSES, or SUPERSEDES, so a query can return a chain of related events rather than isolated notes.
Coding agents that can run shell commands can call the memorygraph CLI directly. The project includes sample instruction text to paste into files such as CLAUDE.md or AGENTS.md, telling the agent when to recall context at the start of work and when to store decisions and fixes. Data is kept locally in ~/.memorygraph/ by default, with an embedded FalkorDBLite graph store that needs no server.
The CLI covers storing, searching, and linking memories, plus analytics, export and import, and migration between backends. Supported backends include SQLite, FalkorDB, Memgraph, and a cloud API. The project is written in TypeScript and runs on Bun.
Key features
- 01Stores typed memories such as solutions, errors, fixes, and code patterns.
- 02Links memories with relationship types like SOLVES, CAUSES, and BUILDS_ON.
- 03Recalls relevant context with natural-language or filtered search.
- 04Supports local embedded storage with no server setup, plus SQLite, FalkorDB, Memgraph, and cloud backends.
- 05Exports to JSON or Markdown and migrates data between backends.
Use cases
- Giving a coding agent memory of past bug fixes and architecture decisions across sessions.
- Tracking which errors led to which fixes in a project over time.
- Keeping separate memory stores per project by setting a database path or tag filter.
Quick start
- 1
Install dependencies and link the CLI globally (from the repo's ts folder)
cd memory-graph/ts && bun install && bun link - 2
Verify the install by checking database statistics
memorygraph stats
Things to know
- Requires the Bun runtime to install and run.
- Alternative backends such as FalkorDB, Memgraph and cloud need a separate server or an API key.
In collections
Topics
FAQ
- What is memory-graph?
- A graph-database-backed memory CLI that gives AI coding agents persistent memory with linked relationships across sessions. MemoryGraph is a command-line tool that stores knowledge from AI coding sessions, such as solutions, errors, fixes, and patterns, as nodes in a graph. Each memory can be linked to others with typed relationships like SOLVES, CAUSES, or SUPERSEDES, so a query can return a chain of related events rather than isolated notes.
- Is memory-graph free to use? What license does it have?
- memory-graph is open source under the MIT license. Check the license terms before using it in commercial products.
- Is memory-graph still maintained?
- Updated within 6 months. The last commit to memory-graph was on Sep 16, 2026.
- What can I use memory-graph for?
- Giving a coding agent memory of past bug fixes and architecture decisions across sessions. Tracking which errors led to which fixes in a project over time. Keeping separate memory stores per project by setting a database path or tag filter.
- How do I install memory-graph?
- Install dependencies and link the CLI globally (from the repo's ts folder): cd memory-graph/ts && bun install && bun link Verify the install by checking database statistics: memorygraph stats
- Where can I get memory-graph?
- The source code and installation instructions are on GitHub: https://github.com/memory-graph/memory-graph
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Persistent memory for AI coding agents: a single Go binary with SQLite full-text search, exposed via MCP, HTTP API, CLI and TUI.
A local-first control plane that unifies config, session monitoring, cross-agent messaging, and memory for AI coding agents like Claude Code and Codex CLI.
Indexes local coding-agent session history from many tools into one SQLite database that agents can query and humans can browse.
A RAG framework for LLMs that builds a knowledge graph from documents and uses Personalized PageRank to support multi-hop retrieval and long-term memory.
An open-source long-term memory layer for AI agents that stores and recalls information across sessions via a Python SDK, REST API, and MCP server.