Memgraph Context Graph plugin

Agent memory in the Memgraph graph database: sessions, tool calls and notes that an agent can recall in later sessions.

  • 119 ★ on the repository
  • Last commit
  • MIT
Plugin

Broad access

Why this level

  • Hooks write conversations and tool calls into the database, and these can hold secrets and code.
  • The installer runs through `curl | bash` and starts a Docker container with persistent storage.
All reasons and checks

memgraph/ai-toolkit

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add plugins/memgraph-context-graph

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • Hooks write conversations and tool calls into the database, and these can hold secrets and code.
  • The installer runs through `curl | bash` and starts a Docker container with persistent storage.

This is third-party code. Review the repository files before installing.

What it does

Context Graph records what happened in agent sessions in Memgraph: conversations, tool calls, used skills and notes the agent decided to keep. In later sessions the agent searches past conversations with `recall` and stores durable notes through `memory`. With `--memory-backend context-graph` the graph becomes the primary memory store, shared across agents and checkouts of one repository. Supported agents are Claude Code, Codex, Copilot CLI, Cursor, OpenCode, Antigravity CLI and Grok Build, plus apps built with the Claude Agent SDK or OpenAI Agents SDK. Claude Code and Codex get user-wide plugins, the others get hooks in the chosen project and an MCP server. `memgraph-context-graph ui` opens a terminal session viewer. A local GLiNER2 model extracts entities and relationships from conversations.

Who it is for. Developers who work with several agents at once and want their shared memory stored in a database they control.

Good fit when

  • An agent should recall how a similar problem was solved in a past session.
  • One action log across Claude Code, Codex and Cursor is needed, searchable with Cypher.
  • Memory should follow you across machines and checkouts together with your own database.
  • Entities and relationships must be pulled from agent conversations into a knowledge graph.

Not a fit when

  • Agent conversations contain data that must not be stored even in a local database.
  • Docker is unavailable and no Memgraph 3.6 or newer is at hand.
  • The built-in agent memory is enough for a single project.

Example request

Find in past sessions how we configured database migrations in this repository and give a short summary.

Limitations

Memgraph 3.6 or newer is required, with the `memgraph/memgraph-mage` image for vector recall. The installer starts a Docker container itself unless you name your own database. Session capture and recall need no LLM key, while entity extraction runs locally with GLiNER2 and needs the extra `reconciliation` package. Hooks write the session flow into the database, and Codex asks you to trust them. Restart the agent after install. The recall quality figure (87.4% on LongMemEval-S) was measured by the author on public benchmarks.

How to disable. Remove the plugins and hooks from the configuration of each agent the installer touched. Remove the Memgraph container and its data separately through Docker.

FAQ

How do I install Context Graph?

Run `curl -fsSL https://raw.githubusercontent.com/memgraph/ai-toolkit/main/context-graph/scripts/install.sh | bash`. If the CLI is already present, pick agents with `memgraph-context-graph setup claude-code codex`.

Is an LLM key needed?

No. Capture and recall work without a key. A key is needed only for the optional learning of an ontology from the user sessions.

What does `--memory-backend context-graph` do?

The agent gets `memory` and `recall` tools and the graph becomes its main memory store. Return to built-in memory with `--memory-backend native`.

Which agents are supported?

Claude Code, Codex, Copilot CLI, Cursor, OpenCode, Antigravity CLI and Grok Build, plus apps built on the Claude Agent SDK and OpenAI Agents SDK.

How do I see what was captured?

`memgraph-context-graph ui` opens a terminal viewer with capture health, sessions and entities. You can query the graph in Cypher from Memgraph Lab.

Discussion

No questions or reviews yet.

Plugins

Shared local memory for AI agents: Claude Code, Codex, Cursor and others find the agreements of past sessions in it and record new ones

CLIBroad access2.2KRepository stars

A long-term memory plugin that keeps decisions, preferences and task state across sessions and injects only what a query needs

PluginBroad access401Repository stars

Persistent memory for coding agents: insights are stored as markdown cards and recalled at the start of the next session.

MCP serverExtended access144Repository stars
Editors’ pick

Memory layer for agents: plugins for Claude Code, Codex, Cursor and OpenCode, plus a CLI and SDKs that carry context across sessions

PluginExtended access68.9KRepository stars

Long-term agent memory in local Markdown files with a link graph, semantic search and MCP access

MCP serverExtended access4.6KRepository stars

Shared semantic memory for agents: conversations are saved as markdown and recalled by search across Claude Code, Codex and other agents

PluginExtended access2.9KRepository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
Memgraph Context Graph (this card)no119
Episodic Memoryno499searches agent conversations by meaning; Context Graph stores them as a graph of sessions and actions in Memgraph
MCP Memory Servicenonot required2,117a self-hosted memory service with a knowledge graph; here the graph is built on Memgraph from agent hooks

README in short

The repository bundles several Python packages for Memgraph. This card covers Context Graph, while the others (`unstructured2graph`, `langchain-memgraph`, `mcp-memgraph`) install independently.

README badge

Report a problem