AI applicationsAI memorySupported agents

Supported agents

Context Graph works with seven coding agents. For each one, setup installs hooks that record sessions, registers the Model Context Protocol (MCP) server that serves the recall and memory tools, and can turn off the agent’s own memory.

This page lists the files setup changes for each agent, and where the agents behave differently. For an app you build on an agent SDK, see Custom agents.

AgentRuntime nameHow it’s connectedApplies to
Claude Codeclaude-codeContext Graph pluginYour user
CodexcodexContext Graph pluginYour user
GitHub Copilot CLIcopilot-cli.github/hooks/memgraph-context-graph.jsonOne project
Cursorcursor.cursor/hooks.jsonOne project
OpenCodeopencode.opencode/plugins/memgraph-context-graph/index.jsOne project
Antigravity CLIantigravity-cli.agents/hooks.jsonOne project
Grok Buildgrok.grok/hooks/memgraph-context-graph.jsonOne project

Use the runtime name to choose agents in memgraph-context-graph setup, update, uninstall and doctor.

Claude Code and Codex sessions are recorded in any directory. For the other agents, the hook file is in the project directory, never in your home directory, so only sessions started in a connected project are recorded. Connect more projects with --project-dir. If a hook file already exists, setup keeps your own hooks in it.

MCP server registration

The recall and memory tools are served by memgraph-context-graph mcp, an MCP server named context-graph. Memory belongs to you, not to one project, so the server is registered in each agent’s user-level configuration:

AgentWhere the server is registeredHow its tools are allowed
Claude CodeThe pluginThe plugin
CodexThe pluginThe plugin
GitHub Copilot CLI~/.copilot/mcp-config.jsonCopilot CLI has no allow list: approve the tools once, or start it with --allow-tool=context-graph
Cursor~/.cursor/mcp.jsonMcp(context-graph:*) in ~/.cursor/cli-config.json
OpenCodemcp.servers in ~/.config/opencode/opencode.jsonAn allow rule in permissions
Antigravity CLI~/.gemini/config/mcp_config.jsonmcp(context-graph/*) in ~/.gemini/antigravity-cli/settings.json
Grok Build~/.grok/config.tomlMCPTool(context-graph__*)

Setup adds the tools to the agent’s allow list because an agent that runs without a person, for example in a script, refuses a tool that needs approval. Each file setup edits keeps the rest of its content and is backed up once, to FILE_NAME.context-graph.bak next to it.

Setup registers the server with the agent’s runtime name, as in memgraph-context-graph mcp --agent cursor, so it uses the agent’s profile. Pass the same flag if you register it yourself.

Built-in memory

When you make Context Graph the agents’ memory, setup turns off the agent’s own memory, so the agent doesn’t keep two. Some agents have no memory of their own to turn off.

AgentBuilt-in memoryWhat setup changes
Claude CodeAuto memorySets autoMemoryEnabled: false in ~/.claude/settings.json and imports the existing memory files
CodexMemoriesTurns off features.memories, memories.use_memories and memories.generate_memories in ~/.codex/config.toml and imports the existing memory
GitHub Copilot CLICopilot Memory, stored on GitHubSets "memory": false in ~/.copilot/settings.json; the memory stays on GitHub and isn’t imported
CursorNoneNothing
OpenCodeNoneNothing
Antigravity CLINone in the CLINothing
Grok BuildTopic notes in ~/.grok/memory-v2/Sets [memory_v2] enabled = false and imports the notes to /memories/grok/

See Memory for how the import works and how to switch back.

Differences between agents

The agents’ hooks don’t all expose the same events. By default, an agent gets the session-start note, its session is processed when it ends, and its pre-tool hook can only allow, block or rewrite a tool call. The differences:

AgentDiffers from the default
Claude CodeGets a note right before a tool runs, such as that a GitHub issue it’s about to fetch is already in the graph.
CodexGets a note right before a tool runs, as Claude Code does. Reloads the memory index after it compacts the context. Sessions are processed at the end of each turn.
GitHub Copilot CLINone
CursorThe session-start note reaches the Cursor CLI; the Cursor editor’s agent window may not show it to the model.
OpenCodeWith opencode run, sessions are processed at the end of each turn.
Antigravity CLISessions are processed at the end of each turn. Context Graph reads prompts and replies from the agent’s session transcript.
Grok BuildGets the session-start note through the MCP server’s instructions.

Codex also differs in two smaller ways:

  • Its session-start note is limited to 9,000 characters instead of 10,000, because Codex accepts about 2,500 tokens of hook text.
  • A patch Codex rejects before applying it, and a view_image call, are stored without a result.

Connect an agent manually

Setup connects agents for you. To install the Claude Code or Codex plugin yourself, for example on a machine where you manage plugins by hand, install context-graph from the Memgraph marketplace, which also has the Memgraph plugin:

claude plugin marketplace add memgraph/marketplace
claude plugin install context-graph@memgraph -y

The plugin doesn’t install the memgraph-context-graph command its hooks run. Without it, nothing is recorded, and the agent offers to run the plugin’s setup skill (/context-graph:setup in Claude Code), which asks before it installs the command and runs setup.

For the per-project agents, the memgraph-context-graph hook init RUNTIME command writes the hook file in the current directory, where RUNTIME is the agent’s runtime name:

memgraph-context-graph hook init cursor

The hook init command writes only the hooks. Run memgraph-context-graph setup for the MCP server registration and the memory switch.